From 7c704c78d3c652504c064b4ac7af55a2c1ee49bb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 21 Jan 2012 15:21:16 +0100 Subject: Removed some unused parameters; added SAL_UNUSED_PARAMETER. SAL_UNUSED_PARAMETER (expanding to __attribute__ ((unused)) for GCC) is used to annotate legitimately unused parameters, so that static analysis tools can tell legitimately unused parameters from truly unnecessary ones. To that end, some patches for external modules are also added, that are only applied when compiling with GCC and add necessary __attribute__ ((unused)) in headers. --- store/source/object.cxx | 2 +- store/source/object.hxx | 2 +- store/source/storbase.hxx | 2 +- store/source/storbios.cxx | 12 ++++++------ store/source/storbios.hxx | 3 +-- store/source/stordir.cxx | 2 +- store/source/stordir.hxx | 2 +- store/source/storlckb.cxx | 4 ++-- store/source/storlckb.hxx | 2 +- store/source/storpage.cxx | 2 +- store/source/storpage.hxx | 2 +- 11 files changed, 17 insertions(+), 18 deletions(-) (limited to 'store/source') diff --git a/store/source/object.cxx b/store/source/object.cxx index 96029db4619b..316cb4e614cb 100644 --- a/store/source/object.cxx +++ b/store/source/object.cxx @@ -72,7 +72,7 @@ void* OStoreObject::operator new (size_t n) /* * operator delete. */ -void OStoreObject::operator delete (void *p, size_t) +void OStoreObject::operator delete (void *p) { rtl_freeMemory (p); } diff --git a/store/source/object.hxx b/store/source/object.hxx index 5f985f5b66af..6f30372fdac4 100644 --- a/store/source/object.hxx +++ b/store/source/object.hxx @@ -78,7 +78,7 @@ public: /** Allocation. */ static void* operator new (size_t n); - static void operator delete (void *p, size_t); + static void operator delete (void *p); /** IStoreHandle. */ diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index e2fe649f743b..9e7308936b3c 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -857,7 +857,7 @@ public: { return rtl_allocateMemory (sal_uInt32(n)); } - static void operator delete (void * p, size_t) SAL_THROW(()) + static void operator delete (void * p) SAL_THROW(()) { rtl_freeMemory (p); } diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index 2bdd46b78833..fc76cbfb12c1 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -199,16 +199,16 @@ struct SuperBlockPage { return rtl_allocateMemory (sal::static_int_cast(n)); } - static void operator delete (void * p, size_t) SAL_THROW(()) + static void operator delete (void * p) SAL_THROW(()) { rtl_freeMemory (p); } - static void * operator new (size_t, sal_uInt16 nPageSize) SAL_THROW(()) + static void * operator new (SAL_UNUSED_PARAMETER size_t, sal_uInt16 nPageSize) SAL_THROW(()) { return rtl_allocateZeroMemory (sal::static_int_cast(nPageSize)); } - static void operator delete (void * p, sal_uInt16) SAL_THROW(()) + static void operator delete (void * p, SAL_UNUSED_PARAMETER sal_uInt16) SAL_THROW(()) { rtl_freeMemory (p); } @@ -422,7 +422,8 @@ OStorePageBIOS::Ace::~Ace() } int -SAL_CALL OStorePageBIOS::Ace::constructor (void * obj, void * /* arg */) +SAL_CALL OStorePageBIOS::Ace::constructor ( + void * obj, SAL_UNUSED_PARAMETER void * /* arg */) { Ace * ace = static_cast(obj); ace->m_next = ace->m_prev = ace; @@ -782,8 +783,7 @@ storeError OStorePageBIOS::acquirePage ( * releasePage. * Precond: initialized. */ -storeError OStorePageBIOS::releasePage ( - const OStorePageDescriptor& rDescr, storeAccessMode /* eMode */) +storeError OStorePageBIOS::releasePage (const OStorePageDescriptor& rDescr) { // Acquire exclusive access. osl::MutexGuard aGuard (m_aMutex); diff --git a/store/source/storbios.hxx b/store/source/storbios.hxx index 74cfdc131584..bccbce4733ac 100644 --- a/store/source/storbios.hxx +++ b/store/source/storbios.hxx @@ -99,8 +99,7 @@ public: storeError acquirePage ( const OStorePageDescriptor& rDescr, storeAccessMode eMode); - storeError releasePage ( - const OStorePageDescriptor& rDescr, storeAccessMode eMode); + storeError releasePage (const OStorePageDescriptor& rDescr); sal_uInt32 getRefererCount (void); diff --git a/store/source/stordir.cxx b/store/source/stordir.cxx index 433b616e0aeb..cb9c636bfa79 100644 --- a/store/source/stordir.cxx +++ b/store/source/stordir.cxx @@ -93,7 +93,7 @@ OStoreDirectory_Impl::~OStoreDirectory_Impl (void) if (m_xManager.is()) { if (m_aDescr.m_nAddr != STORE_PAGE_NULL) - m_xManager->releasePage (m_aDescr, store_AccessReadOnly); + m_xManager->releasePage (m_aDescr); } rtl_destroyTextToUnicodeConverter (m_hTextCvt); } diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx index 44c14f19cdae..e2ef5bc4caf0 100644 --- a/store/source/stordir.hxx +++ b/store/source/stordir.hxx @@ -114,7 +114,7 @@ private: }; template<> inline OStoreDirectory_Impl* -SAL_CALL query (IStoreHandle *pHandle, OStoreDirectory_Impl*) +SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*) { if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId)) { diff --git a/store/source/storlckb.cxx b/store/source/storlckb.cxx index cb99d1fa197b..7cedac4dfd0c 100644 --- a/store/source/storlckb.cxx +++ b/store/source/storlckb.cxx @@ -72,9 +72,9 @@ OStoreLockBytes::~OStoreLockBytes (void) { OStorePageDescriptor aDescr (m_xNode->m_aDescr); if (m_bWriteable) - m_xManager->releasePage (aDescr, store_AccessReadWrite); + m_xManager->releasePage (aDescr); else - m_xManager->releasePage (aDescr, store_AccessReadOnly); + m_xManager->releasePage (aDescr); } } } diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx index 352095b72bc0..10013af71e83 100644 --- a/store/source/storlckb.hxx +++ b/store/source/storlckb.hxx @@ -150,7 +150,7 @@ private: }; template<> inline OStoreLockBytes* -SAL_CALL query (IStoreHandle *pHandle, OStoreLockBytes*) +SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*) { if (pHandle && pHandle->isKindOf (OStoreLockBytes::m_nTypeId)) { diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx index 6804b622117a..c62cd2a8a927 100644 --- a/store/source/storpage.cxx +++ b/store/source/storpage.cxx @@ -783,7 +783,7 @@ storeError OStorePageManager::remove (const OStorePageKey &rKey) } // Release page write access. - eErrCode = base::releasePage (aDescr, store_AccessReadWrite); + eErrCode = base::releasePage (aDescr); // Release and free directory page. eErrCode = base::free (aPage.location()); diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx index 80841a618e72..c1de9ea2d717 100644 --- a/store/source/storpage.hxx +++ b/store/source/storpage.hxx @@ -205,7 +205,7 @@ inline sal_Bool OStorePageManager::isValid (void) const } template<> inline OStorePageManager* -SAL_CALL query (IStoreHandle *pHandle, OStorePageManager*) +SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*) { if (pHandle && pHandle->isKindOf (OStorePageManager::m_nTypeId)) { -- cgit v1.2.3