diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-06-30 22:11:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-18 06:20:23 +0000 |
commit | cdd2f8eb344bded7918994d5d23151564587abcc (patch) | |
tree | e6667124bb226fb17e42b9bf6659344ca1fe45d7 /src/corelib/tools/qshareddata.h | |
parent | 0aa5092576a0dbcc2de3bef8622d5863e2f1fffb (diff) |
QtCore: Use Q_NULLPTR instead of 0 in smart pointer headers
This is in preparation of adding -Wzero-as-null-pointer-constant (or similar)
to the headers check.
Not caught by the headersclean check, because they are in template code.
Task-number: QTBUG-45291
Change-Id: I7294404225a19a1c58f91e6e47a9d650179ea83c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qshareddata.h')
-rw-r--r-- | src/corelib/tools/qshareddata.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h index a9f71c7b57..6a0900cf3f 100644 --- a/src/corelib/tools/qshareddata.h +++ b/src/corelib/tools/qshareddata.h @@ -79,7 +79,7 @@ public: inline bool operator==(const QSharedDataPointer<T> &other) const { return d == other.d; } inline bool operator!=(const QSharedDataPointer<T> &other) const { return d != other.d; } - inline QSharedDataPointer() { d = 0; } + inline QSharedDataPointer() { d = Q_NULLPTR; } inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; } explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW; @@ -145,17 +145,17 @@ public: if(d && !d->ref.deref()) delete d; - d = 0; + d = Q_NULLPTR; } - inline operator bool () const { return d != 0; } + inline operator bool () const { return d != Q_NULLPTR; } inline bool operator==(const QExplicitlySharedDataPointer<T> &other) const { return d == other.d; } inline bool operator!=(const QExplicitlySharedDataPointer<T> &other) const { return d != other.d; } inline bool operator==(const T *ptr) const { return d == ptr; } inline bool operator!=(const T *ptr) const { return d != ptr; } - inline QExplicitlySharedDataPointer() { d = 0; } + inline QExplicitlySharedDataPointer() { d = Q_NULLPTR; } inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; } explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW; |