diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:24:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:44 +0100 |
commit | 35b3228609f3c4f3ae37695597f0d11127467bb8 (patch) | |
tree | 6e04831013f685ca5dc06a44c32d797130e42994 /store/source/storbase.hxx | |
parent | da95f17cb69fe9eb18be44aaac9f71a68445e91c (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I2a4f84e8c36197a9d39a5bd36cb1e2401a956d87
Diffstat (limited to 'store/source/storbase.hxx')
-rw-r--r-- | store/source/storbase.hxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index fadb86bd30b6..1924a69440da 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -124,12 +124,12 @@ public: SharedCount() : m_pCount(Allocator::get().alloc()) { - if (m_pCount != 0) (*m_pCount) = 1; + if (m_pCount != nullptr) (*m_pCount) = 1; } ~SharedCount() { - if (m_pCount != 0) + if (m_pCount != nullptr) { long new_count = --(*m_pCount); if (new_count == 0) @@ -145,7 +145,7 @@ public: SharedCount (SharedCount const & rhs) // nothrow : m_pCount (rhs.m_pCount) { - if (m_pCount != 0) ++(*m_pCount); + if (m_pCount != nullptr) ++(*m_pCount); } SharedCount & operator= (SharedCount const & rhs) // nothrow { @@ -156,7 +156,7 @@ public: bool operator== (long count) const { - return (m_pCount != 0) && (*m_pCount == count); + return (m_pCount != nullptr) && (*m_pCount == count); } }; @@ -440,7 +440,7 @@ struct PageData public: template< class T > T * construct() { - void * page = 0; sal_uInt16 size = 0; + void * page = nullptr; sal_uInt16 size = 0; if (allocate (&page, &size)) { return new(page) T(size); @@ -451,12 +451,12 @@ struct PageData bool allocate (void ** ppPage, sal_uInt16 * pnSize) { allocate_Impl (ppPage, pnSize); - return ((*ppPage != 0) && (*pnSize != 0)); + return ((*ppPage != nullptr) && (*pnSize != 0)); } void deallocate (void * pPage) { - if (pPage != 0) + if (pPage != nullptr) deallocate_Impl (pPage); } @@ -548,17 +548,17 @@ class PageHolder allocator_type m_allocator; public: - explicit PageHolder (PageData * pagedata = 0, allocator_type const & allocator = allocator_type()) + explicit PageHolder (PageData * pagedata = nullptr, allocator_type const & allocator = allocator_type()) : m_refcount (), m_pagedata (pagedata), m_allocator(allocator) { - OSL_ENSURE((m_pagedata == 0) || m_allocator.is(), "store::PageHolder::ctor(): pagedata w/o allocator."); + OSL_ENSURE((m_pagedata == nullptr) || m_allocator.is(), "store::PageHolder::ctor(): pagedata w/o allocator."); } ~PageHolder() { - if ((m_refcount == 1) && (m_pagedata != 0)) + if ((m_refcount == 1) && (m_pagedata != nullptr)) { // free pagedata. OSL_ENSURE(m_allocator.is(), "store::PageHolder::dtor(): pagedata w/o allocator."); @@ -591,23 +591,23 @@ public: PageData * operator->() { - OSL_PRECOND(m_pagedata != 0, "store::PageHolder::operator->(): Null pointer"); + OSL_PRECOND(m_pagedata != nullptr, "store::PageHolder::operator->(): Null pointer"); return m_pagedata; } PageData const * operator->() const { - OSL_PRECOND(m_pagedata != 0, "store::PageHolder::operator->(): Null pointer"); + OSL_PRECOND(m_pagedata != nullptr, "store::PageHolder::operator->(): Null pointer"); return m_pagedata; } PageData & operator*() { - OSL_PRECOND(m_pagedata != 0, "store::PageHolder::operator*(): Null pointer"); + OSL_PRECOND(m_pagedata != nullptr, "store::PageHolder::operator*(): Null pointer"); return *m_pagedata; } PageData const & operator*() const { - OSL_PRECOND(m_pagedata != 0, "store::PageHolder::operator*(): Null pointer"); + OSL_PRECOND(m_pagedata != nullptr, "store::PageHolder::operator*(): Null pointer"); return *m_pagedata; } }; @@ -629,7 +629,7 @@ class PageHolderObject template< class U > static bool isA (PageData const * p) { - return ((p != 0) && (p->type() == U::theTypeId)); + return ((p != nullptr) && (p->type() == U::theTypeId)); } template< class U > |