mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
replace 0 with Q_NULLPTR in QSharedDataPointer and QExplicitlySharedDataPointer
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
5df7658d86
commit
8fb3224ff8
1 changed files with 6 additions and 6 deletions
|
@ -73,7 +73,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 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; }
|
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
||||||
|
|
||||||
explicit QSharedDataPointer(T *data);
|
explicit QSharedDataPointer(T *data);
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = 0; }
|
QSharedDataPointer(QSharedDataPointer &&o) : d(o.d) { o.d = Q_NULLPTR; }
|
||||||
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
|
inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other)
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
@ -139,17 +139,17 @@ public:
|
||||||
if(d && !d->ref.deref())
|
if(d && !d->ref.deref())
|
||||||
delete d;
|
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 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 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; }
|
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
|
||||||
|
|
||||||
explicit QExplicitlySharedDataPointer(T *data);
|
explicit QExplicitlySharedDataPointer(T *data);
|
||||||
|
@ -185,7 +185,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#ifdef Q_COMPILER_RVALUE_REFS
|
#ifdef Q_COMPILER_RVALUE_REFS
|
||||||
inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = 0; }
|
inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) : d(o.d) { o.d = Q_NULLPTR; }
|
||||||
inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other)
|
inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other)
|
||||||
{ qSwap(d, other.d); return *this; }
|
{ qSwap(d, other.d); return *this; }
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue