diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-28 08:58:48 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-07 02:42:30 -0500 |
commit | ed75aa271956824c89b7c9df2c06e4ad09a74734 (patch) | |
tree | 432c17088789736364b2932b9085e5b17a8cc71a /idlc/source/astdump.cxx | |
parent | 5ca2d1e26513095670b3fd2dce6a464a415cab89 (diff) |
create clang plugin to warn about C-style casts
We don't like C-style casts in our nice C++ code
Change-Id: I94e7ec90de9275cd6e20c4146d4f3a74bed93c9d
Reviewed-on: https://gerrit.libreoffice.org/10367
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'idlc/source/astdump.cxx')
-rw-r--r-- | idlc/source/astdump.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/idlc/source/astdump.cxx b/idlc/source/astdump.cxx index 6e052fbb6046..d4bbc196b3d2 100644 --- a/idlc/source/astdump.cxx +++ b/idlc/source/astdump.cxx @@ -77,7 +77,7 @@ bool AstModule::dump(RegistryKey& rKey) if ( pDecl->getNodeType() == NT_const && pDecl->isInMainfile() ) { - ((AstConstant*)pDecl)->dumpBlob( + static_cast<AstConstant*>(pDecl)->dumpBlob( aBlob, index++, getNodeType() == NT_module && pDecl->isPublished()); } @@ -197,7 +197,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_service_member: if (getNodeType() == NT_singleton) { OSL_ASSERT(superName.isEmpty()); - superName = ((AstServiceMember *)(*i))-> + superName = (static_cast<AstServiceMember *>(*i))-> getRealService()->getRelativName(); break; } @@ -247,16 +247,16 @@ bool AstService::dump(RegistryKey& rKey) { switch ((*i)->getNodeType()) { case NT_operation: - ((AstOperation *)(*i))->dumpBlob(writer, constructorIndex++); + static_cast<AstOperation *>(*i)->dumpBlob(writer, constructorIndex++); break; case NT_property: - ((AstAttribute *)(*i))->dumpBlob(writer, propertyIndex++, 0); + static_cast<AstAttribute *>(*i)->dumpBlob(writer, propertyIndex++, 0); break; case NT_interface_member: { - AstInterfaceMember * decl = (AstInterfaceMember *)(*i); + AstInterfaceMember * decl = static_cast<AstInterfaceMember *>(*i); writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_SUPPORTS, (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), @@ -268,7 +268,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_service_member: if (getNodeType() == NT_service) { - AstServiceMember * decl = (AstServiceMember *)(*i); + AstServiceMember * decl = static_cast<AstServiceMember *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_EXPORTS, (decl->isOptional() ? RT_ACCESS_OPTIONAL : RT_ACCESS_INVALID), OStringToOUString(decl->getRealService()->getRelativName(), @@ -278,7 +278,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_observes: { - AstObserves * decl = (AstObserves *)(*i); + AstObserves * decl = static_cast<AstObserves *>(*i); writer.setReferenceData(referenceIndex++, decl->getDocumentation(), RT_REF_OBSERVES, RT_ACCESS_INVALID, OStringToOUString( decl->getRealInterface()->getRelativName(), @@ -288,7 +288,7 @@ bool AstService::dump(RegistryKey& rKey) case NT_needs: { - AstNeeds * decl = (AstNeeds *)(*i); + AstNeeds * decl = static_cast<AstNeeds *>(*i); writer.setReferenceData( referenceIndex++, decl->getDocumentation(), RT_REF_NEEDS, RT_ACCESS_INVALID, OStringToOUString( decl->getRealService()->getRelativName(), |