diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 13:05:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-07 23:02:47 +0200 |
commit | 564b59d903683b14c75b72a3e93367717f201def (patch) | |
tree | 03ffe749d83dce84429a7db484bf92795047036f /tests/auto/corelib/thread | |
parent | b5fc1e4e2643e73d3b44c483d159529f8deb8af1 (diff) |
Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.
Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/corelib/thread')
6 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp index ef00be31c5..260dbc30e8 100644 --- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp +++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp @@ -85,7 +85,7 @@ private: }; template <int I> -static inline void assemblyMarker(void *ptr = 0) +static inline void assemblyMarker(void *ptr = nullptr) { puts((char *)ptr + I); } diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp index bcc34a7d96..4361609442 100644 --- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp +++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp @@ -77,8 +77,8 @@ void tst_QAtomicPointer::warningFreeHelper() p.loadRelaxed()->bar(); - WFHC *expectedValue = 0; - WFHC *newValue = 0; + WFHC *expectedValue = nullptr; + WFHC *newValue = nullptr; qptrdiff valueToAdd = 0; p.testAndSetRelaxed(expectedValue, newValue); @@ -585,7 +585,7 @@ void tst_QAtomicPointer::fetchAndAdd() template <typename T> void constAndVolatile_helper() { - T *one = 0; + T *one = nullptr; T *two = &one; T *three = &two; diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp index f984aec0e8..76e50eee1b 100644 --- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp +++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp @@ -864,7 +864,7 @@ private: void tst_QReadWriteLock::deleteOnUnlock() { - QReadWriteLock *lock = 0; + QReadWriteLock *lock = nullptr; QWaitCondition startup; QMutex waitMutex; diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp index cf27c23591..f556e402e3 100644 --- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp +++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp @@ -49,7 +49,7 @@ private slots: void raii(); }; -static QSemaphore *semaphore = 0; +static QSemaphore *semaphore = nullptr; class ThreadOne : public QThread { diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index 235fb093b5..1e8380fbba 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -429,7 +429,7 @@ void tst_QThread::exit() delete thread.object; Exit_Thread thread2; - thread2.object = 0; + thread2.object = nullptr; thread2.code = 53; thread2.result = 0; QMutexLocker locker2(&thread2.mutex); @@ -505,7 +505,7 @@ void tst_QThread::quit() delete thread.object; Quit_Thread thread2; - thread2.object = 0; + thread2.object = nullptr; thread2.result = -1; QMutexLocker locker2(&thread2.mutex); thread2.start(); @@ -647,8 +647,8 @@ class NativeThreadWrapper { public: NativeThreadWrapper() : qthread(0), waitForStop(false) {} - void start(FunctionPointer functionPointer = noop, void *data = 0); - void startAndWait(FunctionPointer functionPointer = noop, void *data = 0); + void start(FunctionPointer functionPointer = noop, void *data = nullptr); + void startAndWait(FunctionPointer functionPointer = noop, void *data = nullptr); void join(); void setWaitForStop() { waitForStop = true; } void stop(); @@ -1289,7 +1289,7 @@ class Job : public QObject { Q_OBJECT public: - Job(QThread *thread, int deleteDelay, bool *flag, QObject *parent = 0) + Job(QThread *thread, int deleteDelay, bool *flag, QObject *parent = nullptr) : QObject(parent), quitLocker(thread), exitThreadCalled(*flag) { exitThreadCalled = false; diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 3054e3c5a4..e6db963c7b 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -107,7 +107,7 @@ private: }; -QMutex *tst_QThreadPool::functionTestMutex = 0; +QMutex *tst_QThreadPool::functionTestMutex = nullptr; tst_QThreadPool::tst_QThreadPool() { @@ -116,7 +116,7 @@ tst_QThreadPool::tst_QThreadPool() tst_QThreadPool::~tst_QThreadPool() { - tst_QThreadPool::functionTestMutex = 0; + tst_QThreadPool::functionTestMutex = nullptr; } int testFunctionCount; @@ -282,7 +282,7 @@ void tst_QThreadPool::destruction() } QSemaphore threadRecyclingSemaphore; -QThread *recycledThread = 0; +QThread *recycledThread = nullptr; class ThreadRecorderTask : public QRunnable { |