diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-19 15:30:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-29 12:50:34 +0200 |
commit | 6129aea3a5bad629a108363f3a7fbf135e796092 (patch) | |
tree | 63689027c36ef35d2bac083960246e865efcc1f8 /rsc | |
parent | 26f2da07b1c6074e519d28557a3d1d5518ff6cb4 (diff) |
loplugin: cstylecast
Change-Id: I20eb45dda584c1c3a2e5d72425e49627fb7c3866
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/inc/rscarray.hxx | 6 | ||||
-rw-r--r-- | rsc/inc/rscclobj.hxx | 4 | ||||
-rw-r--r-- | rsc/inc/rsctree.hxx | 8 | ||||
-rw-r--r-- | rsc/source/parser/rscdb.cxx | 24 | ||||
-rw-r--r-- | rsc/source/parser/rscibas.cxx | 6 | ||||
-rw-r--r-- | rsc/source/parser/rsckey.cxx | 2 | ||||
-rw-r--r-- | rsc/source/parser/rsclex.cxx | 2 | ||||
-rw-r--r-- | rsc/source/res/rscclobj.cxx | 18 | ||||
-rw-r--r-- | rsc/source/tools/rscdef.cxx | 10 | ||||
-rw-r--r-- | rsc/source/tools/rsctree.cxx | 26 |
10 files changed, 53 insertions, 53 deletions
diff --git a/rsc/inc/rscarray.hxx b/rsc/inc/rscarray.hxx index dd7b511884e9..080a60e45fed 100644 --- a/rsc/inc/rscarray.hxx +++ b/rsc/inc/rscarray.hxx @@ -36,11 +36,11 @@ public: RscInstNode( sal_uInt32 nId ); virtual ~RscInstNode(); virtual sal_uInt32 GetId() const SAL_OVERRIDE; - RscInstNode * Left() const { return (RscInstNode *)pLeft ; }; - RscInstNode * Right() const{ return (RscInstNode *)pRight ; }; + RscInstNode * Left() const { return static_cast<RscInstNode *>(pLeft); }; + RscInstNode * Right() const{ return static_cast<RscInstNode *>(pRight); }; RscInstNode * Search( sal_uInt32 nId ) const { - return (RscInstNode *)IdNode::Search( nId ); + return static_cast<RscInstNode *>(IdNode::Search( nId )); } }; diff --git a/rsc/inc/rscclobj.hxx b/rsc/inc/rscclobj.hxx index 8cc515889976..a66959b3425f 100644 --- a/rsc/inc/rscclobj.hxx +++ b/rsc/inc/rscclobj.hxx @@ -42,7 +42,7 @@ public: sal_uLong GetFileKey(){ return lFileKey; }; ObjNode* Search( const RscId &rName ) const //< search the index in the b-tree { - return( (ObjNode *)IdNode::Search( rName ) ); + return( static_cast<ObjNode *>(IdNode::Search( rName )) ); } bool Insert( ObjNode* pTN ) //< insert a new node in the b-tree @@ -72,7 +72,7 @@ public: sal_uInt32 GetId() const SAL_OVERRIDE; RefNode* Search( Atom typ ) const //< search the index in the b-tree { - return( (RefNode *)IdNode::Search( typ ) ); + return( static_cast<RefNode *>(IdNode::Search( typ )) ); } bool Insert( RefNode* pTN ) //< insert a new node in the b-tree { diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx index 29c4f15122e5..15881fdee485 100644 --- a/rsc/inc/rsctree.hxx +++ b/rsc/inc/rsctree.hxx @@ -42,8 +42,8 @@ public: // verkettete Liste um BiNode* ChangeBTreeDLList(); - BiNode * Left() const { return pLeft ; }; - BiNode * Right() const{ return pRight ; }; + BiNode * Left() const { return pLeft ; } + BiNode * Right() const{ return pRight ; } void EnumNodes( Link aLink ) const; }; @@ -56,8 +56,8 @@ protected: NameNode* Search( const void * pCmp ) const; public: - NameNode* Left() const { return (NameNode *)pLeft ; }; - NameNode* Right() const{ return (NameNode *)pRight ; }; + NameNode* Left() const { return static_cast<NameNode *>(pLeft); } + NameNode* Right() const{ return static_cast<NameNode *>(pRight); } NameNode* Search( const NameNode * pName ) const; // insert a new node in the b-tree bool Insert( NameNode * pTN, sal_uInt32 * nDepth ); diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index 8d4589824696..25d78f66d5b4 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -128,8 +128,8 @@ void DestroyNode( RscTop * pRscTop, ObjNode * pObjNode ) { if( pObjNode ) { - DestroyNode( pRscTop, (ObjNode*)pObjNode->Left() ); - DestroyNode( pRscTop, (ObjNode*)pObjNode->Right() ); + DestroyNode( pRscTop, static_cast<ObjNode*>(pObjNode->Left()) ); + DestroyNode( pRscTop, static_cast<ObjNode*>(pObjNode->Right()) ); if( pObjNode->GetRscObj() ) { @@ -144,9 +144,9 @@ void DestroySubTrees( RscTop * pRscTop ) { if( pRscTop ) { - DestroySubTrees( (RscTop*)pRscTop->Left() ); + DestroySubTrees( static_cast<RscTop*>(pRscTop->Left()) ); DestroyNode( pRscTop, pRscTop->GetObjNode() ); - DestroySubTrees( (RscTop*)pRscTop->Right() ); + DestroySubTrees( static_cast<RscTop*>(pRscTop->Right()) ); } } @@ -154,8 +154,8 @@ void DestroyTree( RscTop * pRscTop ) { if( pRscTop ) { - DestroyTree( (RscTop*)pRscTop->Left() ); - DestroyTree( (RscTop*)pRscTop->Right() ); + DestroyTree( static_cast<RscTop*>(pRscTop->Left()) ); + DestroyTree( static_cast<RscTop*>(pRscTop->Right()) ); delete pRscTop; } @@ -165,8 +165,8 @@ void Pre_dtorTree( RscTop * pRscTop ) { if( pRscTop ) { - Pre_dtorTree( (RscTop*)pRscTop->Left() ); - Pre_dtorTree( (RscTop*)pRscTop->Right() ); + Pre_dtorTree( static_cast<RscTop*>(pRscTop->Left()) ); + Pre_dtorTree( static_cast<RscTop*>(pRscTop->Right()) ); pRscTop->Pre_dtor(); } @@ -615,7 +615,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop ) { RSCINST aTmpI; - if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop ) ) + if( ! IsInstConsistent( static_cast<ObjNode*>(pObjNode->Left()), pRscTop ) ) bRet = false; aTmpI.pClass = pRscTop; @@ -623,7 +623,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop ) if( ! aTmpI.pClass->IsConsistent( aTmpI ) ) bRet = false; - if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop ) ) + if( ! IsInstConsistent( static_cast<ObjNode*>(pObjNode->Right()), pRscTop ) ) bRet = false; } @@ -636,7 +636,7 @@ bool MakeConsistent( RscTop * pRscTop ) if( pRscTop ) { - if( ! ::MakeConsistent( (RscTop*)pRscTop->Left() ) ) + if( ! ::MakeConsistent( static_cast<RscTop*>(pRscTop->Left()) ) ) bRet = false; if( pRscTop->GetObjNode() ) @@ -651,7 +651,7 @@ bool MakeConsistent( RscTop * pRscTop ) bRet = false; } - if( ! ::MakeConsistent( (RscTop*)pRscTop->Right() ) ) + if( ! ::MakeConsistent( static_cast<RscTop*>(pRscTop->Right()) ) ) bRet = false; } diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 49416ba2b9e4..a7c5c2dfb068 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -408,7 +408,7 @@ RscTupel * RscTypCont::InitGeometry() nId = aNmTb.Put( "HEIGHT", VARNAME ); pTupel->SetVariable( nId, &aShort ); - return (RscTupel *)pTupel; + return static_cast<RscTupel *>(pTupel); } RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo ) @@ -444,7 +444,7 @@ RscTupel * RscTypCont::InitStringTupel() nId = aNmTb.Put( "MASK", VARNAME ); pTupel->SetVariable( nId, &aString ); - return (RscTupel *)pTupel; + return static_cast<RscTupel *>(pTupel); } RscTupel * RscTypCont::InitStringLongTupel() @@ -459,7 +459,7 @@ RscTupel * RscTypCont::InitStringLongTupel() nId = aNmTb.Put( "ItemId", VARNAME ); pTupel->SetVariable( nId, &aEnumLong ); - return (RscTupel *)pTupel; + return static_cast<RscTupel *>(pTupel); } RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString ) diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx index cd779e3a7928..94b14e014f80 100644 --- a/rsc/source/parser/rsckey.cxx +++ b/rsc/source/parser/rsckey.cxx @@ -105,7 +105,7 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp ) Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass ) { - return Put( nName, nTyp, (long)pClass ); + return Put( nName, nTyp, reinterpret_cast<long>(pClass) ); }; bool RscNameTable::Get( Atom nName, KEY_STRUCT * pEle ) diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 098308521f81..858ee84a0e17 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -240,7 +240,7 @@ int MakeToken( YYSTYPE * pTokenVal ) switch( aKey.nTyp ) { case CLASSNAME: - pTokenVal->pClass = (RscTop *)aKey.yylval; + pTokenVal->pClass = reinterpret_cast<RscTop *>(aKey.yylval); break; case VARNAME: pTokenVal->varid = aKey.nName; diff --git a/rsc/source/res/rscclobj.cxx b/rsc/source/res/rscclobj.cxx index 4f5e5ace0490..96866dd4b819 100644 --- a/rsc/source/res/rscclobj.cxx +++ b/rsc/source/res/rscclobj.cxx @@ -69,9 +69,9 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) ObjNode * pRetNode = this; if( Right() ) - pRight = ((ObjNode *)Right())->DelObjNode( pClass, nFileKey ); + pRight = static_cast<ObjNode *>(Right())->DelObjNode( pClass, nFileKey ); if( Left() ) - pLeft = ((ObjNode *)Left())->DelObjNode( pClass, nFileKey ); + pLeft = static_cast<ObjNode *>(Left())->DelObjNode( pClass, nFileKey ); if( GetFileKey() == nFileKey ) { @@ -80,14 +80,14 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) pClass->Destroy( RSCINST( pClass, GetRscObj() ) ); rtl_freeMemory( GetRscObj() ); } - pRetNode = (ObjNode *)Right(); + pRetNode = static_cast<ObjNode *>(Right()); if( pRetNode ) { if( Left() ) - pRetNode->Insert( (ObjNode *)Left() ); + pRetNode->Insert( static_cast<ObjNode *>(Left()) ); } else - pRetNode = (ObjNode *)Left(); + pRetNode = static_cast<ObjNode *>(Left()); delete this; } @@ -111,22 +111,22 @@ bool ObjNode::IsConsistent() { if( Left() ) { - if( !((ObjNode *)Left())->IsConsistent() ) + if( !static_cast<ObjNode *>(Left())->IsConsistent() ) { bRet = false; } - if( ((ObjNode *)Left())->aRscId >= aRscId ) + if( static_cast<ObjNode *>(Left())->aRscId >= aRscId ) { bRet = false; } } if( Right() ) { - if( ((ObjNode *)Right())->aRscId <= aRscId ) + if( static_cast<ObjNode *>(Right())->aRscId <= aRscId ) { bRet = false; } - if( !((ObjNode *)Right())->IsConsistent() ) + if( !static_cast<ObjNode *>(Right())->IsConsistent() ) { bRet = false; } diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index 26fb2080dc10..d89700ef0072 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -173,7 +173,7 @@ bool RscDefine::Evaluate() RscDefine * RscDefine::Search( const char * pStr ) { - return (RscDefine *)StringNode::Search( pStr ); + return static_cast<RscDefine *>(StringNode::Search( pStr )); } OString RscDefine::GetMacro() @@ -446,7 +446,7 @@ void RscDefTree::Remove() while( pDefRoot ) { pDef = pDefRoot; - pDefRoot = (RscDefine *)pDefRoot->Remove( pDefRoot ); + pDefRoot = static_cast<RscDefine *>(pDefRoot->Remove( pDefRoot )); pDef->DecRef(); } } @@ -472,7 +472,7 @@ void RscDefTree::Remove( RscDefine * pDef ) if( pDefRoot ) { //falls pDef == pDefRoot - pDefRoot = (RscDefine *)pDefRoot->Remove( pDef ); + pDefRoot = static_cast<RscDefine *>(pDefRoot->Remove( pDef )); } pDef->DecRef(); } @@ -481,9 +481,9 @@ bool RscDefTree::Evaluate( RscDefine * pDef ) { if( pDef ) { - if( !Evaluate( (RscDefine *)pDef->Left() ) ) + if( !Evaluate( static_cast<RscDefine *>(pDef->Left()) ) ) return false; - if( !Evaluate( (RscDefine *)pDef->Right() ) ) + if( !Evaluate( static_cast<RscDefine *>(pDef->Right()) ) ) return false; } return true; diff --git a/rsc/source/tools/rsctree.cxx b/rsc/source/tools/rsctree.cxx index 9fcf90638f03..9e5cf23cbdc6 100644 --- a/rsc/source/tools/rsctree.cxx +++ b/rsc/source/tools/rsctree.cxx @@ -155,9 +155,9 @@ NameNode * NameNode::Remove( NameNode * pRemove ) COMPARE NameNode::Compare( const NameNode * pCompare ) const { - if( (long)this < (long)pCompare ) + if( reinterpret_cast<long>(this) < reinterpret_cast<long>(pCompare) ) return LESS; - else if( (long)this > (long)pCompare ) + else if( reinterpret_cast<long>(this) > reinterpret_cast<long>(pCompare) ) return GREATER; else return EQUAL; @@ -165,9 +165,9 @@ COMPARE NameNode::Compare( const NameNode * pCompare ) const COMPARE NameNode::Compare( const void * pCompare ) const { - if( (long)this < (long)pCompare ) + if( reinterpret_cast<long>(this) < reinterpret_cast<long>(pCompare) ) return LESS; - else if( (long)this > (long)pCompare ) + else if( reinterpret_cast<long>(this) > reinterpret_cast<long>(pCompare) ) return GREATER; else return EQUAL; @@ -302,8 +302,8 @@ bool NameNode::Insert( NameNode * pTN ) void NameNode::OrderTree() { - NameNode * pTmpLeft = (NameNode *)Left(); - NameNode * pTmpRight = (NameNode *)Right(); + NameNode * pTmpLeft = static_cast<NameNode *>(Left()); + NameNode * pTmpRight = static_cast<NameNode *>(Right()); pLeft = NULL; pRight = NULL; @@ -315,8 +315,8 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ) { if( pOrderNode ) { - NameNode * pTmpLeft = (NameNode *)pOrderNode->Left(); - NameNode * pTmpRight = (NameNode *)pOrderNode->Right(); + NameNode * pTmpLeft = static_cast<NameNode *>(pOrderNode->Left()); + NameNode * pTmpRight = static_cast<NameNode *>(pOrderNode->Right()); pOrderNode->pLeft = NULL; pOrderNode->pRight = NULL; Insert( pOrderNode ); @@ -327,14 +327,14 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ) IdNode * IdNode::Search( sal_uInt32 nTypeName ) const { - return (IdNode *)NameNode::Search( (const void *)&nTypeName ); + return static_cast<IdNode *>(NameNode::Search( (const void *)&nTypeName )); } COMPARE IdNode::Compare( const NameNode * pSearch ) const { - if( GetId() < (sal_uInt32)(((const IdNode *)pSearch)->GetId()) ) + if( GetId() < (sal_uInt32)(static_cast<const IdNode *>(pSearch)->GetId()) ) return LESS; - else if( GetId() > (sal_uInt32)(((const IdNode *)pSearch)->GetId()) ) + else if( GetId() > (sal_uInt32)(static_cast<const IdNode *>(pSearch)->GetId()) ) return GREATER; else return EQUAL; @@ -358,13 +358,13 @@ sal_uInt32 IdNode::GetId() const StringNode * StringNode::Search( const char * pSearch ) const { - return (StringNode *)NameNode::Search( (const void *)pSearch ); + return static_cast<StringNode *>(NameNode::Search( (const void *)pSearch )); } COMPARE StringNode::Compare( const NameNode * pSearch ) const { int nCmp = strcmp( m_aName.getStr(), - ((const StringNode *)pSearch)->m_aName.getStr() ); + static_cast<const StringNode *>(pSearch)->m_aName.getStr() ); if( nCmp < 0 ) return LESS; else if( nCmp > 0 ) |