From 58c14c4a7edcecdd9d58b682a9360c83e2274ec5 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 18 Sep 2017 11:49:52 +0200 Subject: 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 Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qscopedpointer.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib/tools/qscopedpointer.h') diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index eeed3afd83..2a4083466b 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -97,7 +97,7 @@ class QScopedPointer { typedef T *QScopedPointer:: *RestrictedBool; public: - explicit QScopedPointer(T *p = Q_NULLPTR) Q_DECL_NOTHROW : d(p) + explicit QScopedPointer(T *p = nullptr) Q_DECL_NOTHROW : d(p) { } @@ -126,12 +126,12 @@ public: #if defined(Q_QDOC) inline operator bool() const { - return isNull() ? Q_NULLPTR : &QScopedPointer::d; + return isNull() ? nullptr : &QScopedPointer::d; } #else operator RestrictedBool() const Q_DECL_NOTHROW { - return isNull() ? Q_NULLPTR : &QScopedPointer::d; + return isNull() ? nullptr : &QScopedPointer::d; } #endif @@ -150,7 +150,7 @@ public: return !d; } - void reset(T *other = Q_NULLPTR) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval()))) + void reset(T *other = nullptr) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval()))) { if (d == other) return; @@ -162,7 +162,7 @@ public: T *take() Q_DECL_NOTHROW { T *oldD = d; - d = Q_NULLPTR; + d = nullptr; return oldD; } @@ -226,7 +226,7 @@ class QScopedArrayPointer : public QScopedPointer template using if_same_type = typename std::enable_if::type, Ptr>::value, bool>::type; public: - inline QScopedArrayPointer() : QScopedPointer(Q_NULLPTR) {} + inline QScopedArrayPointer() : QScopedPointer(nullptr) {} template = true> explicit QScopedArrayPointer(D *p) -- cgit v1.2.1