From 9af32655dbeec9ad33973c2c20cbe54684e2ee63 Mon Sep 17 00:00:00 2001 From: DreamSourceLab Date: Sat, 18 Jan 2020 14:28:05 +0800 Subject: [PATCH] Fix some compile warnings --- DSView/pv/data/decode/decoder.h | 3 +++ DSView/pv/data/signaldata.cpp | 2 ++ DSView/pv/data/signaldata.h | 2 +- DSView/pv/dialogs/calibration.cpp | 2 +- DSView/pv/view/xcursor.cpp | 2 +- libsigrok4DSL/hardware/DSL/dscope.c | 4 ++-- libsigrok4DSL/libsigrok.h | 3 +-- libsigrok4DSL/output/srzip.c | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/DSView/pv/data/decode/decoder.h b/DSView/pv/data/decode/decoder.h index 4f9d40ad..0309ae47 100755 --- a/DSView/pv/data/decode/decoder.h +++ b/DSView/pv/data/decode/decoder.h @@ -24,6 +24,9 @@ #include #include +#include +#include +#include #include diff --git a/DSView/pv/data/signaldata.cpp b/DSView/pv/data/signaldata.cpp index a4cd3af3..19005905 100755 --- a/DSView/pv/data/signaldata.cpp +++ b/DSView/pv/data/signaldata.cpp @@ -32,6 +32,8 @@ SignalData::SignalData() : { } +SignalData::~SignalData() {} + double SignalData::samplerate() const { return _samplerate; diff --git a/DSView/pv/data/signaldata.h b/DSView/pv/data/signaldata.h index f3e9c624..7ade4ddd 100755 --- a/DSView/pv/data/signaldata.h +++ b/DSView/pv/data/signaldata.h @@ -34,7 +34,7 @@ class SignalData { public: SignalData(); - + virtual ~SignalData() = 0; public: double samplerate() const; void set_samplerate(double samplerate); diff --git a/DSView/pv/dialogs/calibration.cpp b/DSView/pv/dialogs/calibration.cpp index 5a42222d..36298622 100755 --- a/DSView/pv/dialogs/calibration.cpp +++ b/DSView/pv/dialogs/calibration.cpp @@ -45,7 +45,7 @@ const QString Calibration::VCOMB = QT_TR_NOOP(" VCOMB"); Calibration::Calibration(QWidget *parent) : DSDialog(parent) { -#ifdef Q_OS_OSX +#ifdef Q_OS_DARWIN Qt::WindowFlags flags = windowFlags(); this->setWindowFlags(flags | Qt::Tool); #endif diff --git a/DSView/pv/view/xcursor.cpp b/DSView/pv/view/xcursor.cpp index 24e4e300..2566505d 100755 --- a/DSView/pv/view/xcursor.cpp +++ b/DSView/pv/view/xcursor.cpp @@ -50,7 +50,7 @@ XCursor::XCursor(View &view, QColor &colour, const std::vector< boost::shared_ptr > sigs(_view.session().get_signals()); BOOST_FOREACH(const boost::shared_ptr s, sigs) { boost::shared_ptr dsoSig; - if (dsoSig = dynamic_pointer_cast(s)) + if ((dsoSig = dynamic_pointer_cast(s))) if (dsoSig->enabled()) { _dsoSig = dsoSig; break; diff --git a/libsigrok4DSL/hardware/DSL/dscope.c b/libsigrok4DSL/hardware/DSL/dscope.c index 81174156..df1a2fbe 100755 --- a/libsigrok4DSL/hardware/DSL/dscope.c +++ b/libsigrok4DSL/hardware/DSL/dscope.c @@ -1733,13 +1733,13 @@ static int dso_tune(const struct sr_dev_inst *sdi) else margin -= (devc->mstatus.ch1_acc_mean * 1.0 / devc->limit_samples); - if ((devc->tune_probe->coupling == SR_AC_COUPLING) && (abs(margin) < 0.5)) { + if ((devc->tune_probe->coupling == SR_AC_COUPLING) && (fabs(margin) < 0.5)) { devc->tune_probe->coupling = SR_DC_COUPLING; ret = dsl_wr_dso(sdi, dso_cmd_gen(sdi, devc->tune_probe, SR_CONF_PROBE_COUPLING)); } else if (devc->tune_probe->coupling == SR_AC_COUPLING){ (devc->tune_probe->vga_ptr+devc->tune_stage)->preoff += margin; ret = dsl_wr_dso(sdi, dso_cmd_gen(sdi, devc->tune_probe, SR_CONF_PROBE_OFFSET)); - } else if ((devc->tune_probe->coupling == SR_DC_COUPLING) && (abs(margin) < 0.5)) { + } else if ((devc->tune_probe->coupling == SR_DC_COUPLING) && (fabs(margin) < 0.5)) { devc->tune_stage++; if (devc->profile->dev_caps.vdivs[devc->tune_stage] != 0) { ret = dsl_wr_ext(sdi, 0x01, mux[devc->tune_stage]); diff --git a/libsigrok4DSL/libsigrok.h b/libsigrok4DSL/libsigrok.h index 77d01ebe..1409514d 100755 --- a/libsigrok4DSL/libsigrok.h +++ b/libsigrok4DSL/libsigrok.h @@ -1223,8 +1223,7 @@ struct sr_session { GSList *devs; /** List of struct datafeed_callback pointers. */ GSList *datafeed_callbacks; - GTimeVal starttime; - gboolean running; + gboolean running; unsigned int num_sources; diff --git a/libsigrok4DSL/output/srzip.c b/libsigrok4DSL/output/srzip.c index aa9af27d..a4643636 100755 --- a/libsigrok4DSL/output/srzip.c +++ b/libsigrok4DSL/output/srzip.c @@ -299,7 +299,7 @@ static int cleanup(struct sr_output *o) static struct sr_option options[] = { { "filename", "Filename", "File to write", NULL, NULL }, - {0} + {0, 0, 0, 0, 0} }; static const struct sr_option *get_options(void)