diff options
author | Bastien Bouclet | 2018-06-06 21:13:00 +0200 |
---|---|---|
committer | GitHub | 2018-06-06 21:13:00 +0200 |
commit | f92ab7cacc1b026a28b5ff89e8e712393b1d0fdc (patch) | |
tree | 20f97f7646f649bd02acca9b3495b1a12347e2a8 /common/ptr.h | |
parent | 48db9f04eabfc295ecd1606c2244482d9c15150e (diff) | |
parent | 2fcc4294987195ab4fd6c76e3dbdf4946462c327 (diff) | |
download | scummvm-rg350-f92ab7cacc1b026a28b5ff89e8e712393b1d0fdc.tar.gz scummvm-rg350-f92ab7cacc1b026a28b5ff89e8e712393b1d0fdc.tar.bz2 scummvm-rg350-f92ab7cacc1b026a28b5ff89e8e712393b1d0fdc.zip |
Merge pull request #1211 from dafioram/morePtrNull
COMMON: More nullptr usage in common/ptr
Diffstat (limited to 'common/ptr.h')
-rw-r--r-- | common/ptr.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/ptr.h b/common/ptr.h index 49a38e48bd..565c9d8cee 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -177,9 +177,9 @@ public: */ void reset() { decRef(); - _deletion = 0; - _refCount = 0; - _pointer = 0; + _deletion = nullptr; + _refCount = nullptr; + _pointer = nullptr; } template<class T2> @@ -233,7 +233,7 @@ public: typedef T *PointerType; typedef T &ReferenceType; - explicit ScopedPtr(PointerType o = 0) : _pointer(o) {} + explicit ScopedPtr(PointerType o = nullptr) : _pointer(o) {} ReferenceType operator*() const { return *_pointer; } PointerType operator->() const { return _pointer; } @@ -251,7 +251,7 @@ public: /** * Resets the pointer with the new value. Old object will be destroyed */ - void reset(PointerType o = 0) { + void reset(PointerType o = nullptr) { D()(_pointer); _pointer = o; } @@ -271,7 +271,7 @@ public: */ PointerType release() { PointerType r = _pointer; - _pointer = 0; + _pointer = nullptr; return r; } |