diff options
author | Kevin Funk <kevin.funk@kdab.com> | 2017-09-18 11:49:52 +0200 |
---|---|---|
committer | Kevin Funk <kevin.funk@kdab.com> | 2017-09-19 11:53:55 +0000 |
commit | 58c14c4a7edcecdd9d58b682a9360c83e2274ec5 (patch) | |
tree | 7f600686e4dd92681bec09ac745a9dcd4425844b /src/corelib/thread | |
parent | 47c92fbb0b588b443cead18a5aad5a2b5ad9e4d7 (diff) |
Replace Q_NULLPTR with nullptr where possible
Remaining uses of Q_NULLPTR are in:
src/corelib/global/qcompilerdetection.h
(definition and documentation of Q_NULLPTR)
tests/manual/qcursor/qcursorhighdpi/main.cpp
(a test executable compilable both under Qt4 and Qt5)
Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qexception.cpp | 4 | ||||
-rw-r--r-- | src/corelib/thread/qexception.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qfutureinterface.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qfuturewatcher.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qmutex.h | 10 | ||||
-rw-r--r-- | src/corelib/thread/qreadwritelock.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qresultstore.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthreadpool.h | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp index 62c2b608d8..e00181e64b 100644 --- a/src/corelib/thread/qexception.cpp +++ b/src/corelib/thread/qexception.cpp @@ -171,7 +171,7 @@ public: }; ExceptionHolder::ExceptionHolder(QException *exception) -: base(exception ? new Base(exception) : Q_NULLPTR) {} +: base(exception ? new Base(exception) : nullptr) {} ExceptionHolder::ExceptionHolder(const ExceptionHolder &other) : base(other.base) @@ -188,7 +188,7 @@ ExceptionHolder::~ExceptionHolder() QException *ExceptionHolder::exception() const { if (!base) - return Q_NULLPTR; + return nullptr; return base->exception; } diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h index 8bbe597f90..5c43cedffd 100644 --- a/src/corelib/thread/qexception.h +++ b/src/corelib/thread/qexception.h @@ -90,7 +90,7 @@ class Base; class Q_CORE_EXPORT ExceptionHolder { public: - ExceptionHolder(QException *exception = Q_NULLPTR); + ExceptionHolder(QException *exception = nullptr); ExceptionHolder(const ExceptionHolder &other); void operator=(const ExceptionHolder &other); // ### Qt6: copy-assign operator shouldn't return void. Remove this method and the copy-ctor, they are unneeded. ~ExceptionHolder(); diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index 7b12f51e3e..320c2d7b33 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -291,7 +291,7 @@ public: void reportResult(const void *, int) { } void reportResults(const QVector<void> &, int) { } - void reportFinished(const void * = Q_NULLPTR) { QFutureInterfaceBase::reportFinished(); } + void reportFinished(const void * = nullptr) { QFutureInterfaceBase::reportFinished(); } }; QT_END_NAMESPACE diff --git a/src/corelib/thread/qfuturewatcher.h b/src/corelib/thread/qfuturewatcher.h index 531babb82a..5143db8d2e 100644 --- a/src/corelib/thread/qfuturewatcher.h +++ b/src/corelib/thread/qfuturewatcher.h @@ -58,7 +58,7 @@ class Q_CORE_EXPORT QFutureWatcherBase : public QObject Q_DECLARE_PRIVATE(QFutureWatcherBase) public: - explicit QFutureWatcherBase(QObject *parent = Q_NULLPTR); + explicit QFutureWatcherBase(QObject *parent = nullptr); // de-inline dtor int progressValue() const; @@ -185,7 +185,7 @@ template <> class QFutureWatcher<void> : public QFutureWatcherBase { public: - explicit QFutureWatcher(QObject *_parent = Q_NULLPTR) + explicit QFutureWatcher(QObject *_parent = nullptr) : QFutureWatcherBase(_parent) { } ~QFutureWatcher() diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 12987f16c3..f40dd3c814 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -92,16 +92,16 @@ public: private: inline bool fastTryLock() Q_DECL_NOTHROW { - return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked()); + return d_ptr.testAndSetAcquire(nullptr, dummyLocked()); } inline bool fastTryUnlock() Q_DECL_NOTHROW { - return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR); + return d_ptr.testAndSetRelease(dummyLocked(), nullptr); } inline bool fastTryLock(QMutexData *¤t) Q_DECL_NOTHROW { - return d_ptr.testAndSetAcquire(Q_NULLPTR, dummyLocked(), current); + return d_ptr.testAndSetAcquire(nullptr, dummyLocked(), current); } inline bool fastTryUnlock(QMutexData *¤t) Q_DECL_NOTHROW { - return d_ptr.testAndSetRelease(dummyLocked(), Q_NULLPTR, current); + return d_ptr.testAndSetRelease(dummyLocked(), nullptr, current); } void lockInternal() QT_MUTEX_LOCK_NOEXCEPT; @@ -287,7 +287,7 @@ public: inline void unlock() Q_DECL_NOTHROW {} void relock() Q_DECL_NOTHROW {} - inline QMutex *mutex() const Q_DECL_NOTHROW { return Q_NULLPTR; } + inline QMutex *mutex() const Q_DECL_NOTHROW { return nullptr; } private: Q_DISABLE_COPY(QMutexLocker) diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h index 777efdb3bf..ecdb98f2f5 100644 --- a/src/corelib/thread/qreadwritelock.h +++ b/src/corelib/thread/qreadwritelock.h @@ -205,7 +205,7 @@ public: static inline void unlock() Q_DECL_NOTHROW { } static inline void relock() Q_DECL_NOTHROW { } - static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; } + static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; } private: Q_DISABLE_COPY(QReadLocker) @@ -219,7 +219,7 @@ public: static inline void unlock() Q_DECL_NOTHROW { } static inline void relock() Q_DECL_NOTHROW { } - static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return Q_NULLPTR; } + static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; } private: Q_DISABLE_COPY(QWriteLocker) diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h index 6c814ef854..5f0cefa133 100644 --- a/src/corelib/thread/qresultstore.h +++ b/src/corelib/thread/qresultstore.h @@ -67,8 +67,8 @@ class ResultItem public: ResultItem(const void *_result, int _count) : m_count(_count), result(_result) { } // contruct with vector of results ResultItem(const void *_result) : m_count(0), result(_result) { } // construct with result - ResultItem() : m_count(0), result(Q_NULLPTR) { } - bool isValid() const { return result != Q_NULLPTR; } + ResultItem() : m_count(0), result(nullptr) { } + bool isValid() const { return result != nullptr; } bool isVector() const { return m_count != 0; } int count() const { return (m_count == 0) ? 1 : m_count; } int m_count; // result is either a pointer to a result or to a vector of results, diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index 21e7cc74f9..b1d02a2b75 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -82,7 +82,7 @@ public: static int idealThreadCount() Q_DECL_NOTHROW; static void yieldCurrentThread(); - explicit QThread(QObject *parent = Q_NULLPTR); + explicit QThread(QObject *parent = nullptr); ~QThread(); enum Priority { @@ -153,7 +153,7 @@ protected: static void setTerminationEnabled(bool enabled = true); protected: - QThread(QThreadPrivate &dd, QObject *parent = Q_NULLPTR); + QThread(QThreadPrivate &dd, QObject *parent = nullptr); private: Q_DECLARE_PRIVATE(QThread) diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h index a65eacc996..606e192768 100644 --- a/src/corelib/thread/qthreadpool.h +++ b/src/corelib/thread/qthreadpool.h @@ -62,7 +62,7 @@ class Q_CORE_EXPORT QThreadPool : public QObject friend class QFutureInterfaceBase; public: - QThreadPool(QObject *parent = Q_NULLPTR); + QThreadPool(QObject *parent = nullptr); ~QThreadPool(); static QThreadPool *globalInstance(); |