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 /l10ntools | |
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 'l10ntools')
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index 0e74383ecd39..2c376cf8c675 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -188,7 +188,7 @@ bool XMLFile::Write( ofstream &rStream , XMLNode *pCur ) break; case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; + XMLElement *pElement = static_cast<XMLElement*>(pCur); rStream << "<"; rStream << pElement->GetName().getStr(); if ( pElement->GetAttributeList()) @@ -257,7 +257,7 @@ void XMLFile::Print( XMLNode *pCur, sal_uInt16 nLevel ) break; case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; + XMLElement *pElement = static_cast<XMLElement*>(pCur); fprintf( stdout, "<%s", pElement->GetName().getStr()); if ( pElement->GetAttributeList()) @@ -467,7 +467,7 @@ void XMLFile::SearchL10NElements( XMLChildNode *pCur, int nPos ) break; case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; + XMLElement *pElement = static_cast<XMLElement*>(pCur); const OString sName(pElement->GetName().toAsciiLowerCase()); OString sLanguage, sTmpStrVal, sOldref; if ( pElement->GetAttributeList()) @@ -534,7 +534,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) { for ( size_t i = 0; i < GetChildList()->size(); i++ ) { - pElement = (XMLParentNode*)(*GetChildList())[ i ]; + pElement = static_cast<XMLParentNode*>((*GetChildList())[ i ]); if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) CheckExportStatus( pElement );//, i); } } @@ -542,7 +542,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) break; case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; + XMLElement *pElement = static_cast<XMLElement*>(pCur); if (pElement->GetName().equalsIgnoreAsciiCase("TOPIC")) { if ( pElement->GetAttributeList()) @@ -566,7 +566,7 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) else if ( pElement->GetChildList() ) { for (size_t k = 0; k < pElement->GetChildList()->size(); ++k) - CheckExportStatus( (XMLParentNode*)(*pElement->GetChildList())[k] ); + CheckExportStatus( static_cast<XMLParentNode*>((*pElement->GetChildList())[k]) ); } } break; |