From: Uwe Hermann Date: Tue, 21 Mar 2017 23:01:10 +0000 (+0100) Subject: Use bool literals for boolean values. X-Git-Tag: pulseview-0.4.0~124 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0402d7a3e425c56321234e4bb546d9b698c6d237;p=pulseview.git Use bool literals for boolean values. This patch was generated using clang-tidy: clang-tidy -checks="-*,modernize-use-bool-literals" -fix --- diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 4d9eb000..d3e1f4ac 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -423,7 +423,7 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder) if (row_iter == d->rows_.end()) { qDebug() << "Unexpected annotation: decoder = " << decc << ", format = " << a.format(); - assert(0); + assert(false); return; } diff --git a/pv/prop/int.cpp b/pv/prop/int.cpp index 789c26eb..d791bd96 100644 --- a/pv/prop/int.cpp +++ b/pv/prop/int.cpp @@ -90,7 +90,7 @@ QWidget* Int::get_widget(QWidget *parent, bool auto_commit) range_min = 0, range_max = UINT64_MAX; } else { // Unexpected value type. - assert(0); + assert(false); } // @todo Sigrok supports 64-bit quantities, but Qt does not have a @@ -143,7 +143,7 @@ void Int::commit() else { // Unexpected value type. - assert(0); + assert(false); } assert(new_value); diff --git a/pv/session.cpp b/pv/session.cpp index 0fef9c91..f65b05a1 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -810,7 +810,7 @@ void Session::update_signals() } default: - assert(0); + assert(false); break; } } @@ -859,7 +859,7 @@ void Session::sample_thread_proc(function error_handler) // Confirm that SR_DF_END was received if (cur_logic_segment_) { qDebug("SR_DF_END was not received."); - assert(0); + assert(false); } // Optimize memory usage diff --git a/pv/strnatcmp.hpp b/pv/strnatcmp.hpp index 0295a5c5..1d8f5a24 100644 --- a/pv/strnatcmp.hpp +++ b/pv/strnatcmp.hpp @@ -89,7 +89,7 @@ static int strnatcmp0(char const *a, char const *b, int fold_case) ai = bi = 0; - while (1) { + while (true) { ca = a[ai]; cb = b[bi]; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index f7046ce5..2f4ac22c 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -395,7 +395,7 @@ QAction* LogicSignal::action_from_trigger_type(const TriggerMatchType *type) action = trigger_change_; break; default: - assert(0); + assert(false); } } diff --git a/pv/widgets/sweeptimingwidget.cpp b/pv/widgets/sweeptimingwidget.cpp index be2c8b89..6e24d948 100644 --- a/pv/widgets/sweeptimingwidget.cpp +++ b/pv/widgets/sweeptimingwidget.cpp @@ -154,7 +154,7 @@ uint64_t SweepTimingWidget::value() const default: // Unexpected value type - assert(0); + assert(false); return 0; } }