From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: Tidy nullptr usage Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/corelib/kernel/qeventdispatcher_glib.cpp | 40 ++++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/corelib/kernel/qeventdispatcher_glib.cpp') diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp index d9746ef6e2..92f3553247 100644 --- a/src/corelib/kernel/qeventdispatcher_glib.cpp +++ b/src/corelib/kernel/qeventdispatcher_glib.cpp @@ -114,9 +114,9 @@ static GSourceFuncs socketNotifierSourceFuncs = { socketNotifierSourcePrepare, socketNotifierSourceCheck, socketNotifierSourceDispatch, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr }; struct GTimerSource @@ -188,9 +188,9 @@ static GSourceFuncs timerSourceFuncs = { timerSourcePrepare, timerSourceCheck, timerSourceDispatch, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr }; struct GIdleTimerSource @@ -227,7 +227,7 @@ static gboolean idleTimerSourceCheck(GSource *source) static gboolean idleTimerSourceDispatch(GSource *source, GSourceFunc, gpointer) { GTimerSource *timerSource = reinterpret_cast(source)->timerSource; - (void) timerSourceDispatch(&timerSource->source, 0, 0); + (void) timerSourceDispatch(&timerSource->source, nullptr, nullptr); return true; } @@ -235,9 +235,9 @@ static GSourceFuncs idleTimerSourceFuncs = { idleTimerSourcePrepare, idleTimerSourceCheck, idleTimerSourceDispatch, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr }; struct GPostEventSource @@ -267,7 +267,7 @@ static gboolean postEventSourcePrepare(GSource *s, gint *timeout) static gboolean postEventSourceCheck(GSource *source) { - return postEventSourcePrepare(source, 0); + return postEventSourcePrepare(source, nullptr); } static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer) @@ -283,9 +283,9 @@ static GSourceFuncs postEventSourceFuncs = { postEventSourcePrepare, postEventSourceCheck, postEventSourceDispatch, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr }; @@ -372,10 +372,10 @@ QEventDispatcherGlib::~QEventDispatcherGlib() d->timerSource->timerList.~QTimerInfoList(); g_source_destroy(&d->timerSource->source); g_source_unref(&d->timerSource->source); - d->timerSource = 0; + d->timerSource = nullptr; g_source_destroy(&d->idleTimerSource->source); g_source_unref(&d->idleTimerSource->source); - d->idleTimerSource = 0; + d->idleTimerSource = nullptr; // destroy socket notifier source for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) { @@ -386,19 +386,19 @@ QEventDispatcherGlib::~QEventDispatcherGlib() d->socketNotifierSource->pollfds.~QList(); g_source_destroy(&d->socketNotifierSource->source); g_source_unref(&d->socketNotifierSource->source); - d->socketNotifierSource = 0; + d->socketNotifierSource = nullptr; // destroy post event source g_source_destroy(&d->postEventSource->source); g_source_unref(&d->postEventSource->source); - d->postEventSource = 0; + d->postEventSource = nullptr; - Q_ASSERT(d->mainContext != 0); + Q_ASSERT(d->mainContext != nullptr); #if GLIB_CHECK_VERSION (2, 22, 0) g_main_context_pop_thread_default (d->mainContext); #endif g_main_context_unref(d->mainContext); - d->mainContext = 0; + d->mainContext = nullptr; } bool QEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags) -- cgit v1.2.3