summaryrefslogtreecommitdiff
path: root/comphelper/source
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 /comphelper/source
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 'comphelper/source')
-rw-r--r--comphelper/source/container/IndexedPropertyValuesContainer.cxx4
-rw-r--r--comphelper/source/container/NamedPropertyValuesContainer.cxx3
-rw-r--r--comphelper/source/misc/comphelper_services.cxx5
-rw-r--r--comphelper/source/misc/componentmodule.cxx9
-rw-r--r--comphelper/source/misc/documentiologring.cxx6
-rw-r--r--comphelper/source/misc/documentiologring.hxx3
-rw-r--r--comphelper/source/streaming/memorystream.cxx2
-rw-r--r--comphelper/source/streaming/seqinputstreamserv.cxx2
-rw-r--r--comphelper/source/streaming/seqoutputstreamserv.cxx2
9 files changed, 15 insertions, 21 deletions
diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
index 7fb13d1a900d..538c7d42b531 100644
--- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx
@@ -34,8 +34,6 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
#include <vector>
@@ -256,7 +254,7 @@ sal_Bool SAL_CALL IndexedPropertyValuesContainer::supportsService( const ::rtl::
uno::Reference< uno::XInterface > SAL_CALL IndexedPropertyValuesContainer::Create(
- const uno::Reference< uno::XComponentContext >&)
+ SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >&)
{
return (cppu::OWeakObject*)new IndexedPropertyValuesContainer();
}
diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx
index 954aabf1c4d8..0bf692a8aca5 100644
--- a/comphelper/source/container/NamedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx
@@ -32,7 +32,6 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/stl_types.hxx>
@@ -227,7 +226,7 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const ::rtl::OU
}
uno::Reference< uno::XInterface > SAL_CALL NamedPropertyValuesContainer::Create(
- const uno::Reference< uno::XComponentContext >&)
+ SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >&)
{
return (cppu::OWeakObject*)new NamedPropertyValuesContainer();
}
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index 9d00f76b5f4f..da91afe8f547 100644
--- a/comphelper/source/misc/comphelper_services.cxx
+++ b/comphelper/source/misc/comphelper_services.cxx
@@ -84,10 +84,11 @@ namespace comphelper { namespace module
//........................................................................
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL comphelp_component_getFactory(
- const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey )
+ const sal_Char* pImplementationName, SAL_UNUSED_PARAMETER void*,
+ SAL_UNUSED_PARAMETER void* )
{
::comphelper::module::initializeModule();
- return ::comphelper::module::ComphelperModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey );
+ return ::comphelper::module::ComphelperModule::getInstance().getComponentFactory( pImplementationName );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index f5e190d1f823..6f4e1fe6f60d 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -137,18 +137,15 @@ namespace comphelper
}
//--------------------------------------------------------------------------
- void* OModule::getComponentFactory( const sal_Char* _pImplementationName, void* _pServiceManager, void* /*_pRegistryKey*/ )
+ void* OModule::getComponentFactory( const sal_Char* _pImplementationName )
{
Reference< XInterface > xFactory( getComponentFactory(
- ::rtl::OUString::createFromAscii( _pImplementationName ),
- Reference< XMultiServiceFactory >( static_cast< XMultiServiceFactory* >( _pServiceManager ) )
- ) );
+ ::rtl::OUString::createFromAscii( _pImplementationName ) ) );
return xFactory.get();
}
//--------------------------------------------------------------------------
- Reference< XInterface > OModule::getComponentFactory( const ::rtl::OUString& _rImplementationName,
- const Reference< XMultiServiceFactory >& /* _rxServiceManager */ )
+ Reference< XInterface > OModule::getComponentFactory( const ::rtl::OUString& _rImplementationName )
{
Reference< XInterface > xReturn;
diff --git a/comphelper/source/misc/documentiologring.cxx b/comphelper/source/misc/documentiologring.cxx
index 532a2bdb21d0..a3a29df98a62 100644
--- a/comphelper/source/misc/documentiologring.cxx
+++ b/comphelper/source/misc/documentiologring.cxx
@@ -40,7 +40,7 @@ namespace comphelper
{
// ----------------------------------------------------------
-OSimpleLogRing::OSimpleLogRing( const uno::Reference< uno::XComponentContext >& /*xContext*/ )
+OSimpleLogRing::OSimpleLogRing()
: m_aMessages( SIMPLELOGRING_SIZE )
, m_bInitialized( sal_False )
, m_bFull( sal_False )
@@ -80,9 +80,9 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OSimpleLogRing::getSupportedServiceNam
}
// ----------------------------------------------------------
-uno::Reference< uno::XInterface > SAL_CALL OSimpleLogRing::Create( const uno::Reference< uno::XComponentContext >& rxContext )
+uno::Reference< uno::XInterface > SAL_CALL OSimpleLogRing::Create( SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >& )
{
- return static_cast< cppu::OWeakObject* >( new OSimpleLogRing( rxContext ) );
+ return static_cast< cppu::OWeakObject* >( new OSimpleLogRing );
}
// XSimpleLogRing
diff --git a/comphelper/source/misc/documentiologring.hxx b/comphelper/source/misc/documentiologring.hxx
index 90acd7f9152b..c51c309a730f 100644
--- a/comphelper/source/misc/documentiologring.hxx
+++ b/comphelper/source/misc/documentiologring.hxx
@@ -30,7 +30,6 @@
#define __DOCUMENTIOLOGRING_HXX_
#include <com/sun/star/logging/XSimpleLogRing.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -54,7 +53,7 @@ class OSimpleLogRing : public ::cppu::WeakImplHelper3< ::com::sun::star::logging
sal_Int32 m_nPos;
public:
- OSimpleLogRing( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
+ OSimpleLogRing();
virtual ~OSimpleLogRing();
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx
index e480a56331c1..74879e4450ce 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -233,7 +233,7 @@ Sequence< ::rtl::OUString > SAL_CALL UNOMemoryStream::getSupportedServiceNames_s
}
Reference< XInterface > SAL_CALL UNOMemoryStream::Create(
- const Reference< XComponentContext >& )
+ SAL_UNUSED_PARAMETER const Reference< XComponentContext >& )
{
return static_cast<OWeakObject*>(new UNOMemoryStream());
}
diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx
index c85d779c612b..e8dd518e1f80 100644
--- a/comphelper/source/streaming/seqinputstreamserv.cxx
+++ b/comphelper/source/streaming/seqinputstreamserv.cxx
@@ -133,7 +133,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SequenceInputStreamService::getSupport
}
uno::Reference< uno::XInterface > SAL_CALL SequenceInputStreamService::Create(
- const uno::Reference< uno::XComponentContext >& )
+ SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >& )
{
return static_cast< ::cppu::OWeakObject * >( new SequenceInputStreamService() );
}
diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx
index 3cfbb912db16..7b94a1e7150a 100644
--- a/comphelper/source/streaming/seqoutputstreamserv.cxx
+++ b/comphelper/source/streaming/seqoutputstreamserv.cxx
@@ -118,7 +118,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL SequenceOutputStreamService::getSuppor
}
uno::Reference< uno::XInterface > SAL_CALL SequenceOutputStreamService::Create(
- const uno::Reference< uno::XComponentContext >& )
+ SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >& )
{
return static_cast< ::cppu::OWeakObject * >( new SequenceOutputStreamService());
}