diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/pv/data/decoderstack.cpp index 2ad6a532..38d54a00 100644 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/pv/data/decoderstack.cpp @@ -627,8 +627,9 @@ void DecoderStack::decode_proc() _error_message = QString::fromLocal8Bit(error); // Destroy the session - if (error) + if (error) { g_free(error); + } srd_session_destroy(session); _decode_state = Stopped; @@ -657,8 +658,9 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder) //lock_guard lock(d->_output_mutex); - if (d->_no_memory) + if (d->_no_memory) { return; + } const Annotation a(pdata); diff --git a/DSView/pv/data/logicsnapshot.cpp b/DSView/pv/data/logicsnapshot.cpp index 199f47bc..0a2d6979 100644 --- a/DSView/pv/data/logicsnapshot.cpp +++ b/DSView/pv/data/logicsnapshot.cpp @@ -578,7 +578,7 @@ bool LogicSnapshot::get_nxt_edge( return false; //const unsigned int min_level = max((int)floorf(logf(min_length) / logf(Scale)) - 1, 0); - const unsigned int min_level = max((int)(log2f(min_length) - 1) / ScalePower, 0); + const unsigned int min_level = max((int)(log2f(min_length) - 1) / (int)ScalePower, 0); uint64_t root_index = index >> (LeafBlockPower + RootScalePower); uint8_t root_pos = (index & RootMask) >> LeafBlockPower; bool edge_hit = false; @@ -623,7 +623,7 @@ bool LogicSnapshot::get_pre_edge(uint64_t &index, bool last_sample, return false; //const unsigned int min_level = max((int)floorf(logf(min_length) / logf(Scale)) - 1, 1); - const unsigned int min_level = max((int)(log2f(min_length) - 1) / ScalePower, 0); + const unsigned int min_level = max((int)(log2f(min_length) - 1) / (int)ScalePower, 0); int root_index = index >> (LeafBlockPower + RootScalePower); uint8_t root_pos = (index & RootMask) >> LeafBlockPower; bool edge_hit = false; diff --git a/DSView/pv/data/logicsnapshot.h b/DSView/pv/data/logicsnapshot.h index 10656051..f914c1fb 100644 --- a/DSView/pv/data/logicsnapshot.h +++ b/DSView/pv/data/logicsnapshot.h @@ -45,11 +45,11 @@ namespace data { class LogicSnapshot : public Snapshot { private: - static const int ScaleLevel = 4; - static const int ScalePower = 6; + static const uint64_t ScaleLevel = 4; + static const uint64_t ScalePower = 6; static const uint64_t Scale = 1 << ScalePower; - static const int ScaleSize = Scale / 8; - static const int RootScalePower = ScalePower; + static const uint64_t ScaleSize = Scale / 8; + static const uint64_t RootScalePower = ScalePower; static const uint64_t RootScale = 1 << RootScalePower; static const uint64_t LeafBlockSpace = (Scale + Scale*Scale + Scale*Scale*Scale + Scale*Scale*Scale*Scale) / 8; diff --git a/DSView/pv/prop/bool.cpp b/DSView/pv/prop/bool.cpp index f51fc4cb..ecc6a2e7 100644 --- a/DSView/pv/prop/bool.cpp +++ b/DSView/pv/prop/bool.cpp @@ -57,9 +57,10 @@ QWidget* Bool::get_widget(QWidget *parent, bool auto_commit) g_variant_unref(value); } - if (auto_commit) + if (auto_commit) { connect(_check_box, SIGNAL(stateChanged(int)), this, SLOT(on_state_changed(int))); + } return _check_box; } diff --git a/DSView/pv/prop/double.cpp b/DSView/pv/prop/double.cpp index 73a174bb..a0c8cec3 100644 --- a/DSView/pv/prop/double.cpp +++ b/DSView/pv/prop/double.cpp @@ -72,9 +72,10 @@ QWidget* Double::get_widget(QWidget *parent, bool auto_commit) g_variant_unref(value); } - if (auto_commit) + if (auto_commit) { connect(_spin_box, SIGNAL(valueChanged(double)), this, SLOT(on_value_changed(double))); + } return _spin_box; } diff --git a/DSView/pv/prop/enum.cpp b/DSView/pv/prop/enum.cpp index af4a8c9f..aad0c08e 100644 --- a/DSView/pv/prop/enum.cpp +++ b/DSView/pv/prop/enum.cpp @@ -57,8 +57,9 @@ QWidget* Enum::get_widget(QWidget *parent, bool auto_commit) return _selector; GVariant *const value = _getter ? _getter() : NULL; - if (!value) + if (!value) { return NULL; + } _selector = new QComboBox(parent); _selector->setSizeAdjustPolicy(QComboBox::AdjustToContents); @@ -72,9 +73,10 @@ QWidget* Enum::get_widget(QWidget *parent, bool auto_commit) g_variant_unref(value); - if (auto_commit) + if (auto_commit) { connect(_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(on_current_item_changed(int))); + } return _selector; } diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/pv/toolbars/samplingbar.cpp index 1375370a..b1da58a2 100644 --- a/DSView/pv/toolbars/samplingbar.cpp +++ b/DSView/pv/toolbars/samplingbar.cpp @@ -512,8 +512,9 @@ void SamplingBar::commit_sample_rate() sample_rate = _sample_rate.itemData( index).value(); - if (sample_rate == 0) + if (sample_rate == 0) { return; + } get_selected_device()->set_config(NULL, NULL, SR_CONF_SAMPLERATE, diff --git a/DSView/pv/view/header.cpp b/DSView/pv/view/header.cpp index d8aa85ca..0bd859c9 100644 --- a/DSView/pv/view/header.cpp +++ b/DSView/pv/view/header.cpp @@ -163,8 +163,9 @@ void Header::mousePressEvent(QMouseEvent *event) _view.get_traces(ALL_VIEW)); int action; const bool instant = _view.session().get_instant(); - if (instant && _view.session().get_capture_state() == SigSession::Running) + if (instant && _view.session().get_capture_state() == SigSession::Running) { return; + } if (event->button() & Qt::LeftButton) { _mouse_down_point = event->pos(); diff --git a/DSView/pv/view/ruler.cpp b/DSView/pv/view/ruler.cpp index 3da9e04f..e900074c 100644 --- a/DSView/pv/view/ruler.cpp +++ b/DSView/pv/view/ruler.cpp @@ -194,8 +194,9 @@ void Ruler::paintEvent(QPaintEvent*) draw_hover_mark(p); // Draw cursor selection - if (_cursor_sel_visible || _cursor_go_visible) + if (_cursor_sel_visible || _cursor_go_visible) { draw_cursor_sel(p); + } p.end(); }