diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-21 15:21:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-21 15:21:16 +0100 |
commit | 7c704c78d3c652504c064b4ac7af55a2c1ee49bb (patch) | |
tree | 623358cf25839219ef4fd90eea4f3eaa55389a1f /unotools | |
parent | 0d5167915b47df7c3e450614ea50d845ba959df3 (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 'unotools')
-rw-r--r-- | unotools/inc/unotools/loghelper.hxx | 11 | ||||
-rw-r--r-- | unotools/inc/unotools/ucbstreamhelper.hxx | 6 | ||||
-rw-r--r-- | unotools/source/misc/fontcvt.cxx | 5 | ||||
-rw-r--r-- | unotools/source/ucbhelper/XTempFile.hxx | 3 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 2 | ||||
-rw-r--r-- | unotools/source/ucbhelper/ucbstreamhelper.cxx | 14 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 7 |
7 files changed, 22 insertions, 26 deletions
diff --git a/unotools/inc/unotools/loghelper.hxx b/unotools/inc/unotools/loghelper.hxx index bae5c7ed09c4..24f66bd91d38 100644 --- a/unotools/inc/unotools/loghelper.hxx +++ b/unotools/inc/unotools/loghelper.hxx @@ -30,14 +30,7 @@ namespace css = ::com::sun::star; -class LogHelper -{ -public: - LogHelper(); - ~LogHelper(); - - static void logIt(const css::uno::Exception&){} -}; +namespace LogHelper { inline void logIt(const css::uno::Exception& ex) { @@ -48,6 +41,8 @@ inline void logIt(const css::uno::Exception& ex) OSL_FAIL(::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); } +} + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/inc/unotools/ucbstreamhelper.hxx b/unotools/inc/unotools/ucbstreamhelper.hxx index 8c20fd506c7b..f309b018cff8 100644 --- a/unotools/inc/unotools/ucbstreamhelper.hxx +++ b/unotools/inc/unotools/ucbstreamhelper.hxx @@ -67,13 +67,13 @@ namespace utl { public: static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode, - UcbLockBytesHandler* pHandler=0, sal_Bool bForceSynchron=sal_True ); + UcbLockBytesHandler* pHandler=0 ); static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode, NS_UNO::Reference < NS_TASK::XInteractionHandler >, - UcbLockBytesHandler* pHandler=0, sal_Bool bForceSynchron=sal_True ); + UcbLockBytesHandler* pHandler=0 ); static SvStream* CreateStream( const String& rFileName, StreamMode eOpenMode, sal_Bool bFileExists, - UcbLockBytesHandler* pHandler=0, sal_Bool bForceSynchron=sal_True ); + UcbLockBytesHandler* pHandler=0 ); static SvStream* CreateStream( NS_UNO::Reference < NS_IO::XInputStream > xStream ); static SvStream* CreateStream( NS_UNO::Reference < NS_IO::XStream > xStream ); static SvStream* CreateStream( NS_UNO::Reference < NS_IO::XInputStream > xStream, sal_Bool bCloseStream ); diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index cabdaf7582da..b65a1cce01b5 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1491,9 +1491,10 @@ FontToSubsFontConverter CreateFontToSubsFontConverter( // ----------------------------------------------------------------------- -void DestroyFontToSubsFontConverter( FontToSubsFontConverter ) +void DestroyFontToSubsFontConverter( + SAL_UNUSED_PARAMETER FontToSubsFontConverter ) { - // nothing to do for now, because we use static ImplCvtChars + //TODO: nothing to do for now, because we use static ImplCvtChars } // ----------------------------------------------------------------------- diff --git a/unotools/source/ucbhelper/XTempFile.hxx b/unotools/source/ucbhelper/XTempFile.hxx index da570ed39d1e..7f478f561a25 100644 --- a/unotools/source/ucbhelper/XTempFile.hxx +++ b/unotools/source/ucbhelper/XTempFile.hxx @@ -35,7 +35,6 @@ #include <com/sun/star/io/XTempFile.hpp> #include <com/sun/star/io/XTruncate.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase5.hxx> #include <cppuhelper/propertysetmixin.hxx> @@ -142,7 +141,7 @@ public: static ::rtl::OUString getImplementationName_Static (); static ::com::sun::star::uno::Sequence < ::rtl::OUString > getSupportedServiceNames_Static(); - static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleComponentFactory > createServiceFactory_Static( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory ); + static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleComponentFactory > createServiceFactory_Static(); private: OTempFileService( OTempFileService & ); diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index a313a1fac18a..18bffcbd7c7a 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -1591,7 +1591,7 @@ void UcbLockBytes::Cancel() } //---------------------------------------------------------------------------- -IMPL_LINK( UcbLockBytes, DataAvailHdl, void*, EMPTYARG ) +IMPL_LINK( UcbLockBytes, DataAvailHdl, SAL_UNUSED_PARAMETER void*, EMPTYARG ) { if ( hasInputStream_Impl() && m_xHandler.Is() ) m_xHandler->Handle( UcbLockBytesHandler::DATA_AVAILABLE, this ); diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx index b042078145c7..d7ac3bcb62c7 100644 --- a/unotools/source/ucbhelper/ucbstreamhelper.cxx +++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx @@ -53,7 +53,7 @@ namespace utl static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode, Reference < XInteractionHandler > xInteractionHandler, - UcbLockBytesHandler* pHandler, sal_Bool /*bForceSynchron*/, sal_Bool bEnsureFileExists ) + UcbLockBytesHandler* pHandler, sal_Bool bEnsureFileExists ) { SvStream* pStream = NULL; ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); @@ -150,23 +150,23 @@ static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode //============================================================================ SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode, - UcbLockBytesHandler* pHandler, sal_Bool bForceSynchron ) + UcbLockBytesHandler* pHandler ) { - return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, bForceSynchron, sal_True /* bEnsureFileExists */ ); + return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, sal_True /* bEnsureFileExists */ ); } SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode, Reference < XInteractionHandler > xInteractionHandler, - UcbLockBytesHandler* pHandler, sal_Bool bForceSynchron ) + UcbLockBytesHandler* pHandler ) { - return lcl_CreateStream( rFileName, eOpenMode, xInteractionHandler, pHandler, bForceSynchron, sal_True /* bEnsureFileExists */ ); + return lcl_CreateStream( rFileName, eOpenMode, xInteractionHandler, pHandler, sal_True /* bEnsureFileExists */ ); } SvStream* UcbStreamHelper::CreateStream( const String& rFileName, StreamMode eOpenMode, sal_Bool bFileExists, - UcbLockBytesHandler* pHandler, sal_Bool bForceSynchron ) + UcbLockBytesHandler* pHandler ) { - return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, bForceSynchron, !bFileExists ); + return lcl_CreateStream( rFileName, eOpenMode, Reference < XInteractionHandler >(), pHandler, !bFileExists ); } SvStream* UcbStreamHelper::CreateStream( Reference < XInputStream > xStream ) diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 4301dff0c6d4..7866ca802f12 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -472,7 +472,7 @@ throw ( ::css::uno::RuntimeException ) return static_cast< ::cppu::OWeakObject * >( new OTempFileService(context) ); } -::css::uno::Reference < ::css::lang::XSingleComponentFactory > OTempFileService::createServiceFactory_Static( ::css::uno::Reference < ::css::lang::XMultiServiceFactory > const & ) +::css::uno::Reference < ::css::lang::XSingleComponentFactory > OTempFileService::createServiceFactory_Static() { return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() ); } @@ -485,7 +485,8 @@ throw ( ::css::uno::RuntimeException ) * @return a component factory (generic uno interface) */ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) + const sal_Char * pImplName, void * pServiceManager, + SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) { void * pRet = 0; ::css::uno::Reference< ::css::lang::XMultiServiceFactory > xSMgr( @@ -493,7 +494,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( ::css::uno::Reference< ::css::lang::XSingleComponentFactory > xFactory; if (OTempFileService::getImplementationName_Static().compareToAscii( pImplName ) == 0) - xFactory = OTempFileService::createServiceFactory_Static ( xSMgr ); + xFactory = OTempFileService::createServiceFactory_Static(); if ( xFactory.is() ) { |