diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-11-27 09:46:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-11-27 14:04:40 +0100 |
commit | a2656563f1a7639a99276fda90b6c8f675d20fc5 (patch) | |
tree | cc9eb4f064b1e8cdfce9ac42c52dfa6ae54f2b70 /codemaker | |
parent | 0093ae5f2ca1141f199aa9ae3b34b05a33def928 (diff) |
loplugin:unnecessaryparen: Warn about parentheses around literals
...that are not composed of multiple tokens, like ("foo" "bar"). Also don't yet
warn about Boolean literals, which are sometimes wrapped in parentheses to
silence unreachable-code warnings.
To avoid multiple warnings about code like
f((0))
switch to generally using a set of ParenExpr to keep track of which occurrences
have already been handled.
Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc
Reviewed-on: https://gerrit.libreoffice.org/45317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/codemaker/typemanager.cxx | 2 | ||||
-rw-r--r-- | codemaker/source/cppumaker/cpputype.cxx | 20 | ||||
-rw-r--r-- | codemaker/source/cppumaker/includes.cxx | 14 |
3 files changed, 18 insertions, 18 deletions
diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx index b37f14edca69..345594a38b1f 100644 --- a/codemaker/source/codemaker/typemanager.cxx +++ b/codemaker/source/codemaker/typemanager.cxx @@ -252,7 +252,7 @@ codemaker::UnoType::Sort TypeManager::decompose( default: throw CannotDumpException( "unexpected \"" + n + "\" resolved from \"" + name - + ("\"in call to TypeManager::decompose")); + + "\"in call to TypeManager::decompose"); } } } diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 36014c13460b..ba84a46b75f4 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -1402,7 +1402,7 @@ void InterfaceType::dumpCppuAttributeRefs(FileStream & out, sal_uInt32 & index) << "],\n"; inc(38); out << indent() - << ("(typelib_TypeClass)::css::uno::TypeClass_INTERFACE_ATTRIBUTE,\n") + << "(typelib_TypeClass)::css::uno::TypeClass_INTERFACE_ATTRIBUTE,\n" << indent() << "sAttributeName" << n << ".pData );\n"; dec(38); ++n; @@ -1419,7 +1419,7 @@ void InterfaceType::dumpCppuMethodRefs(FileStream & out, sal_uInt32 & index) << "],\n"; inc(38); out << indent() - << ("(typelib_TypeClass)::css::uno::TypeClass_INTERFACE_METHOD,\n") + << "(typelib_TypeClass)::css::uno::TypeClass_INTERFACE_METHOD,\n" << indent() << "sMethodName" << n << ".pData );\n"; dec(38); ++n; @@ -1965,7 +1965,7 @@ void PlainStructType::dumpLightGetCppuType(FileStream & out) << getTypeClass(name_, true) << ", \"" << name_ << "\");\n"; dec(); out << indent() << "}\n" << indent() - << ("return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"); + << "return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"; dumpGetCppuTypePostamble(out); } @@ -2005,7 +2005,7 @@ void PlainStructType::dumpNormalGetCppuType(FileStream & out) out << ", " << entity_->getDirectMembers().size() << ", the_members, 0);\n"; dec(); out << indent() << "}\n" << indent() - << ("return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"); + << "return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"; dumpGetCppuTypePostamble(out); } @@ -2418,7 +2418,7 @@ void PolyStructType::dumpLightGetCppuType(FileStream & out) << ", the_buffer.getStr());\n"; dec(); out << indent() << "}\n" << indent() - << ("return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"); + << "return *reinterpret_cast< ::css::uno::Type * >(&the_type);\n"; dumpGetCppuTypePostamble(out); } @@ -3558,7 +3558,7 @@ void ServiceType::dumpHppFile( o << indent() << "throw;\n"; dec(); o << indent() - << ("} catch (const ::css::uno::Exception & the_exception) {\n"); + << "} catch (const ::css::uno::Exception & the_exception) {\n"; inc(); o << indent() << "throw ::css::uno::DeploymentException("; failsToSupply(o, name_, baseName); @@ -3603,7 +3603,7 @@ void ServiceType::dumpHppFile( o << indent() << "assert(the_context.is());\n"; if (!rest && !cons.parameters.empty()) { o << indent() - << ("::css::uno::Sequence< ::css::uno::Any > the_arguments(") + << "::css::uno::Sequence< ::css::uno::Any > the_arguments(" << cons.parameters.size() << ");\n"; std::vector< unoidl::SingleInterfaceBasedServiceEntity::Constructor:: @@ -3681,7 +3681,7 @@ void ServiceType::dumpHppFile( o << "the_arguments"; } o << ");\n" << indent() << "}\n"; - o << ("#else\n") + o << "#else\n" << indent() << "the_instance = ::css::uno::Reference< " << scopedBaseName << (" >(the_context->getServiceManager()->" @@ -3693,7 +3693,7 @@ void ServiceType::dumpHppFile( u2b(cons.parameters.back().name), "param", codemaker::cpp::IdentifierTranslationMode::NonGlobal); } else if (cons.parameters.empty()) { - o << ("::css::uno::Sequence< ::css::uno::Any >()"); + o << "::css::uno::Sequence< ::css::uno::Any >()"; } else { o << "the_arguments"; } @@ -3701,7 +3701,7 @@ void ServiceType::dumpHppFile( if (!tree.getRoot().present) { dec(); o << indent() - << ("} catch (const ::css::uno::RuntimeException &) {\n"); + << "} catch (const ::css::uno::RuntimeException &) {\n"; inc(); o << indent() << "throw;\n"; dec(); diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx index b317ff05784b..e33262ee7f6c 100644 --- a/codemaker/source/cppumaker/includes.cxx +++ b/codemaker/source/cppumaker/includes.cxx @@ -201,11 +201,11 @@ void Includes::dump( } if (m_includeCppuMacrosHxx) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"cppu/macros.hxx\"\n"); + out << "#include \"cppu/macros.hxx\"\n"; } if (m_includeCppuUnotypeHxx) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"cppu/unotype.hxx\"\n"); + out << "#include \"cppu/unotype.hxx\"\n"; } if (m_includeOslMutexHxx) { dumpEmptyLineBeforeFirst(out, &first); @@ -213,7 +213,7 @@ void Includes::dump( } if (m_includeRtlStrbufHxx) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"rtl/strbuf.hxx\"\n"); + out << "#include \"rtl/strbuf.hxx\"\n"; } if (m_includeRtlStringH) { dumpEmptyLineBeforeFirst(out, &first); @@ -225,7 +225,7 @@ void Includes::dump( } if (m_includeRtlUstrbufHxx) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"rtl/ustrbuf.hxx\"\n"); + out << "#include \"rtl/ustrbuf.hxx\"\n"; } if (m_includeRtlUstringH) { dumpEmptyLineBeforeFirst(out, &first); @@ -233,7 +233,7 @@ void Includes::dump( } if (m_includeRtlUstringHxx) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"rtl/ustring.hxx\"\n"); + out << "#include \"rtl/ustring.hxx\"\n"; } if (m_includeRtlInstanceHxx) { dumpEmptyLineBeforeFirst(out, &first); @@ -245,11 +245,11 @@ void Includes::dump( } if (m_includeTypelibTypeclassH) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"typelib/typeclass.h\"\n"); + out << "#include \"typelib/typeclass.h\"\n"; } if (m_includeTypelibTypedescriptionH) { dumpEmptyLineBeforeFirst(out, &first); - out << ("#include \"typelib/typedescription.h\"\n"); + out << "#include \"typelib/typedescription.h\"\n"; } } |