]> sigrok.org Git - pulseview.git/commitdiff
Use nullptr in some more places.
authorUwe Hermann <redacted>
Mon, 8 Feb 2016 20:17:34 +0000 (21:17 +0100)
committerUwe Hermann <redacted>
Sat, 13 Feb 2016 19:41:33 +0000 (20:41 +0100)
This patch was generated using clang-tidy:

  clang-tidy -checks="-*,modernize-use-nullptr" -fix

main.cpp
pv/view/signal.cpp
pv/widgets/wellarray.cpp
signalhandler.cpp

index 3e00479664aeb5f4b6a151a9d853fd6ac54da605..78a131a5f1e108c9548cc34f1f19ea5bea6e6abb 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -84,12 +84,12 @@ int main(int argc, char *argv[])
        // Parse arguments
        while (1) {
                static const struct option long_options[] = {
-                       {"help", no_argument, 0, 'h'},
-                       {"version", no_argument, 0, 'V'},
-                       {"loglevel", required_argument, 0, 'l'},
-                       {"input-file", required_argument, 0, 'i'},
-                       {"input-format", required_argument, 0, 'I'},
-                       {0, 0, 0, 0}
+                       {"help", no_argument, nullptr, 'h'},
+                       {"version", no_argument, nullptr, 'V'},
+                       {"loglevel", required_argument, nullptr, 'l'},
+                       {"input-file", required_argument, nullptr, 'i'},
+                       {"input-format", required_argument, nullptr, 'I'},
+                       {nullptr, 0, nullptr, 0}
                };
 
                const int c = getopt_long(argc, argv,
index 67f8dde9c1316c27f17c8830cf234f2285d755d6..5cd5b183590af45dcd783dd948f3a0d81af84582 100644 (file)
@@ -116,7 +116,7 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
 {
        name_widget_ = new QComboBox(parent);
        name_widget_->setEditable(true);
-       name_widget_->setCompleter(0);
+       name_widget_->setCompleter(nullptr);
 
        for (unsigned int i = 0; i < countof(ChannelNames); i++)
                name_widget_->insertItem(i, ChannelNames[i]);
index 1f3bf69825ac7434a0a7e4a7b612342b6b9e4dce..ad29b039657d8123de5f49c3ba4b2ec76d9559dc 100644 (file)
@@ -104,7 +104,7 @@ WellArray::WellArray(int rows, int cols, QWidget *parent)
     : QWidget(parent)
         ,nrows(rows), ncols(cols)
 {
-    d = 0;
+    d = nullptr;
     setFocusPolicy(Qt::StrongFocus);
     cellw = 28;
     cellh = 24;
index fbbcf225d8995cec5dca768f026d7d0a3434caf4..4736292cb63ddee8c06791ea3584b01497e81bc8 100644 (file)
@@ -42,8 +42,8 @@ bool SignalHandler::prepare_signals()
        sigemptyset(&sig_action.sa_mask);
        sig_action.sa_flags = SA_RESTART;
 
-       if (sigaction(SIGINT, &sig_action, 0) != 0 ||
-               sigaction(SIGTERM, &sig_action, 0) != 0) {
+       if (sigaction(SIGINT, &sig_action, nullptr) != 0 ||
+               sigaction(SIGTERM, &sig_action, nullptr) != 0) {
                close(sockets_[0]);
                close(sockets_[1]);
                return false;
@@ -53,7 +53,7 @@ bool SignalHandler::prepare_signals()
 }
 
 SignalHandler::SignalHandler(QObject* parent) : QObject(parent),
-       socket_notifier_(0)
+       socket_notifier_(nullptr)
 {
        socket_notifier_ = new QSocketNotifier(sockets_[1],
                QSocketNotifier::Read, this);