summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-30 09:45:30 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-30 13:39:32 +0200
commit9fe1b7c53df5cb3a612ab30866437ced0a406fd0 (patch)
treeadc5186f49b73a67b9353d79e0a0756e1e5d4ba6 /store
parenta6f52af75780ae28e4dc12f564ce3eb6d9c14b91 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
upgrade to asserts Change-Id: Iaf4ad07b87496e2e2039e01a4e5ceb6128cdd012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166919 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'store')
-rw-r--r--store/source/lockbyte.cxx4
-rw-r--r--store/source/storbase.hxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index 87aefdbe4185..c89a3e2ff741 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -372,7 +372,7 @@ storeError FileLockBytes::readPageAt_Impl (std::shared_ptr<PageData> & rPage, sa
storeError FileLockBytes::writePageAt_Impl (std::shared_ptr<PageData> const & rPage, sal_uInt32 nOffset)
{
PageData const * pagedata = rPage.get();
- OSL_PRECOND(pagedata != nullptr, "contract violation");
+ assert(pagedata != nullptr && "contract violation");
return writeAt_Impl (nOffset, pagedata, pagedata->size());
}
@@ -716,7 +716,7 @@ storeError MemoryLockBytes::readPageAt_Impl (std::shared_ptr<PageData> & rPage,
storeError MemoryLockBytes::writePageAt_Impl (std::shared_ptr<PageData> const & rPage, sal_uInt32 nOffset)
{
PageData const * pagedata = rPage.get();
- OSL_PRECOND(!(pagedata == nullptr), "contract violation");
+ assert(pagedata != nullptr && "contract violation");
return writeAt_Impl (nOffset, pagedata, pagedata->size());
}
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 207cbf40a8d3..6f9a4956ebd9 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -490,7 +490,7 @@ public:
pHead->guard(nAddr);
T * pImpl = dynamic_page_cast<T>(pHead);
- OSL_PRECOND(pImpl != nullptr, "store::PageHolder<T>::guard(): Null pointer");
+ assert(pImpl != nullptr && "store::PageHolder<T>::guard(): Null pointer");
pImpl->guard();
return store_E_None;