summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-02-17 13:14:50 +0200
committerNoel Grandin <noel@peralex.com>2016-02-23 08:08:56 +0200
commitc45d3badc96481db093560b94d8bf51ead6bd17c (patch)
tree4bb6c9220678a12b327e46ca2acd01e77fc8e2c4 /store
parent003d0ccf902d2449320dd24119564565a384f365 (diff)
new loplugin: commaoperator
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
Diffstat (limited to 'store')
-rw-r--r--store/source/lockbyte.cxx11
-rw-r--r--store/source/storbase.cxx11
-rw-r--r--store/source/storbios.cxx12
-rw-r--r--store/source/storcach.cxx40
-rw-r--r--store/source/storpage.cxx3
5 files changed, 56 insertions, 21 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx
index 9e5a5fce9c77..beb21b1be937 100644
--- a/store/source/lockbyte.cxx
+++ b/store/source/lockbyte.cxx
@@ -490,7 +490,8 @@ struct FileMapping
{
// Release mapping.
unmapFile (rMapping.m_hFile, rMapping.m_pAddr, rMapping.m_nSize);
- rMapping.m_pAddr = nullptr, rMapping.m_nSize = 0;
+ rMapping.m_pAddr = nullptr;
+ rMapping.m_nSize = 0;
}
};
typedef UnmapFile destructor_type;
@@ -556,7 +557,10 @@ void MappedLockBytes::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation");
if ((ppPage != nullptr) && (pnSize != nullptr))
- *ppPage = nullptr, *pnSize = m_nPageSize;
+ {
+ *ppPage = nullptr;
+ *pnSize = m_nPageSize;
+ }
}
void MappedLockBytes::deallocate_Impl (void * pPage)
@@ -778,7 +782,8 @@ storeError MemoryLockBytes::setSize_Impl (sal_uInt32 nSize)
if (nSize != 0)
return store_E_OutOfMemory;
}
- m_pData = pData, m_nSize = nSize;
+ m_pData = pData;
+ m_nSize = nSize;
}
return store_E_None;
}
diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx
index 51f1ddfbc8ae..df505d8d54c2 100644
--- a/store/source/storbase.cxx
+++ b/store/source/storbase.cxx
@@ -61,7 +61,8 @@ SharedCount::Allocator::Allocator()
SharedCount::Allocator::~Allocator()
{
- rtl_cache_destroy (m_cache), m_cache = nullptr;
+ rtl_cache_destroy (m_cache);
+ m_cache = nullptr;
}
/*========================================================================
@@ -124,14 +125,18 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize)
PageData::Allocator_Impl::~Allocator_Impl()
{
- rtl_cache_destroy(m_page_cache), m_page_cache = nullptr;
+ rtl_cache_destroy(m_page_cache);
+ m_page_cache = nullptr;
}
void PageData::Allocator_Impl::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize)
{
OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation");
if ((ppPage != nullptr) && (pnSize != nullptr))
- *ppPage = rtl_cache_alloc(m_page_cache), *pnSize = m_page_size;
+ {
+ *ppPage = rtl_cache_alloc(m_page_cache);
+ *pnSize = m_page_size;
+ }
}
void PageData::Allocator_Impl::deallocate_Impl (void * pPage)
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 7052b3f06d05..564fe41ccdbf 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -392,7 +392,8 @@ OStorePageBIOS::Ace::Ace()
OStorePageBIOS::Ace::~Ace()
{
- m_next->m_prev = m_prev, m_prev->m_next = m_next;
+ m_next->m_prev = m_prev;
+ m_prev->m_next = m_next;
}
int
@@ -485,7 +486,8 @@ OStorePageBIOS::AceCache::AceCache()
OStorePageBIOS::AceCache::~AceCache()
{
- rtl_cache_destroy (m_ace_cache), m_ace_cache = nullptr;
+ rtl_cache_destroy (m_ace_cache);
+ m_ace_cache = nullptr;
}
OStorePageBIOS::Ace *
@@ -510,7 +512,8 @@ OStorePageBIOS::AceCache::destroy (OStorePageBIOS::Ace * ace)
if (ace != nullptr)
{
// remove from queue (if any).
- ace->m_next->m_prev = ace->m_prev, ace->m_prev->m_next = ace->m_next;
+ ace->m_next->m_prev = ace->m_prev;
+ ace->m_prev->m_next = ace->m_next;
// restore invariant state.
ace->m_next = ace->m_prev = ace;
@@ -667,7 +670,8 @@ void OStorePageBIOS::cleanup_Impl()
}
// Release SuperBlock page.
- delete m_pSuper, m_pSuper = nullptr;
+ delete m_pSuper;
+ m_pSuper = nullptr;
// Release PageCache.
m_xCache.clear();
diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx
index d0b6c054cc2c..af4ec4ce60d2 100644
--- a/store/source/storcach.cxx
+++ b/store/source/storcach.cxx
@@ -107,7 +107,8 @@ EntryCache::EntryCache()
EntryCache::~EntryCache()
{
- rtl_cache_destroy (m_entry_cache), m_entry_cache = nullptr;
+ rtl_cache_destroy (m_entry_cache);
+ m_entry_cache = nullptr;
}
Entry * EntryCache::create (PageHolder const & rxPage, sal_uInt32 nOffset)
@@ -142,16 +143,31 @@ static int highbit(sal_Size n)
return 0;
#if SAL_TYPES_SIZEOFLONG == 8
if (n & 0xffffffff00000000ul)
- k |= 32, n >>= 32;
+ {
+ k |= 32;
+ n >>= 32;
+ }
#endif
if (n & 0xffff0000)
- k |= 16, n >>= 16;
+ {
+ k |= 16;
+ n >>= 16;
+ }
if (n & 0xff00)
- k |= 8, n >>= 8;
+ {
+ k |= 8;
+ n >>= 8;
+ }
if (n & 0xf0)
- k |= 4, n >>= 4;
+ {
+ k |= 4;
+ n >>= 4;
+ }
if (n & 0x0c)
- k |= 2, n >>= 2;
+ {
+ k |= 2;
+ n >>= 2;
+ }
if (n & 0x02)
k++;
@@ -183,7 +199,8 @@ PageCache::~PageCache()
Entry * entry = m_hash_table[i];
while (entry != nullptr)
{
- m_hash_table[i] = entry->m_pNext, entry->m_pNext = nullptr;
+ m_hash_table[i] = entry->m_pNext;
+ entry->m_pNext = nullptr;
EntryCache::get().destroy (entry);
entry = m_hash_table[i];
x += 1;
@@ -234,7 +251,8 @@ void PageCache::rescale_Impl (sal_Size new_size)
{
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->m_pNext = m_hash_table[index];
+ m_hash_table[index] = curr;
curr = next;
}
old_table[i] = nullptr;
@@ -314,7 +332,8 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse
{
// Insert new entry.
int index = hash_index_Impl(nOffset);
- entry->m_pNext = m_hash_table[index], m_hash_table[index] = entry;
+ entry->m_pNext = m_hash_table[index];
+ m_hash_table[index] = entry;
// Update stats and leave.
m_hash_entries += 1;
@@ -368,7 +387,8 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset)
Entry * entry = (*ppEntry);
// Dequeue and destroy entry.
- (*ppEntry) = entry->m_pNext, entry->m_pNext = nullptr;
+ (*ppEntry) = entry->m_pNext;
+ entry->m_pNext = nullptr;
EntryCache::get().destroy (entry);
// Update stats and leave.
diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx
index 2892908599c1..0f559b4be3fd 100644
--- a/store/source/storpage.cxx
+++ b/store/source/storpage.cxx
@@ -190,7 +190,8 @@ storeError OStorePageManager::remove_Impl (entry & rEntry)
xNext.swap (xPage);
// Check index.
- i = xPage->find (rEntry), n = xPage->usageCount();
+ i = xPage->find (rEntry);
+ n = xPage->usageCount();
if (!(i < n))
{
// Path to entry not exists (Must not happen(?)).