]> sigrok.org Git - pulseview.git/commitdiff
Use bool literals for boolean values.
authorUwe Hermann <redacted>
Tue, 21 Mar 2017 23:01:10 +0000 (00:01 +0100)
committerUwe Hermann <redacted>
Thu, 23 Mar 2017 16:59:00 +0000 (17:59 +0100)
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,modernize-use-bool-literals" -fix

pv/data/decoderstack.cpp
pv/prop/int.cpp
pv/session.cpp
pv/strnatcmp.hpp
pv/view/logicsignal.cpp
pv/widgets/sweeptimingwidget.cpp

index 4d9eb000135f86d23a73b5a90dd6104fdc28a7e1..d3e1f4acd25de681fd147253ddc8d423ce5cd2bc 100644 (file)
@@ -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;
        }
 
index 789c26eb0236c9efb89c3c2291cd92e1a5d0e421..d791bd96b05d0846b40d52dc476fdddec135420d 100644 (file)
@@ -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);
index 0fef9c91764bc75366bc8db57cfd6880783465b3..f65b05a1588cad8ea001d31fdcdd3df7e6e94eca 100644 (file)
@@ -810,7 +810,7 @@ void Session::update_signals()
                                        }
 
                                        default:
-                                               assert(0);
+                                               assert(false);
                                                break;
                                        }
                                }
@@ -859,7 +859,7 @@ void Session::sample_thread_proc(function<void (const QString)> 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
index 0295a5c520f56b5a0df1269ae53c18a361468648..1d8f5a244939b7ca8ba8eb35550f1a8b424c43d1 100644 (file)
@@ -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];
 
index f7046ce5f5406e1c75b42e7cf1e82822c9477d08..2f4ac22cf50083a789d662c94fdc3ef0e4da2f45 100644 (file)
@@ -395,7 +395,7 @@ QAction* LogicSignal::action_from_trigger_type(const TriggerMatchType *type)
                        action = trigger_change_;
                        break;
                default:
-                       assert(0);
+                       assert(false);
                }
        }
 
index be2c8b895496eb0d2fa5994e1605533ad45c91d7..6e24d94839429ec961e19c99dbe65d1e9047930b 100644 (file)
@@ -154,7 +154,7 @@ uint64_t SweepTimingWidget::value() const
 
        default:
                // Unexpected value type
-               assert(0);
+               assert(false);
                return 0;
        }
 }