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 /sax | |
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 'sax')
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 41 | ||||
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 2 | ||||
-rw-r--r-- | sax/source/fastparser/facreg.cxx | 12 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 8 |
4 files changed, 35 insertions, 28 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 7e57583ccccf..677b7f59c8a2 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -194,7 +194,8 @@ private: // the extern interface //--------------------------------------- Reference< XInterface > SAL_CALL SaxExpatParser_CreateInstance( - const Reference< XMultiServiceFactory > & ) throw(Exception) + SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & ) + throw(Exception) { SaxExpatParser *p = new SaxExpatParser; @@ -843,12 +844,10 @@ void SaxExpatParser_Impl::callbackProcessingInstruction( void *pvThis, } -void SaxExpatParser_Impl::callbackUnparsedEntityDecl(void *pvThis , - const XML_Char *entityName, - const XML_Char * /*base*/, - const XML_Char *systemId, - const XML_Char *publicId, - const XML_Char *notationName) +void SaxExpatParser_Impl::callbackUnparsedEntityDecl( + void *pvThis, const XML_Char *entityName, + SAL_UNUSED_PARAMETER const XML_Char * /*base*/, const XML_Char *systemId, + const XML_Char *publicId, const XML_Char *notationName) { SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis); if( pImpl->rDTDHandler.is() ) { @@ -862,11 +861,10 @@ void SaxExpatParser_Impl::callbackUnparsedEntityDecl(void *pvThis , } } -void SaxExpatParser_Impl::callbackNotationDecl( void *pvThis, - const XML_Char *notationName, - const XML_Char * /*base*/, - const XML_Char *systemId, - const XML_Char *publicId) +void SaxExpatParser_Impl::callbackNotationDecl( + void *pvThis, const XML_Char *notationName, + SAL_UNUSED_PARAMETER const XML_Char * /*base*/, const XML_Char *systemId, + const XML_Char *publicId) { SaxExpatParser_Impl *pImpl = ((SaxExpatParser_Impl*)pvThis); if( pImpl->rDTDHandler.is() ) { @@ -880,11 +878,10 @@ void SaxExpatParser_Impl::callbackNotationDecl( void *pvThis, -int SaxExpatParser_Impl::callbackExternalEntityRef( XML_Parser parser, - const XML_Char *context, - const XML_Char * /*base*/, - const XML_Char *systemId, - const XML_Char *publicId) +int SaxExpatParser_Impl::callbackExternalEntityRef( + XML_Parser parser, const XML_Char *context, + SAL_UNUSED_PARAMETER const XML_Char * /*base*/, const XML_Char *systemId, + const XML_Char *publicId) { sal_Bool bOK = sal_True; InputSource source; @@ -953,9 +950,10 @@ int SaxExpatParser_Impl::callbackExternalEntityRef( XML_Parser parser, return bOK; } -int SaxExpatParser_Impl::callbackUnknownEncoding(void * /*encodingHandlerData*/, - const XML_Char * /*name*/, - XML_Encoding * /*info*/) +int SaxExpatParser_Impl::callbackUnknownEncoding( + SAL_UNUSED_PARAMETER void * /*encodingHandlerData*/, + SAL_UNUSED_PARAMETER const XML_Char * /*name*/, + SAL_UNUSED_PARAMETER XML_Encoding * /*info*/) { return 0; } @@ -1030,7 +1028,8 @@ extern "C" { SAL_DLLPUBLIC_EXPORT void * SAL_CALL expwrap_component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) + const sal_Char * pImplName, void * pServiceManager, + SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 3969eb33d779..49c6a837a235 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1022,7 +1022,7 @@ private: // the extern interface //--------------------------------------- Reference < XInterface > SAL_CALL SaxWriter_CreateInstance( - const Reference < XMultiServiceFactory > & ) + SAL_UNUSED_PARAMETER const Reference < XMultiServiceFactory > & ) throw (Exception) { SAXWriter *p = new SAXWriter; diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx index bc27b2e0b614..2f0eba35ff7d 100644 --- a/sax/source/fastparser/facreg.cxx +++ b/sax/source/fastparser/facreg.cxx @@ -19,13 +19,17 @@ namespace sax_fastparser //-------------------------------------- // the extern interface //--------------------------------------- -Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance( const Reference< XMultiServiceFactory > & ) throw(Exception) +Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance( + SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & ) + throw(Exception) { FastSaxParser *p = new FastSaxParser; return Reference< XInterface > ( (OWeakObject * ) p ); } -Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( const Reference< XMultiServiceFactory > & ) throw(Exception) +Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( + SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & ) + throw(Exception) { FastSaxSerializer *p = new FastSaxSerializer; return Reference< XInterface > ( (OWeakObject * ) p ); @@ -35,7 +39,9 @@ Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( const Referen extern "C" { -SAL_DLLPUBLIC_EXPORT void * SAL_CALL fastsax_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) +SAL_DLLPUBLIC_EXPORT void * SAL_CALL fastsax_component_getFactory( + const sal_Char * pImplName, void * pServiceManager, + SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 3480628813f0..66642e475c49 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -847,7 +847,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char } } -void FastSaxParser::callbackEndElement( const XML_Char* ) +void FastSaxParser::callbackEndElement( SAL_UNUSED_PARAMETER const XML_Char* ) { Entity& rEntity = getEntity(); OSL_ENSURE( !rEntity.maContextStack.empty(), "FastSaxParser::callbackEndElement - no context" ); @@ -887,8 +887,10 @@ void FastSaxParser::callbackCharacters( const XML_Char* s, int nLen ) } } -int FastSaxParser::callbackExternalEntityRef( XML_Parser parser, - const XML_Char *context, const XML_Char * /*base*/, const XML_Char *systemId, const XML_Char *publicId ) +int FastSaxParser::callbackExternalEntityRef( + XML_Parser parser, const XML_Char *context, + SAL_UNUSED_PARAMETER const XML_Char * /*base*/, const XML_Char *systemId, + const XML_Char *publicId ) { bool bOK = true; InputSource source; |