summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-16 15:23:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-17 08:25:47 +0200
commitccb2a1f650bc505f8a4f1abebf8ce4f9396562a8 (patch)
tree2ee2fd4f300ae95cf23bade1f242e02f9b276c07 /codemaker
parentda5c3a1ee43dd1a07cbd1b8005488bf05432593d (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/codemaker/typemanager.cxx3
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx16
-rw-r--r--codemaker/source/javamaker/javatype.cxx22
3 files changed, 16 insertions, 25 deletions
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<unoidl::TypedefEntity&>(*ent.get()).
- getType();
+ n = dynamic_cast<unoidl::TypedefEntity&>(*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<unoidl::TypedefEntity&>(*ent.get()).getType(),
- cStyle);
+ return getTypeClass(dynamic_cast<unoidl::TypedefEntity&>(*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<unoidl::TypedefEntity&>(*ent.get()).getType();
+ n = dynamic_cast<unoidl::TypedefEntity&>(*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<unoidl::TypedefEntity&>(*ent.get()).
- getType()),
- &k2));
+ n = b2u(codemaker::UnoType::decompose(
+ u2b(dynamic_cast<unoidl::TypedefEntity&>(*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<unoidl::ExceptionTypeEntity&>(*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),
"<clinit>", "()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<unoidl::PlainStructTypeEntity&>(*ent.get()));
+ unoidl::PlainStructTypeEntity& ent2(dynamic_cast<unoidl::PlainStructTypeEntity&>(*ent));
if (!ent2.getDirectBase().isEmpty()) {
addPlainStructBaseArguments(
manager, dependencies, methodDescriptor, code,
@@ -1435,7 +1434,7 @@ void handlePlainStructType(
ClassFile::ACC_PUBLIC, "<init>", 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, "<init>", 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<unoidl::ExceptionTypeEntity&>(*ent.get()));
+ unoidl::ExceptionTypeEntity& ent2(dynamic_cast<unoidl::ExceptionTypeEntity&>(*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);
}
}