summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-12-10 17:33:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-12-10 17:34:31 +0100
commit4a1edf626ad48b5955892e5590d75fa7ae5eaf58 (patch)
tree3ace4c2ac4da5529295780880f67fdfce09b6637 /include/tools
parent46fe3bddebf30775ae19eaa0fefe1d8e2f78eced (diff)
More loplugin:nullptr automatic rewrite (within templates)
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/ref.hxx20
-rw-r--r--include/tools/weakbase.hxx4
2 files changed, 12 insertions, 12 deletions
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index 9cd1bf550f3e..2ca5def8d543 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -36,24 +36,24 @@ public:
SvRef(SvRef const & rObj): pObj(rObj.pObj)
{
- if (pObj != 0) pObj->AddNextRef();
+ if (pObj != nullptr) pObj->AddNextRef();
}
SvRef(T * pObjP): pObj(pObjP)
{
- if (pObj != 0) pObj->AddFirstRef();
+ if (pObj != nullptr) pObj->AddFirstRef();
}
~SvRef()
{
- if (pObj != 0) pObj->ReleaseRef();
+ if (pObj != nullptr) pObj->ReleaseRef();
}
void Clear()
{
- if (pObj != 0) {
+ if (pObj != nullptr) {
T * pRefObj = pObj;
- pObj = 0;
+ pObj = nullptr;
pRefObj->ReleaseRef();
}
}
@@ -65,21 +65,21 @@ public:
}
T * pRefObj = pObj;
pObj = rObj.pObj;
- if (pRefObj != 0) {
+ if (pRefObj != nullptr) {
pRefObj->ReleaseRef();
}
return *this;
}
- bool Is() const { return pObj != 0; }
+ bool Is() const { return pObj != nullptr; }
T * get() const { return pObj; }
T * operator &() const { return pObj; }
- T * operator ->() const { assert(pObj != 0); return pObj; }
+ T * operator ->() const { assert(pObj != nullptr); return pObj; }
- T & operator *() const { assert(pObj != 0); return *pObj; }
+ T & operator *() const { assert(pObj != nullptr); return *pObj; }
operator T *() const { return pObj; }
@@ -157,7 +157,7 @@ class SvCompatWeakHdl : public SvRefBase
SvCompatWeakHdl( T* pObj ) : _pObj( pObj ) {}
public:
- void ResetWeakBase( ) { _pObj = 0; }
+ void ResetWeakBase( ) { _pObj = nullptr; }
T* GetObj() { return _pObj; }
};
diff --git a/include/tools/weakbase.hxx b/include/tools/weakbase.hxx
index 652ea45d50d6..4087160409a3 100644
--- a/include/tools/weakbase.hxx
+++ b/include/tools/weakbase.hxx
@@ -137,7 +137,7 @@ inline WeakReference<reference_type>& WeakReference<reference_type>::operator= (
template< class reference_type >
inline WeakBase< reference_type >::WeakBase()
{
- mpWeakConnection = 0;
+ mpWeakConnection = nullptr;
}
template< class reference_type >
@@ -147,7 +147,7 @@ inline WeakBase< reference_type >::~WeakBase()
{
mpWeakConnection->mpReference = 0;
mpWeakConnection->release();
- mpWeakConnection = 0;
+ mpWeakConnection = nullptr;
}
}