From ccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Oct 2018 15:23:12 +0200 Subject: clang-tidy readability-redundant-smartptr-get redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin --- codemaker/source/codemaker/typemanager.cxx | 3 +-- codemaker/source/cppumaker/cpputype.cxx | 16 +++++----------- codemaker/source/javamaker/javatype.cxx | 22 ++++++++++------------ 3 files changed, 16 insertions(+), 25 deletions(-) (limited to 'codemaker') diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx index 345594a38b1f..2b54a4092772 100644 --- a/codemaker/source/codemaker/typemanager.cxx +++ b/codemaker/source/codemaker/typemanager.cxx @@ -178,8 +178,7 @@ codemaker::UnoType::Sort TypeManager::decompose( switch (s) { case codemaker::UnoType::Sort::Typedef: if (resolveTypedefs) { - n = dynamic_cast(*ent.get()). - getType(); + n = dynamic_cast(*ent).getType(); while (n.startsWith("[]")) { ++k; //TODO: overflow n = n.copy(std::strlen("[]")); diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 722846b0efa6..4b3face0c702 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -736,9 +736,7 @@ OUString CppuType::getTypeClass(OUString const & name, bool cStyle) ? OUString("typelib_TypeClass_INTERFACE") : OUString("::css::uno::TypeClass_INTERFACE"); case codemaker::UnoType::Sort::Typedef: - return getTypeClass( - dynamic_cast(*ent.get()).getType(), - cStyle); + return getTypeClass(dynamic_cast(*ent).getType(), cStyle); default: for (;;) { std::abort(); @@ -988,7 +986,7 @@ OUString CppuType::resolveOuterTypedefs(OUString const & name) const if (m_typeMgr->getSort(n, &ent) != codemaker::UnoType::Sort::Typedef) { return n; } - n = dynamic_cast(*ent.get()).getType(); + n = dynamic_cast(*ent).getType(); } } @@ -1002,11 +1000,8 @@ OUString CppuType::resolveAllTypedefs(OUString const & name) const break; } sal_Int32 k2; - n = b2u( - codemaker::UnoType::decompose( - u2b(dynamic_cast(*ent.get()). - getType()), - &k2)); + n = b2u(codemaker::UnoType::decompose( + u2b(dynamic_cast(*ent).getType()), &k2)); k1 += k2; //TODO: overflow } OUStringBuffer b; @@ -3138,8 +3133,7 @@ sal_uInt32 ExceptionType::getTotalMemberCount(OUString const & base) const throw CannotDumpException( "exception type base " + base + " is not an exception type"); } - unoidl::ExceptionTypeEntity& ent2( - dynamic_cast< unoidl::ExceptionTypeEntity&>(*ent.get())); + unoidl::ExceptionTypeEntity& ent2(dynamic_cast(*ent)); return getTotalMemberCount(ent2.getDirectBase()) + ent2.getDirectMembers().size(); //TODO: overflow } diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 5530392b278b..b5ece143572e 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -814,7 +814,7 @@ void handleEnumType( static_cast< ClassFile::AccessFlags >( ClassFile::ACC_PRIVATE | ClassFile::ACC_STATIC), "", "()V", code.get(), std::vector< OString >(), ""); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addField( @@ -1349,8 +1349,7 @@ void addPlainStructBaseArguments( "unexpected entity \"" + base + "\" in call to addPlainStructBaseArguments"); } - unoidl::PlainStructTypeEntity& ent2( - dynamic_cast(*ent.get())); + unoidl::PlainStructTypeEntity& ent2(dynamic_cast(*ent)); if (!ent2.getDirectBase().isEmpty()) { addPlainStructBaseArguments( manager, dependencies, methodDescriptor, code, @@ -1435,7 +1434,7 @@ void handlePlainStructType( ClassFile::ACC_PUBLIC, "", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handlePolyStructType( @@ -1521,7 +1520,7 @@ void handlePolyStructType( ClassFile::ACC_PUBLIC, "", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addExceptionBaseArguments( @@ -1538,8 +1537,7 @@ void addExceptionBaseArguments( "unexpected entity \"" + base + "\" in call to addExceptionBaseArguments"); } - unoidl::ExceptionTypeEntity& ent2( - dynamic_cast(*ent.get())); + unoidl::ExceptionTypeEntity& ent2(dynamic_cast(*ent)); bool baseException = base == "com.sun.star.uno.Exception"; if (!baseException) { addExceptionBaseArguments( @@ -1827,7 +1825,7 @@ void handleExceptionType( std::vector< OString >(), desc2.getSignature()); addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void createExceptionsAttribute( @@ -1954,7 +1952,7 @@ void handleInterfaceType( } } addTypeInfo(className, typeInfo, dependencies, cf.get()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handleTypedef( @@ -2063,7 +2061,7 @@ void handleConstantGroup( | ClassFile::ACC_FINAL), codemaker::convertString(member.name), desc, valueIndex, sig); } - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void addExceptionHandlers( @@ -2324,7 +2322,7 @@ void handleService( code.get(), std::vector< OString >(), ""); } } - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } void handleSingleton( @@ -2440,7 +2438,7 @@ void handleSingleton( ClassFile::ACC_PUBLIC | ClassFile::ACC_STATIC), "get", desc.getDescriptor(), code.get(), std::vector< OString >(), desc.getSignature()); - writeClassFile(options, className, *cf.get()); + writeClassFile(options, className, *cf); } } -- cgit