summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:24:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:44 +0100
commit35b3228609f3c4f3ae37695597f0d11127467bb8 (patch)
tree6e04831013f685ca5dc06a44c32d797130e42994 /store
parentda95f17cb69fe9eb18be44aaac9f71a68445e91c (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I2a4f84e8c36197a9d39a5bd36cb1e2401a956d87
Diffstat (limited to 'store')
-rw-r--r--store/source/lockbyte.cxx30
-rw-r--r--store/source/storbase.cxx24
-rw-r--r--store/source/storbase.hxx30
-rw-r--r--store/source/storbios.cxx24
-rw-r--r--store/source/storcach.cxx50
-rw-r--r--store/source/stordata.hxx4
-rw-r--r--store/source/stordir.cxx6
-rw-r--r--store/source/stordir.hxx2
-rw-r--r--store/source/store.cxx8
-rw-r--r--store/source/storlckb.hxx2
-rw-r--r--store/source/storpage.hxx2
-rw-r--r--store/source/stortree.cxx2
12 files changed, 92 insertions, 92 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index 2f6aefcba872..9e5a5fce9c77 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -60,8 +60,8 @@ storeError ILockBytes::writePageAt (PageHolder const & rPage, sal_uInt32 nOffset
{
// [SECURITY:ValInput]
PageData const * pagedata = rPage.get();
- OSL_PRECOND(!(pagedata == 0), "store::ILockBytes::writePageAt(): invalid Page");
- if (pagedata == 0)
+ OSL_PRECOND(!(pagedata == nullptr), "store::ILockBytes::writePageAt(): invalid Page");
+ if (pagedata == nullptr)
return store_E_InvalidParameter;
sal_uInt32 const offset = pagedata->location();
@@ -80,7 +80,7 @@ storeError ILockBytes::readAt (sal_uInt32 nOffset, void * pBuffer, sal_uInt32 nB
{
// [SECURITY:ValInput]
sal_uInt8 * dst_lo = static_cast<sal_uInt8*>(pBuffer);
- if (!(dst_lo != 0))
+ if (!(dst_lo != nullptr))
return store_E_InvalidParameter;
sal_uInt8 * dst_hi = dst_lo + nBytes;
@@ -102,7 +102,7 @@ storeError ILockBytes::writeAt (sal_uInt32 nOffset, void const * pBuffer, sal_uI
{
// [SECURITY:ValInput]
sal_uInt8 const * src_lo = static_cast<sal_uInt8 const*>(pBuffer);
- if (!(src_lo != 0))
+ if (!(src_lo != nullptr))
return store_E_InvalidParameter;
sal_uInt8 const * src_hi = src_lo + nBytes;
@@ -148,7 +148,7 @@ struct FileHandle
{
oslFileHandle m_handle;
- FileHandle() : m_handle(0) {}
+ FileHandle() : m_handle(nullptr) {}
bool operator != (FileHandle const & rhs)
{
@@ -270,7 +270,7 @@ struct FileHandle
{
// Release handle.
closeFile (rFile.m_handle);
- rFile.m_handle = 0;
+ rFile.m_handle = nullptr;
}
};
typedef CloseFile destructor_type;
@@ -379,7 +379,7 @@ storeError FileLockBytes::readPageAt_Impl (PageHolder & rPage, sal_uInt32 nOffse
storeError FileLockBytes::writePageAt_Impl (PageHolder const & rPage, sal_uInt32 nOffset)
{
PageData const * pagedata = rPage.get();
- OSL_PRECOND(pagedata != 0, "contract violation");
+ OSL_PRECOND(pagedata != nullptr, "contract violation");
return writeAt_Impl (nOffset, pagedata, pagedata->size());
}
@@ -448,7 +448,7 @@ struct FileMapping
sal_uInt32 m_nSize;
oslFileHandle m_hFile;
- FileMapping() : m_pAddr(0), m_nSize(0), m_hFile(0) {}
+ FileMapping() : m_pAddr(nullptr), m_nSize(0), m_hFile(nullptr) {}
bool operator != (FileMapping const & rhs) const
{
@@ -490,7 +490,7 @@ struct FileMapping
{
// Release mapping.
unmapFile (rMapping.m_hFile, rMapping.m_pAddr, rMapping.m_nSize);
- rMapping.m_pAddr = 0, rMapping.m_nSize = 0;
+ rMapping.m_pAddr = nullptr, rMapping.m_nSize = 0;
}
};
typedef UnmapFile destructor_type;
@@ -554,9 +554,9 @@ MappedLockBytes::~MappedLockBytes()
void MappedLockBytes::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
- OSL_PRECOND((ppPage != 0) && (pnSize != 0), "contract violation");
- if ((ppPage != 0) && (pnSize != 0))
- *ppPage = 0, *pnSize = m_nPageSize;
+ OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation");
+ if ((ppPage != nullptr) && (pnSize != nullptr))
+ *ppPage = nullptr, *pnSize = m_nPageSize;
}
void MappedLockBytes::deallocate_Impl (void * pPage)
@@ -676,7 +676,7 @@ protected:
} // namespace store
MemoryLockBytes::MemoryLockBytes()
- : m_pData (0), m_nSize (0), m_xAllocator()
+ : m_pData (nullptr), m_nSize (0), m_xAllocator()
{}
MemoryLockBytes::~MemoryLockBytes()
@@ -715,7 +715,7 @@ storeError MemoryLockBytes::readPageAt_Impl (PageHolder & rPage, sal_uInt32 nOff
storeError MemoryLockBytes::writePageAt_Impl (PageHolder const & rPage, sal_uInt32 nOffset)
{
PageData const * pagedata = rPage.get();
- OSL_PRECOND(!(pagedata == 0), "contract violation");
+ OSL_PRECOND(!(pagedata == nullptr), "contract violation");
return writeAt_Impl (nOffset, pagedata, pagedata->size());
}
@@ -768,7 +768,7 @@ storeError MemoryLockBytes::setSize_Impl (sal_uInt32 nSize)
if (nSize != m_nSize)
{
sal_uInt8 * pData = static_cast<sal_uInt8*>(rtl_reallocateMemory (m_pData, nSize));
- if (pData != 0)
+ if (pData != nullptr)
{
if (nSize > m_nSize)
memset (pData + m_nSize, 0, sal::static_int_cast<size_t>(nSize - m_nSize));
diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx
index 9281b38f0c10..51f1ddfbc8ae 100644
--- a/store/source/storbase.cxx
+++ b/store/source/storbase.cxx
@@ -50,18 +50,18 @@ SharedCount::Allocator::Allocator()
"store_shared_count_cache",
sizeof(long),
0, // objalign
- 0, // constructor
- 0, // destructor
- 0, // reclaim
- 0, // userarg
- 0, // default source
+ nullptr, // constructor
+ nullptr, // destructor
+ nullptr, // reclaim
+ nullptr, // userarg
+ nullptr, // default source
0 // flags
);
}
SharedCount::Allocator::~Allocator()
{
- rtl_cache_destroy (m_cache), m_cache = 0;
+ rtl_cache_destroy (m_cache), m_cache = nullptr;
}
/*========================================================================
@@ -104,7 +104,7 @@ private:
} // namespace store
PageData::Allocator_Impl::Allocator_Impl()
- : m_page_cache(0), m_page_size(0)
+ : m_page_cache(nullptr), m_page_size(0)
{}
storeError
@@ -114,7 +114,7 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize)
sal_Size size = sal::static_int_cast< sal_Size >(nPageSize);
(void) snprintf (name, sizeof(name), "store_page_alloc_%" SAL_PRIuUINTPTR, size);
- m_page_cache = rtl_cache_create (name, size, 0, 0, 0, 0, 0, 0, 0);
+ m_page_cache = rtl_cache_create (name, size, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0);
if (!m_page_cache)
return store_E_OutOfMemory;
@@ -124,19 +124,19 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize)
PageData::Allocator_Impl::~Allocator_Impl()
{
- rtl_cache_destroy(m_page_cache), m_page_cache = 0;
+ rtl_cache_destroy(m_page_cache), m_page_cache = nullptr;
}
void PageData::Allocator_Impl::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
- OSL_PRECOND((ppPage != 0) && (pnSize != 0), "contract violation");
- if ((ppPage != 0) && (pnSize != 0))
+ OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation");
+ if ((ppPage != nullptr) && (pnSize != nullptr))
*ppPage = rtl_cache_alloc(m_page_cache), *pnSize = m_page_size;
}
void PageData::Allocator_Impl::deallocate_Impl (void * pPage)
{
- OSL_PRECOND(pPage != 0, "contract violation");
+ OSL_PRECOND(pPage != nullptr, "contract violation");
rtl_cache_free(m_page_cache, pPage);
}
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 >
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 039aeb89e585..7052b3f06d05 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -475,24 +475,24 @@ OStorePageBIOS::AceCache::AceCache()
sizeof (OStorePageBIOS::Ace),
0, // objalign
reinterpret_cast<ace_constructor_type>( OStorePageBIOS::Ace::constructor),
- 0, // destructor,
- 0, // reclaim,
- 0, // userarg,
- 0, // default source,
+ nullptr, // destructor,
+ nullptr, // reclaim,
+ nullptr, // userarg,
+ nullptr, // default source,
0 // flags
);
}
OStorePageBIOS::AceCache::~AceCache()
{
- rtl_cache_destroy (m_ace_cache), m_ace_cache = 0;
+ rtl_cache_destroy (m_ace_cache), m_ace_cache = nullptr;
}
OStorePageBIOS::Ace *
OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
{
Ace * ace = static_cast<Ace*>(rtl_cache_alloc (m_ace_cache));
- if (ace != 0)
+ if (ace != nullptr)
{
// verify invariant state.
OSL_ASSERT((ace->m_next == ace) && (ace->m_prev == ace));
@@ -507,7 +507,7 @@ OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
void
OStorePageBIOS::AceCache::destroy (OStorePageBIOS::Ace * ace)
{
- if (ace != 0)
+ if (ace != nullptr)
{
// remove from queue (if any).
ace->m_next->m_prev = ace->m_prev, ace->m_prev->m_next = ace->m_next;
@@ -529,8 +529,8 @@ OStorePageBIOS::AceCache::destroy (OStorePageBIOS::Ace * ace)
* OStorePageBIOS.
*/
OStorePageBIOS::OStorePageBIOS()
- : m_xLockBytes (NULL),
- m_pSuper (NULL),
+ : m_xLockBytes (nullptr),
+ m_pSuper (nullptr),
m_bWriteable (false)
{
}
@@ -588,7 +588,7 @@ storeError OStorePageBIOS::initialize_Impl (
if (eAccessMode != store_AccessCreate)
{
// Load SuperBlock page.
- if ((m_pSuper = new SuperBlockPage()) == 0)
+ if ((m_pSuper = new SuperBlockPage()) == nullptr)
return store_E_OutOfMemory;
eErrCode = read (0, m_pSuper, SuperBlockPage::theSize);
@@ -627,7 +627,7 @@ storeError OStorePageBIOS::initialize_Impl (
rnPageSize = ((rnPageSize + STORE_MINIMUM_PAGESIZE - 1) & ~(STORE_MINIMUM_PAGESIZE - 1));
// Create initial page (w/ SuperBlock).
- if ((m_pSuper = new(rnPageSize) SuperBlockPage(rnPageSize)) == 0)
+ if ((m_pSuper = new(rnPageSize) SuperBlockPage(rnPageSize)) == nullptr)
return store_E_OutOfMemory;
eErrCode = m_pSuper->save (*this, rnPageSize);
}
@@ -667,7 +667,7 @@ void OStorePageBIOS::cleanup_Impl()
}
// Release SuperBlock page.
- delete m_pSuper, m_pSuper = 0;
+ delete m_pSuper, m_pSuper = nullptr;
// Release PageCache.
m_xCache.clear();
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index db81ae5f6b2a..d0b6c054cc2c 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -53,7 +53,7 @@ struct Entry
// Construction
explicit Entry (PageHolder const & rxPage = PageHolder(), sal_uInt32 nOffset = STORE_PAGE_NULL)
- : m_xPage(rxPage), m_nOffset(nOffset), m_pNext(0)
+ : m_xPage(rxPage), m_nOffset(nOffset), m_pNext(nullptr)
{}
// Destruction
@@ -96,34 +96,34 @@ EntryCache::EntryCache()
"store_cache_entry_cache",
sizeof(Entry),
0, // objalign
- 0, // constructor
- 0, // destructor
- 0, // reclaim
- 0, // userarg
- 0, // default source
+ nullptr, // constructor
+ nullptr, // destructor
+ nullptr, // reclaim
+ nullptr, // userarg
+ nullptr, // default source
0 // flags
);
}
EntryCache::~EntryCache()
{
- rtl_cache_destroy (m_entry_cache), m_entry_cache = 0;
+ rtl_cache_destroy (m_entry_cache), m_entry_cache = nullptr;
}
Entry * EntryCache::create (PageHolder const & rxPage, sal_uInt32 nOffset)
{
void * pAddr = rtl_cache_alloc (m_entry_cache);
- if (pAddr != 0)
+ if (pAddr != nullptr)
{
// construct
return new(pAddr) Entry (rxPage, nOffset);
}
- return 0;
+ return nullptr;
}
void EntryCache::destroy (Entry * entry)
{
- if (entry != 0)
+ if (entry != nullptr)
{
// destruct
entry->~Entry();
@@ -181,9 +181,9 @@ PageCache::~PageCache()
{
int x = 0;
Entry * entry = m_hash_table[i];
- while (entry != 0)
+ while (entry != nullptr)
{
- m_hash_table[i] = entry->m_pNext, entry->m_pNext = 0;
+ m_hash_table[i] = entry->m_pNext, entry->m_pNext = nullptr;
EntryCache::get().destroy (entry);
entry = m_hash_table[i];
x += 1;
@@ -209,7 +209,7 @@ void PageCache::rescale_Impl (sal_Size new_size)
sal_Size new_bytes = new_size * sizeof(Entry*);
Entry ** new_table = static_cast<Entry**>(rtl_allocateMemory(new_bytes));
- if (new_table != 0)
+ if (new_table != nullptr)
{
Entry ** old_table = m_hash_table;
sal_Size old_size = m_hash_size;
@@ -230,14 +230,14 @@ void PageCache::rescale_Impl (sal_Size new_size)
for (i = 0; i < old_size; i++)
{
Entry * curr = old_table[i];
- while (curr != 0)
+ while (curr != nullptr)
{
Entry * next = curr->m_pNext;
int index = hash_index_Impl(curr->m_nOffset);
curr->m_pNext = m_hash_table[index], m_hash_table[index] = curr;
curr = next;
}
- old_table[i] = 0;
+ old_table[i] = nullptr;
}
if (old_table != m_hash_table_0)
{
@@ -250,7 +250,7 @@ void PageCache::rescale_Impl (sal_Size new_size)
Entry * PageCache::lookup_Impl (Entry * entry, sal_uInt32 nOffset)
{
int lookups = 0;
- while (entry != 0)
+ while (entry != nullptr)
{
if (entry->m_nOffset == nOffset)
break;
@@ -277,7 +277,7 @@ storeError PageCache::lookupPageAt (PageHolder & rxPage, sal_uInt32 nOffset)
int index = hash_index_Impl(nOffset);
Entry const * entry = lookup_Impl (m_hash_table[index], nOffset);
- if (entry != 0)
+ if (entry != nullptr)
{
// Existing entry.
rxPage = entry->m_xPage;
@@ -296,8 +296,8 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse
{
// [SECURITY:ValInput]
PageData const * pagedata = rxPage.get();
- OSL_PRECOND(!(pagedata == 0), "store::PageCache::insertPageAt(): invalid Page");
- if (pagedata == 0)
+ OSL_PRECOND(!(pagedata == nullptr), "store::PageCache::insertPageAt(): invalid Page");
+ if (pagedata == nullptr)
return store_E_InvalidParameter;
sal_uInt32 const offset = pagedata->location();
@@ -310,7 +310,7 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse
return store_E_CantSeek;
Entry * entry = EntryCache::get().create (rxPage, nOffset);
- if (entry != 0)
+ if (entry != nullptr)
{
// Insert new entry.
int index = hash_index_Impl(nOffset);
@@ -327,8 +327,8 @@ storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffse
{
// [SECURITY:ValInput]
PageData const * pagedata = rxPage.get();
- OSL_PRECOND(!(pagedata == 0), "store::PageCache::updatePageAt(): invalid Page");
- if (pagedata == 0)
+ OSL_PRECOND(!(pagedata == nullptr), "store::PageCache::updatePageAt(): invalid Page");
+ if (pagedata == nullptr)
return store_E_InvalidParameter;
sal_uInt32 const offset = pagedata->location();
@@ -342,7 +342,7 @@ storeError PageCache::updatePageAt (PageHolder const & rxPage, sal_uInt32 nOffse
int index = hash_index_Impl(nOffset);
Entry * entry = lookup_Impl (m_hash_table[index], nOffset);
- if (entry != 0)
+ if (entry != nullptr)
{
// Update existing entry.
entry->m_xPage = rxPage;
@@ -360,7 +360,7 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
return store_E_CantSeek;
Entry ** ppEntry = &(m_hash_table[hash_index_Impl(nOffset)]);
- while (*ppEntry != 0)
+ while (*ppEntry != nullptr)
{
if ((*ppEntry)->m_nOffset == nOffset)
{
@@ -368,7 +368,7 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
Entry * entry = (*ppEntry);
// Dequeue and destroy entry.
- (*ppEntry) = entry->m_pNext, entry->m_pNext = 0;
+ (*ppEntry) = entry->m_pNext, entry->m_pNext = nullptr;
EntryCache::get().destroy (entry);
// Update stats and leave.
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index 640c5847426a..c9946c22e8ca 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -766,13 +766,13 @@ private:
page & PAGE()
{
page * pImpl = static_cast<page*>(m_xPage.get());
- OSL_PRECOND(pImpl != 0, "OStoreDirectoryPageObject::PAGE(): Null pointer");
+ OSL_PRECOND(pImpl != nullptr, "OStoreDirectoryPageObject::PAGE(): Null pointer");
return (*pImpl);
}
page const & PAGE() const
{
page const * pImpl = static_cast<page const *>(m_xPage.get());
- OSL_PRECOND(pImpl != 0, "OStoreDirectoryPageObject::PAGE(): Null pointer");
+ OSL_PRECOND(pImpl != nullptr, "OStoreDirectoryPageObject::PAGE(): Null pointer");
return (*pImpl);
}
diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx
index 08233d092fc5..b56b45071b3a 100644
--- a/store/source/stordir.cxx
+++ b/store/source/stordir.cxx
@@ -51,7 +51,7 @@ inline sal_Size __store_convertTextToUnicode (
sal_uInt32 nCvtInfo = 0;
sal_Size nCvtBytes = 0;
return rtl_convertTextToUnicode (
- hConverter, 0,
+ hConverter, nullptr,
pSrcBuffer, nSrcLength,
pDstBuffer, nDstLength,
OSTRING_TO_OUSTRING_CVTFLAGS,
@@ -72,7 +72,7 @@ OStoreDirectory_Impl::OStoreDirectory_Impl()
: m_xManager (),
m_aDescr (0, 0, 0),
m_nPath (0),
- m_hTextCvt (NULL)
+ m_hTextCvt (nullptr)
{}
/*
@@ -154,7 +154,7 @@ storeError OStoreDirectory_Impl::iterate (storeFindData &rFindData)
osl::MutexGuard aGuard (*m_xManager);
// Check TextConverter.
- if (m_hTextCvt == NULL)
+ if (m_hTextCvt == nullptr)
m_hTextCvt = rtl_createTextToUnicodeConverter(RTL_TEXTENCODING_UTF8);
// Setup iteration key.
diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx
index 89027705ffb6..fb7981dbc205 100644
--- a/store/source/stordir.hxx
+++ b/store/source/stordir.hxx
@@ -110,7 +110,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl
// Handle is kind of OStoreDirectory_Impl.
return static_cast<OStoreDirectory_Impl*>(pHandle);
}
- return 0;
+ return nullptr;
}
/*========================================================================
diff --git a/store/source/store.cxx b/store/source/store.cxx
index beedbee91ea7..bdb2468540d4 100644
--- a/store/source/store.cxx
+++ b/store/source/store.cxx
@@ -106,7 +106,7 @@ storeError SAL_CALL store_createMemoryFile (
{
if (!phFile)
return store_E_InvalidParameter;
- *phFile = NULL;
+ *phFile = nullptr;
Reference<ILockBytes> xLockBytes;
@@ -141,7 +141,7 @@ storeError SAL_CALL store_openFile (
) SAL_THROW_EXTERN_C()
{
if (phFile)
- *phFile = NULL;
+ *phFile = nullptr;
if (!(pFilename && phFile))
return store_E_InvalidParameter;
@@ -218,7 +218,7 @@ storeError SAL_CALL store_openDirectory (
{
storeError eErrCode = store_E_None;
if (phDirectory)
- *phDirectory = NULL;
+ *phDirectory = nullptr;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (hFile));
@@ -312,7 +312,7 @@ storeError SAL_CALL store_openStream (
{
storeError eErrCode = store_E_None;
if (phStream)
- *phStream = NULL;
+ *phStream = nullptr;
OStoreHandle<OStorePageManager> xManager (
OStoreHandle<OStorePageManager>::query (hFile));
diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx
index c49993a55b8b..8bcf731045a2 100644
--- a/store/source/storlckb.hxx
+++ b/store/source/storlckb.hxx
@@ -135,7 +135,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*)
// Handle is kind of OStoreLockBytes.
return static_cast<OStoreLockBytes*>(pHandle);
}
- return 0;
+ return nullptr;
}
/*========================================================================
diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx
index 1dfeb048d777..76d4a5bf3d58 100644
--- a/store/source/storpage.hxx
+++ b/store/source/storpage.hxx
@@ -158,7 +158,7 @@ SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*)
// Handle is kind of OStorePageManager.
return static_cast<OStorePageManager*>(pHandle);
}
- return 0;
+ return nullptr;
}
/*========================================================================
diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx
index 87f731649159..d8d6d026ae0a 100644
--- a/store/source/stortree.cxx
+++ b/store/source/stortree.cxx
@@ -299,7 +299,7 @@ storeError OStoreBTreeNodeObject::remove (
*/
void OStoreBTreeRootObject::testInvariant (char const * message)
{
- OSL_PRECOND(m_xPage.get() != 0, "OStoreBTreeRootObject::testInvariant(): Null pointer");
+ OSL_PRECOND(m_xPage.get() != nullptr, "OStoreBTreeRootObject::testInvariant(): Null pointer");
SAL_WARN_IF( (m_xPage->location() - m_xPage->size()) != 0, "store", message);
}