summaryrefslogtreecommitdiff
path: root/store
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-01 09:20:17 +0200
committerNoel Grandin <noel@peralex.com>2016-03-01 12:48:49 +0200
commitb3483a07bc49d6726480a4ac76473bbee5a535d5 (patch)
tree744efa595b81a772c45a4562efd622322b52f518 /store
parentd7e1e8da8b1a5158c5a89c7016e05588b0461999 (diff)
loplugin:unuseddefaultparam in store
Change-Id: I825eb075b73daa5bf52e1d41c32cf2100abebe47
Diffstat (limited to 'store')
-rw-r--r--store/source/storbios.cxx35
-rw-r--r--store/source/storbios.hxx12
2 files changed, 17 insertions, 30 deletions
diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx
index 564fe41ccdbf..ae6c0ae96d8a 100644
--- a/store/source/storbios.cxx
+++ b/store/source/storbios.cxx
@@ -443,7 +443,7 @@ public:
static AceCache & get();
OStorePageBIOS::Ace *
- create (sal_uInt32 addr, sal_uInt32 used = 1);
+ create (sal_uInt32 addr);
void
destroy (OStorePageBIOS::Ace * ace);
@@ -491,7 +491,7 @@ OStorePageBIOS::AceCache::~AceCache()
}
OStorePageBIOS::Ace *
-OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
+OStorePageBIOS::AceCache::create (sal_uInt32 addr)
{
Ace * ace = static_cast<Ace*>(rtl_cache_alloc (m_ace_cache));
if (ace != nullptr)
@@ -501,7 +501,7 @@ OStorePageBIOS::AceCache::create (sal_uInt32 addr, sal_uInt32 used)
// initialize.
ace->m_addr = addr;
- ace->m_used = used;
+ ace->m_used = 1;
}
return ace;
}
@@ -791,7 +791,7 @@ storeError OStorePageBIOS::releasePage (const OStorePageDescriptor& rDescr)
* Precond: initialized, writeable.
*/
storeError OStorePageBIOS::allocate (
- OStorePageObject& rPage, Allocation eAlloc)
+ OStorePageObject& rPage)
{
// Acquire exclusive access.
osl::MutexGuard aGuard (m_aMutex);
@@ -804,25 +804,22 @@ storeError OStorePageBIOS::allocate (
// Check allocation type.
storeError eErrCode = store_E_None;
- if (eAlloc != ALLOCATE_EOF)
+ // Try freelist head.
+ PageData aPageHead;
+ eErrCode = m_pSuper->unusedHead (*this, aPageHead);
+ if (eErrCode != store_E_None)
+ return eErrCode;
+
+ sal_uInt32 const nAddr = aPageHead.location();
+ if (nAddr != STORE_PAGE_NULL)
{
- // Try freelist head.
- PageData aPageHead;
- eErrCode = m_pSuper->unusedHead (*this, aPageHead);
+ // Save page.
+ eErrCode = saveObjectAt_Impl (rPage, nAddr);
if (eErrCode != store_E_None)
return eErrCode;
- sal_uInt32 const nAddr = aPageHead.location();
- if (nAddr != STORE_PAGE_NULL)
- {
- // Save page.
- eErrCode = saveObjectAt_Impl (rPage, nAddr);
- if (eErrCode != store_E_None)
- return eErrCode;
-
- // Pop freelist head and finish.
- return m_pSuper->unusedPop (*this, aPageHead);
- }
+ // Pop freelist head and finish.
+ return m_pSuper->unusedPop (*this, aPageHead);
}
// Allocate from EOF. Determine current size.
diff --git a/store/source/storbios.hxx b/store/source/storbios.hxx
index 36b2b655b234..ebb9ef65278b 100644
--- a/store/source/storbios.hxx
+++ b/store/source/storbios.hxx
@@ -92,17 +92,7 @@ public:
storeError releasePage (const OStorePageDescriptor& rDescr);
- /** Page Allocation.
- */
- enum Allocation
- {
- ALLOCATE_FIRST = 0,
- ALLOCATE_BEST = 1,
- ALLOCATE_EOF = 2
- };
-
- storeError allocate (
- OStorePageObject& rPage, Allocation eAllocation = ALLOCATE_FIRST);
+ storeError allocate (OStorePageObject& rPage);
storeError free (sal_uInt32 nAddr);