From f74015db20c1ac85df6397df7199a030e6db828f Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Mon, 8 Feb 2016 21:17:34 +0100 Subject: [PATCH] Use nullptr in some more places. This patch was generated using clang-tidy: clang-tidy -checks="-*,modernize-use-nullptr" -fix --- main.cpp | 12 ++++++------ pv/view/signal.cpp | 2 +- pv/widgets/wellarray.cpp | 2 +- signalhandler.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main.cpp b/main.cpp index 3e004796..78a131a5 100644 --- 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, diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 67f8dde9..5cd5b183 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -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]); diff --git a/pv/widgets/wellarray.cpp b/pv/widgets/wellarray.cpp index 1f3bf698..ad29b039 100644 --- a/pv/widgets/wellarray.cpp +++ b/pv/widgets/wellarray.cpp @@ -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; diff --git a/signalhandler.cpp b/signalhandler.cpp index fbbcf225..4736292c 100644 --- a/signalhandler.cpp +++ b/signalhandler.cpp @@ -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); -- 2.30.2