summaryrefslogtreecommitdiff
path: root/codemaker
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 /codemaker
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 'codemaker')
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx13
-rw-r--r--codemaker/source/javamaker/javatype.cxx8
2 files changed, 12 insertions, 9 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index dc238fcc74f1..ccc7a8135bf1 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -249,7 +249,7 @@ void CppuType::dumpGetCppuTypePreamble(FileStream & out) {
out << "\n\n";
}
out << ("inline ::com::sun::star::uno::Type const &"
- " cppu_detail_getUnoType(");
+ " cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ");
dumpType(out, m_typeName, false, false, true);
out << " const *) {\n";
}
@@ -271,7 +271,8 @@ void CppuType::dumpGetCppuTypePostamble(FileStream & out) {
}
}
dumpTemplateHead(out);
- out << "inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(";
+ out << ("inline ::com::sun::star::uno::Type const & SAL_CALL"
+ " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, m_typeName);
dumpTemplateParameters(out);
out << " const *) SAL_THROW(()) {\n";
@@ -531,7 +532,7 @@ void CppuType::dumpHFileContent(
{
out << "\n" << indent()
<< ("inline ::com::sun::star::uno::Type const &"
- " cppu_detail_getUnoType(");
+ " cppu_detail_getUnoType(SAL_UNUSED_PARAMETER ");
dumpType(out, m_typeName, false, false, true);
out << " const *);\n";
}
@@ -550,7 +551,7 @@ void CppuType::dumpGetCppuType(FileStream & out) {
if (m_typeName.equals("com/sun/star/uno/XInterface")) {
out << indent()
<< ("inline ::com::sun::star::uno::Type const & SAL_CALL"
- " getCppuType(");
+ " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, m_typeName, true, false);
out << " *) SAL_THROW(()) {\n";
inc();
@@ -562,7 +563,7 @@ void CppuType::dumpGetCppuType(FileStream & out) {
} else if (m_typeName.equals("com/sun/star/uno/Exception")) {
out << indent()
<< ("inline ::com::sun::star::uno::Type const & SAL_CALL"
- " getCppuType(");
+ " getCppuType(SAL_UNUSED_PARAMETER ");
dumpType(out, m_typeName, true, false);
out << " *) SAL_THROW(()) {\n";
inc();
@@ -1435,7 +1436,7 @@ sal_Bool InterfaceType::dumpHxxFile(
o << "\n::com::sun::star::uno::Type const & "
<< scopedCppName(m_typeName)
- << "::static_type(void *) {\n";
+ << "::static_type(SAL_UNUSED_PARAMETER void *) {\n";
inc();
o << indent() << "return ::getCppuType(static_cast< ";
dumpType(o, m_typeName);
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 83f61d750328..1453122ce749 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -842,8 +842,9 @@ typedef void (* handleUnoTypeRegistryEntityFunction)(
typereg::Reader const & reader, Dependencies * dependencies);
void handleEnumType(
- TypeManager const &, JavaOptions /*TODO const*/ & options,
- typereg::Reader const & reader, Dependencies *)
+ SAL_UNUSED_PARAMETER TypeManager const &,
+ JavaOptions /*TODO const*/ & options, typereg::Reader const & reader,
+ SAL_UNUSED_PARAMETER Dependencies *)
{
sal_uInt16 fields = reader.getFieldCount();
if (fields == 0 || reader.getSuperTypeCount() != 0
@@ -2364,7 +2365,8 @@ void handleInterfaceType(
}
void handleTypedef(
- TypeManager const & manager, JavaOptions /*TODO const*/ &,
+ TypeManager const & manager,
+ SAL_UNUSED_PARAMETER JavaOptions /*TODO const*/ &,
typereg::Reader const & reader, Dependencies * dependencies)
{
OSL_ASSERT(dependencies != 0);