summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-21 15:21:16 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-01-21 15:21:16 +0100
commit7c704c78d3c652504c064b4ac7af55a2c1ee49bb (patch)
tree623358cf25839219ef4fd90eea4f3eaa55389a1f /sot
parent0d5167915b47df7c3e450614ea50d845ba959df3 (diff)
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.
Diffstat (limited to 'sot')
-rw-r--r--sot/inc/sot/object.hxx88
-rw-r--r--sot/source/base/factory.cxx2
-rw-r--r--sot/source/base/filelist.cxx4
-rw-r--r--sot/source/base/formats.cxx8
-rw-r--r--sot/source/base/object.cxx8
-rw-r--r--sot/source/sdstor/stgcache.cxx5
-rw-r--r--sot/source/sdstor/stgcache.hxx3
-rw-r--r--sot/source/sdstor/stgdir.cxx1
-rw-r--r--sot/source/sdstor/stgio.cxx2
-rw-r--r--sot/source/sdstor/storage.cxx16
-rw-r--r--sot/source/unoolestorage/register.cxx4
11 files changed, 62 insertions, 79 deletions
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
index 40cc26800317..45c317c2ebff 100644
--- a/sot/inc/sot/object.hxx
+++ b/sot/inc/sot/object.hxx
@@ -40,79 +40,79 @@
#define TEST_INVARIANT
#ifdef TEST_INVARIANT
#define SO2_DECL_INVARIANT() \
- virtual void TestObjRef( sal_Bool bFree ); \
- void TestMemberObjRef( sal_Bool bFree ); \
- virtual void TestInvariant( sal_Bool bPrint ); \
- void TestMemberInvariant( sal_Bool bPrint );
+ virtual void TestObjRef(); \
+ void TestMemberObjRef(); \
+ virtual void TestInvariant(); \
+ void TestMemberInvariant();
#define SO2_IMPL_INVARIANT(ClassName) \
-void ClassName::TestObjRef( sal_Bool bFree ) \
+void ClassName::TestObjRef() \
{ \
- TestMemberObjRef( bFree ); \
+ TestMemberObjRef(); \
} \
-void ClassName::TestInvariant( sal_Bool bPrint ) \
+void ClassName::TestInvariant() \
{ \
- TestMemberInvariant( bPrint ); \
+ TestMemberInvariant(); \
}
#define SO2_IMPL_INVARIANT1(ClassName,Super1) \
-void ClassName::TestObjRef( sal_Bool bFree ) \
+void ClassName::TestObjRef() \
{ \
- TestMemberObjRef( bFree ); \
- Super1::TestObjRef( bFree ); \
+ TestMemberObjRef(); \
+ Super1::TestObjRef(); \
} \
-void ClassName::TestInvariant( sal_Bool bPrint ) \
+void ClassName::TestInvariant() \
{ \
- TestMemberInvariant( bPrint ); \
- Super1::TestInvariant( bPrint ); \
+ TestMemberInvariant(); \
+ Super1::TestInvariant(); \
}
#define SO2_IMPL_INVARIANT2(ClassName,Super1,Super2) \
-void ClassName::TestObjRef( sal_Bool bFree ) \
+void ClassName::TestObjRef() \
{ \
- TestMemberObjRef( bFree ); \
- Super1::TestObjRef( bFree ); \
- Super2::TestObjRef( bFree ); \
+ TestMemberObjRef(); \
+ Super1::TestObjRef(); \
+ Super2::TestObjRef(); \
} \
-void ClassName::TestInvariant( sal_Bool bPrint ) \
+void ClassName::TestInvariant() \
{ \
- TestMemberInvariant( bPrint ); \
- Super1::TestInvariant( bPrint ); \
- Super2::TestInvariant( bPrint ); \
+ TestMemberInvariant(); \
+ Super1::TestInvariant(); \
+ Super2::TestInvariant(); \
}
#define SO2_IMPL_INVARIANT3(ClassName,Super1,Super2,Super3) \
-void ClassName::TestObjRef( sal_Bool bFree ) \
+void ClassName::TestObjRef() \
{ \
- TestMemberObjRef( bFree ); \
- Super1::TestObjRef( bFree ); \
- Super2::TestObjRef( bFree ); \
- Super3::TestObjRef( bFree ); \
+ TestMemberObjRef(); \
+ Super1::TestObjRef(); \
+ Super2::TestObjRef(); \
+ Super3::TestObjRef(); \
} \
-void ClassName::TestInvariant( sal_Bool bPrint ) \
+void ClassName::TestInvariant() \
{ \
- TestMemberInvariant( bPrint ); \
- Super1::TestInvariant( bPrint ); \
- Super2::TestInvariant( bPrint ); \
- Super3::TestInvariant( bPrint ); \
+ TestMemberInvariant(); \
+ Super1::TestInvariant(); \
+ Super2::TestInvariant(); \
+ Super3::TestInvariant(); \
}
#define SO2_IMPL_INVARIANT4(ClassName,Super1,Super2,Super3,Super4) \
-void ClassName::TestObjRef( sal_Bool bFree ) \
+void ClassName::TestObjRef() \
{ \
- TestMemberObjRef( bFree ); \
- Super1::TestObjRef( bFree ); \
- Super2::TestObjRef( bFree ); \
- Super3::TestObjRef( bFree ); \
- Super4::TestObjRef( bFree ); \
+ TestMemberObjRef(); \
+ Super1::TestObjRef(); \
+ Super2::TestObjRef(); \
+ Super3::TestObjRef(); \
+ Super4::TestObjRef(); \
} \
-void ClassName::TestInvariant( sal_Bool bPrint ) \
+void ClassName::TestInvariant() \
{ \
- TestMemberInvariant( bPrint ); \
- Super1::TestInvariant( bPrint ); \
- Super2::TestInvariant( bPrint ); \
- Super3::TestInvariant( bPrint ); \
- Super4::TestInvariant( bPrint ); \
+ TestMemberInvariant(); \
+ Super1::TestInvariant(); \
+ Super2::TestInvariant(); \
+ Super3::TestInvariant(); \
+ Super4::TestInvariant(); \
}
#ifdef DBG_UTIL
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index 1a7e80805ad9..830c6beaaf10 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -202,7 +202,7 @@ void SotFactory::TestInvariant()
std::list<SotObject*>::iterator it;
for( it = pSotData->aObjectList.begin(); it != pSotData->aObjectList.end(); ++it )
- (*it)->TestInvariant( sal_False );
+ (*it)->TestInvariant();
#endif
}
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index e29d3e6038bf..052657ee3a1a 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -110,9 +110,9 @@ void FileList::Assign( const SvDataCopyStream& rCopyStream )
* e.g. DropQueryFile
*/
-SvStream& operator<<( SvStream& rOStm, const FileList& /*rFileList*/ )
+SvStream& operator<<( SvStream& rOStm, SAL_UNUSED_PARAMETER const FileList& )
{
- OSL_FAIL("Not implemented!");
+ OSL_FAIL("TODO: Not implemented!");
return rOStm;
}
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 8f24951486e4..5f20b4108a89 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -1285,11 +1285,7 @@ sal_Bool IsFormatSupported( const DataFlavorExVector& rDataFlavorExVector, sal_u
// -----------------------------------------------------------------------------
-static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl&
-#ifdef WNT
-rEntry
-#endif
-)
+static sal_Bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxTransferable, const SotAction_Impl& rEntry )
{
DataFlavor aFlavor;
sal_Bool bRet = sal_True;
@@ -1333,6 +1329,8 @@ rEntry
}
break;
}
+#else
+ (void) rEntry; // avoid warnings
#endif
}
}
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 73b24b7a8b37..ac8e1287a431 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -56,9 +56,7 @@ SO2_IMPL_INVARIANT(SotObject)
|*
|* Beschreibung:
*************************************************************************/
-void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ )
-{
-}
+void SotObject::TestMemberObjRef() {}
/*************************************************************************
|* SotObject::TestMemberObjRef()
@@ -66,9 +64,7 @@ void SotObject::TestMemberObjRef( sal_Bool /*bFree*/ )
|* Beschreibung:
*************************************************************************/
#ifdef TEST_INVARIANT
-void SotObject::TestMemberInvariant( sal_Bool /*bPrint*/ )
-{
-}
+void SotObject::TestMemberInvariant() {}
#endif
/*************************************************************************
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index a9f2f909e225..48e0f7de515b 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -291,7 +291,7 @@ StgPage* StgCache::Copy( sal_Int32 nNew, sal_Int32 nOld )
// Flush the cache whose owner is given. NULL flushes all.
-sal_Bool StgCache::Commit( StgDirEntry* )
+sal_Bool StgCache::Commit()
{
StgPage* p = pElem1;
if( p ) do
@@ -338,9 +338,6 @@ sal_Bool StgCache::Commit( StgDirEntry* )
return sal_True;
}
-void StgCache::Revert( StgDirEntry* )
-{}
-
// Set a stream
void StgCache::SetStrm( SvStream* p, sal_Bool bMy )
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 9b47cffed6c8..1c0ad82b67e6 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -87,8 +87,7 @@ public:
StgPage* Find( sal_Int32 ); // find a cached page
StgPage* Get( sal_Int32, sal_Bool ); // get a cached page
StgPage* Copy( sal_Int32, sal_Int32=STG_FREE ); // copy a page
- sal_Bool Commit( StgDirEntry* = NULL ); // flush all pages
- void Revert( StgDirEntry* = NULL ); // revert dirty pages
+ sal_Bool Commit(); // flush all pages
void Clear(); // clear the cache
};
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 4f9ef4684c0a..7bdade90a935 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -769,7 +769,6 @@ StgDirStrm::StgDirStrm( StgIo& r )
// the TOC pages can be removed.
pEntry = (StgDirEntry*) this; // just for a bit pattern
SetupEntry( 0, pRoot );
- rIo.Revert( pEntry );
pEntry = NULL;
}
}
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index 40b4cea23903..0c36268c9b26 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -126,7 +126,7 @@ sal_Bool StgIo::CommitAll()
// Store the data (all streams and the TOC)
if( pTOC->Store() )
{
- if( Commit( NULL ) )
+ if( Commit() )
{
aHdr.SetDataFATStart( pDataFAT->GetStart() );
aHdr.SetDataFATSize( pDataFAT->GetPages() );
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 9cf5a4f65a80..478f649da5af 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -70,14 +70,10 @@ SO2_IMPL_BASIC_CLASS1_DLL(SotStorageStream,SotStorageStreamFactory,SotObject,
SO2_IMPL_INVARIANT(SotStorageStream)
-void SotStorageStream::TestMemberObjRef( sal_Bool /*bFree*/ )
-{
-}
+void SotStorageStream::TestMemberObjRef() {}
#ifdef TEST_INVARIANT
-void SotStorageStream::TestMemberInvariant( sal_Bool /*bPrint*/ )
-{
-}
+void SotStorageStream::TestMemberInvariant() {}
#endif
/************************************************************************
@@ -448,14 +444,10 @@ SO2_IMPL_INVARIANT(SotStorage)
|*
|* Beschreibung
*************************************************************************/
-void SotStorage::TestMemberObjRef( sal_Bool /*bFree*/ )
-{
-}
+void SotStorage::TestMemberObjRef() {}
#ifdef TEST_INVARIANT
-void SotStorage::TestMemberInvariant( sal_Bool /*bPrint*/ )
-{
-}
+void SotStorage::TestMemberInvariant() {}
#endif
/************************************************************************
diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx
index ecc86b3d32d4..f95cad693f88 100644
--- a/sot/source/unoolestorage/register.cxx
+++ b/sot/source/unoolestorage/register.cxx
@@ -39,7 +39,9 @@ using namespace ::com::sun::star;
extern "C" {
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory(
+ const sal_Char * pImplName, void * pServiceManager,
+ SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ )
{
void * pRet = 0;