summaryrefslogtreecommitdiff
path: root/store/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 09:33:32 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-23 06:59:31 +0100
commit7a1c21e53fc4733a4bb52282ce0098fcc085ab0e (patch)
treec1b90f74e1ce9e9f3a852f398890899459189cab /store/source
parentc24c32bf71b8e64bd0d36e511f554e1f6c015842 (diff)
loplugin:simplifybool for negation of comparison operator
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'store/source')
-rw-r--r--store/source/lockbyte.cxx8
-rw-r--r--store/source/stordata.cxx6
-rw-r--r--store/source/storpage.cxx6
-rw-r--r--store/source/stortree.cxx10
-rw-r--r--store/source/stortree.hxx2
5 files changed, 16 insertions, 16 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index 4c8aa0c5f5eb..09240505a7fb 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -80,11 +80,11 @@ 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 != nullptr))
+ if (dst_lo == nullptr)
return store_E_InvalidParameter;
sal_uInt8 * dst_hi = dst_lo + nBytes;
- if (!(dst_lo < dst_hi))
+ if (dst_lo >= dst_hi)
return (dst_lo > dst_hi) ? store_E_InvalidParameter : store_E_None;
OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::ILockBytes::readAt(): invalid Offset");
@@ -102,11 +102,11 @@ 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 != nullptr))
+ if (src_lo == nullptr)
return store_E_InvalidParameter;
sal_uInt8 const * src_hi = src_lo + nBytes;
- if (!(src_lo < src_hi))
+ if (src_lo >= src_hi)
return (src_lo > src_hi) ? store_E_InvalidParameter : store_E_None;
OSL_PRECOND(!(nOffset == STORE_PAGE_NULL), "store::ILockBytes::writeAt(): invalid Offset");
diff --git a/store/source/stordata.cxx b/store/source/stordata.cxx
index 27942d33ca11..d18592fd2bff 100644
--- a/store/source/stordata.cxx
+++ b/store/source/stordata.cxx
@@ -218,7 +218,7 @@ storeError OStoreIndirectionPageObject::read (
// Check arguments.
sal_uInt16 const nLimit = rPage.capacityCount();
- if (!(nSingle < nLimit))
+ if (nSingle >= nLimit)
return store_E_InvalidAccess;
// Obtain data page location.
@@ -308,7 +308,7 @@ storeError OStoreIndirectionPageObject::write (
// Check arguments.
sal_uInt16 const nLimit = rPage.capacityCount();
- if (!(nSingle < nLimit))
+ if (nSingle >= nLimit)
return store_E_InvalidAccess;
// Obtain data page location.
@@ -416,7 +416,7 @@ storeError OStoreIndirectionPageObject::truncate (
// Check arguments.
sal_uInt16 const nLimit = rPage.capacityCount();
- if (!(nSingle < nLimit))
+ if (nSingle >= nLimit)
return store_E_InvalidAccess;
// Truncate.
diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx
index a4b573219a95..d441121e0ac4 100644
--- a/store/source/storpage.cxx
+++ b/store/source/storpage.cxx
@@ -160,7 +160,7 @@ storeError OStorePageManager::remove_Impl (entry & rEntry)
// Check current page index.
PageHolderObject< page > xPage (aNode.get());
sal_uInt16 i = xPage->find (rEntry), n = xPage->usageCount();
- if (!(i < n))
+ if (i >= n)
{
// Path to entry not exists (Must not happen(?)).
return store_E_NotExists;
@@ -191,7 +191,7 @@ storeError OStorePageManager::remove_Impl (entry & rEntry)
// Check index.
i = xPage->find (rEntry);
n = xPage->usageCount();
- if (!(i < n))
+ if (i >= n)
{
// Path to entry not exists (Must not happen(?)).
return store_E_NotExists;
@@ -229,7 +229,7 @@ storeError OStorePageManager::namei (
return store_E_InvalidParameter;
// Check name length.
- if (!(pName->length < STORE_MAXIMUM_NAMESIZE))
+ if (pName->length >= STORE_MAXIMUM_NAMESIZE)
return store_E_NameTooLong;
// Transform pathname into key.
diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx
index c4afa028c598..8733e9bf12bf 100644
--- a/store/source/stortree.cxx
+++ b/store/source/stortree.cxx
@@ -232,7 +232,7 @@ storeError OStoreBTreeNodeObject::remove (
{
// Check link entry.
T const aEntryL (rPage.m_pData[nIndexL]);
- if (!(rEntryL.compare (aEntryL) == T::COMPARE_EQUAL))
+ if (rEntryL.compare (aEntryL) != T::COMPARE_EQUAL)
return store_E_InvalidAccess;
// Load link node.
@@ -270,7 +270,7 @@ storeError OStoreBTreeNodeObject::remove (
else
{
// Check leaf entry.
- if (!(rEntryL.compare (rPage.m_pData[nIndexL]) == T::COMPARE_EQUAL))
+ if (rEntryL.compare (rPage.m_pData[nIndexL]) != T::COMPARE_EQUAL)
return store_E_NotExists;
// Save leaf entry.
@@ -400,7 +400,7 @@ storeError OStoreBTreeRootObject::find_lookup (
page const & rPage = (*xPage);
sal_uInt16 const i = rPage.find(entry);
sal_uInt16 const n = rPage.usageCount();
- if (!(i < n))
+ if (i >= n)
{
// Path to entry not exists (Must not happen(?)).
return store_E_NotExists;
@@ -423,7 +423,7 @@ storeError OStoreBTreeRootObject::find_lookup (
// Find index.
page const & rPage = (*xPage);
rIndex = rPage.find(entry);
- if (!(rIndex < rPage.usageCount()))
+ if (rIndex >= rPage.usageCount())
return store_E_NotExists;
// Compare entry.
@@ -485,7 +485,7 @@ storeError OStoreBTreeRootObject::find_insert (
page const & rPage = (*xPage);
sal_uInt16 const i = rPage.find (entry);
sal_uInt16 const n = rPage.usageCount();
- if (!(i < n))
+ if (i >= n)
{
// Path to entry not exists (Must not happen(?)).
return store_E_NotExists;
diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx
index 6c8a9fa70f36..547f548c3a95 100644
--- a/store/source/stortree.hxx
+++ b/store/source/stortree.hxx
@@ -176,7 +176,7 @@ struct OStoreBTreeNodeData : public store::PageData
*/
bool querySplit() const
{
- return (!(usageCount() < capacityCount()));
+ return usageCount() >= capacityCount();
}
/** Operation.