Kaydet (Commit) 6129aea3 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin: cstylecast

Change-Id: I20eb45dda584c1c3a2e5d72425e49627fb7c3866
üst 26f2da07
...@@ -36,11 +36,11 @@ public: ...@@ -36,11 +36,11 @@ public:
RscInstNode( sal_uInt32 nId ); RscInstNode( sal_uInt32 nId );
virtual ~RscInstNode(); virtual ~RscInstNode();
virtual sal_uInt32 GetId() const SAL_OVERRIDE; virtual sal_uInt32 GetId() const SAL_OVERRIDE;
RscInstNode * Left() const { return (RscInstNode *)pLeft ; }; RscInstNode * Left() const { return static_cast<RscInstNode *>(pLeft); };
RscInstNode * Right() const{ return (RscInstNode *)pRight ; }; RscInstNode * Right() const{ return static_cast<RscInstNode *>(pRight); };
RscInstNode * Search( sal_uInt32 nId ) const RscInstNode * Search( sal_uInt32 nId ) const
{ {
return (RscInstNode *)IdNode::Search( nId ); return static_cast<RscInstNode *>(IdNode::Search( nId ));
} }
}; };
......
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
sal_uLong GetFileKey(){ return lFileKey; }; sal_uLong GetFileKey(){ return lFileKey; };
ObjNode* Search( const RscId &rName ) const //< search the index in the b-tree 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 bool Insert( ObjNode* pTN ) //< insert a new node in the b-tree
...@@ -72,7 +72,7 @@ public: ...@@ -72,7 +72,7 @@ public:
sal_uInt32 GetId() const SAL_OVERRIDE; sal_uInt32 GetId() const SAL_OVERRIDE;
RefNode* Search( Atom typ ) const //< search the index in the b-tree 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 bool Insert( RefNode* pTN ) //< insert a new node in the b-tree
{ {
......
...@@ -42,8 +42,8 @@ public: ...@@ -42,8 +42,8 @@ public:
// verkettete Liste um // verkettete Liste um
BiNode* ChangeBTreeDLList(); BiNode* ChangeBTreeDLList();
BiNode * Left() const { return pLeft ; }; BiNode * Left() const { return pLeft ; }
BiNode * Right() const{ return pRight ; }; BiNode * Right() const{ return pRight ; }
void EnumNodes( Link aLink ) const; void EnumNodes( Link aLink ) const;
}; };
...@@ -56,8 +56,8 @@ protected: ...@@ -56,8 +56,8 @@ protected:
NameNode* Search( const void * pCmp ) const; NameNode* Search( const void * pCmp ) const;
public: public:
NameNode* Left() const { return (NameNode *)pLeft ; }; NameNode* Left() const { return static_cast<NameNode *>(pLeft); }
NameNode* Right() const{ return (NameNode *)pRight ; }; NameNode* Right() const{ return static_cast<NameNode *>(pRight); }
NameNode* Search( const NameNode * pName ) const; NameNode* Search( const NameNode * pName ) const;
// insert a new node in the b-tree // insert a new node in the b-tree
bool Insert( NameNode * pTN, sal_uInt32 * nDepth ); bool Insert( NameNode * pTN, sal_uInt32 * nDepth );
......
...@@ -128,8 +128,8 @@ void DestroyNode( RscTop * pRscTop, ObjNode * pObjNode ) ...@@ -128,8 +128,8 @@ void DestroyNode( RscTop * pRscTop, ObjNode * pObjNode )
{ {
if( pObjNode ) if( pObjNode )
{ {
DestroyNode( pRscTop, (ObjNode*)pObjNode->Left() ); DestroyNode( pRscTop, static_cast<ObjNode*>(pObjNode->Left()) );
DestroyNode( pRscTop, (ObjNode*)pObjNode->Right() ); DestroyNode( pRscTop, static_cast<ObjNode*>(pObjNode->Right()) );
if( pObjNode->GetRscObj() ) if( pObjNode->GetRscObj() )
{ {
...@@ -144,9 +144,9 @@ void DestroySubTrees( RscTop * pRscTop ) ...@@ -144,9 +144,9 @@ void DestroySubTrees( RscTop * pRscTop )
{ {
if( pRscTop ) if( pRscTop )
{ {
DestroySubTrees( (RscTop*)pRscTop->Left() ); DestroySubTrees( static_cast<RscTop*>(pRscTop->Left()) );
DestroyNode( pRscTop, pRscTop->GetObjNode() ); DestroyNode( pRscTop, pRscTop->GetObjNode() );
DestroySubTrees( (RscTop*)pRscTop->Right() ); DestroySubTrees( static_cast<RscTop*>(pRscTop->Right()) );
} }
} }
...@@ -154,8 +154,8 @@ void DestroyTree( RscTop * pRscTop ) ...@@ -154,8 +154,8 @@ void DestroyTree( RscTop * pRscTop )
{ {
if( pRscTop ) if( pRscTop )
{ {
DestroyTree( (RscTop*)pRscTop->Left() ); DestroyTree( static_cast<RscTop*>(pRscTop->Left()) );
DestroyTree( (RscTop*)pRscTop->Right() ); DestroyTree( static_cast<RscTop*>(pRscTop->Right()) );
delete pRscTop; delete pRscTop;
} }
...@@ -165,8 +165,8 @@ void Pre_dtorTree( RscTop * pRscTop ) ...@@ -165,8 +165,8 @@ void Pre_dtorTree( RscTop * pRscTop )
{ {
if( pRscTop ) if( pRscTop )
{ {
Pre_dtorTree( (RscTop*)pRscTop->Left() ); Pre_dtorTree( static_cast<RscTop*>(pRscTop->Left()) );
Pre_dtorTree( (RscTop*)pRscTop->Right() ); Pre_dtorTree( static_cast<RscTop*>(pRscTop->Right()) );
pRscTop->Pre_dtor(); pRscTop->Pre_dtor();
} }
...@@ -615,7 +615,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop ) ...@@ -615,7 +615,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop )
{ {
RSCINST aTmpI; RSCINST aTmpI;
if( ! IsInstConsistent( (ObjNode*)pObjNode->Left(), pRscTop ) ) if( ! IsInstConsistent( static_cast<ObjNode*>(pObjNode->Left()), pRscTop ) )
bRet = false; bRet = false;
aTmpI.pClass = pRscTop; aTmpI.pClass = pRscTop;
...@@ -623,7 +623,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop ) ...@@ -623,7 +623,7 @@ bool IsInstConsistent( ObjNode * pObjNode, RscTop * pRscTop )
if( ! aTmpI.pClass->IsConsistent( aTmpI ) ) if( ! aTmpI.pClass->IsConsistent( aTmpI ) )
bRet = false; bRet = false;
if( ! IsInstConsistent( (ObjNode*)pObjNode->Right(), pRscTop ) ) if( ! IsInstConsistent( static_cast<ObjNode*>(pObjNode->Right()), pRscTop ) )
bRet = false; bRet = false;
} }
...@@ -636,7 +636,7 @@ bool MakeConsistent( RscTop * pRscTop ) ...@@ -636,7 +636,7 @@ bool MakeConsistent( RscTop * pRscTop )
if( pRscTop ) if( pRscTop )
{ {
if( ! ::MakeConsistent( (RscTop*)pRscTop->Left() ) ) if( ! ::MakeConsistent( static_cast<RscTop*>(pRscTop->Left()) ) )
bRet = false; bRet = false;
if( pRscTop->GetObjNode() ) if( pRscTop->GetObjNode() )
...@@ -651,7 +651,7 @@ bool MakeConsistent( RscTop * pRscTop ) ...@@ -651,7 +651,7 @@ bool MakeConsistent( RscTop * pRscTop )
bRet = false; bRet = false;
} }
if( ! ::MakeConsistent( (RscTop*)pRscTop->Right() ) ) if( ! ::MakeConsistent( static_cast<RscTop*>(pRscTop->Right()) ) )
bRet = false; bRet = false;
} }
......
...@@ -408,7 +408,7 @@ RscTupel * RscTypCont::InitGeometry() ...@@ -408,7 +408,7 @@ RscTupel * RscTypCont::InitGeometry()
nId = aNmTb.Put( "HEIGHT", VARNAME ); nId = aNmTb.Put( "HEIGHT", VARNAME );
pTupel->SetVariable( nId, &aShort ); pTupel->SetVariable( nId, &aShort );
return (RscTupel *)pTupel; return static_cast<RscTupel *>(pTupel);
} }
RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo ) RscArray * RscTypCont::InitLangGeometry( RscTupel * pGeo )
...@@ -444,7 +444,7 @@ RscTupel * RscTypCont::InitStringTupel() ...@@ -444,7 +444,7 @@ RscTupel * RscTypCont::InitStringTupel()
nId = aNmTb.Put( "MASK", VARNAME ); nId = aNmTb.Put( "MASK", VARNAME );
pTupel->SetVariable( nId, &aString ); pTupel->SetVariable( nId, &aString );
return (RscTupel *)pTupel; return static_cast<RscTupel *>(pTupel);
} }
RscTupel * RscTypCont::InitStringLongTupel() RscTupel * RscTypCont::InitStringLongTupel()
...@@ -459,7 +459,7 @@ RscTupel * RscTypCont::InitStringLongTupel() ...@@ -459,7 +459,7 @@ RscTupel * RscTypCont::InitStringLongTupel()
nId = aNmTb.Put( "ItemId", VARNAME ); nId = aNmTb.Put( "ItemId", VARNAME );
pTupel->SetVariable( nId, &aEnumLong ); pTupel->SetVariable( nId, &aEnumLong );
return (RscTupel *)pTupel; return static_cast<RscTupel *>(pTupel);
} }
RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString ) RscCont * RscTypCont::InitStringTupelList( RscTupel * pTupelString )
......
...@@ -105,7 +105,7 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp ) ...@@ -105,7 +105,7 @@ Atom RscNameTable::Put( const char * pName, sal_uInt32 nTyp )
Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass ) 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 ) bool RscNameTable::Get( Atom nName, KEY_STRUCT * pEle )
......
...@@ -240,7 +240,7 @@ int MakeToken( YYSTYPE * pTokenVal ) ...@@ -240,7 +240,7 @@ int MakeToken( YYSTYPE * pTokenVal )
switch( aKey.nTyp ) switch( aKey.nTyp )
{ {
case CLASSNAME: case CLASSNAME:
pTokenVal->pClass = (RscTop *)aKey.yylval; pTokenVal->pClass = reinterpret_cast<RscTop *>(aKey.yylval);
break; break;
case VARNAME: case VARNAME:
pTokenVal->varid = aKey.nName; pTokenVal->varid = aKey.nName;
......
...@@ -69,9 +69,9 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) ...@@ -69,9 +69,9 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey )
ObjNode * pRetNode = this; ObjNode * pRetNode = this;
if( Right() ) if( Right() )
pRight = ((ObjNode *)Right())->DelObjNode( pClass, nFileKey ); pRight = static_cast<ObjNode *>(Right())->DelObjNode( pClass, nFileKey );
if( Left() ) if( Left() )
pLeft = ((ObjNode *)Left())->DelObjNode( pClass, nFileKey ); pLeft = static_cast<ObjNode *>(Left())->DelObjNode( pClass, nFileKey );
if( GetFileKey() == nFileKey ) if( GetFileKey() == nFileKey )
{ {
...@@ -80,14 +80,14 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey ) ...@@ -80,14 +80,14 @@ ObjNode * ObjNode::DelObjNode( RscTop * pClass, sal_uLong nFileKey )
pClass->Destroy( RSCINST( pClass, GetRscObj() ) ); pClass->Destroy( RSCINST( pClass, GetRscObj() ) );
rtl_freeMemory( GetRscObj() ); rtl_freeMemory( GetRscObj() );
} }
pRetNode = (ObjNode *)Right(); pRetNode = static_cast<ObjNode *>(Right());
if( pRetNode ) if( pRetNode )
{ {
if( Left() ) if( Left() )
pRetNode->Insert( (ObjNode *)Left() ); pRetNode->Insert( static_cast<ObjNode *>(Left()) );
} }
else else
pRetNode = (ObjNode *)Left(); pRetNode = static_cast<ObjNode *>(Left());
delete this; delete this;
} }
...@@ -111,22 +111,22 @@ bool ObjNode::IsConsistent() ...@@ -111,22 +111,22 @@ bool ObjNode::IsConsistent()
{ {
if( Left() ) if( Left() )
{ {
if( !((ObjNode *)Left())->IsConsistent() ) if( !static_cast<ObjNode *>(Left())->IsConsistent() )
{ {
bRet = false; bRet = false;
} }
if( ((ObjNode *)Left())->aRscId >= aRscId ) if( static_cast<ObjNode *>(Left())->aRscId >= aRscId )
{ {
bRet = false; bRet = false;
} }
} }
if( Right() ) if( Right() )
{ {
if( ((ObjNode *)Right())->aRscId <= aRscId ) if( static_cast<ObjNode *>(Right())->aRscId <= aRscId )
{ {
bRet = false; bRet = false;
} }
if( !((ObjNode *)Right())->IsConsistent() ) if( !static_cast<ObjNode *>(Right())->IsConsistent() )
{ {
bRet = false; bRet = false;
} }
......
...@@ -173,7 +173,7 @@ bool RscDefine::Evaluate() ...@@ -173,7 +173,7 @@ bool RscDefine::Evaluate()
RscDefine * RscDefine::Search( const char * pStr ) RscDefine * RscDefine::Search( const char * pStr )
{ {
return (RscDefine *)StringNode::Search( pStr ); return static_cast<RscDefine *>(StringNode::Search( pStr ));
} }
OString RscDefine::GetMacro() OString RscDefine::GetMacro()
...@@ -446,7 +446,7 @@ void RscDefTree::Remove() ...@@ -446,7 +446,7 @@ void RscDefTree::Remove()
while( pDefRoot ) while( pDefRoot )
{ {
pDef = pDefRoot; pDef = pDefRoot;
pDefRoot = (RscDefine *)pDefRoot->Remove( pDefRoot ); pDefRoot = static_cast<RscDefine *>(pDefRoot->Remove( pDefRoot ));
pDef->DecRef(); pDef->DecRef();
} }
} }
...@@ -472,7 +472,7 @@ void RscDefTree::Remove( RscDefine * pDef ) ...@@ -472,7 +472,7 @@ void RscDefTree::Remove( RscDefine * pDef )
if( pDefRoot ) if( pDefRoot )
{ {
//falls pDef == pDefRoot //falls pDef == pDefRoot
pDefRoot = (RscDefine *)pDefRoot->Remove( pDef ); pDefRoot = static_cast<RscDefine *>(pDefRoot->Remove( pDef ));
} }
pDef->DecRef(); pDef->DecRef();
} }
...@@ -481,9 +481,9 @@ bool RscDefTree::Evaluate( RscDefine * pDef ) ...@@ -481,9 +481,9 @@ bool RscDefTree::Evaluate( RscDefine * pDef )
{ {
if( pDef ) if( pDef )
{ {
if( !Evaluate( (RscDefine *)pDef->Left() ) ) if( !Evaluate( static_cast<RscDefine *>(pDef->Left()) ) )
return false; return false;
if( !Evaluate( (RscDefine *)pDef->Right() ) ) if( !Evaluate( static_cast<RscDefine *>(pDef->Right()) ) )
return false; return false;
} }
return true; return true;
......
...@@ -155,9 +155,9 @@ NameNode * NameNode::Remove( NameNode * pRemove ) ...@@ -155,9 +155,9 @@ NameNode * NameNode::Remove( NameNode * pRemove )
COMPARE NameNode::Compare( const NameNode * pCompare ) const COMPARE NameNode::Compare( const NameNode * pCompare ) const
{ {
if( (long)this < (long)pCompare ) if( reinterpret_cast<long>(this) < reinterpret_cast<long>(pCompare) )
return LESS; return LESS;
else if( (long)this > (long)pCompare ) else if( reinterpret_cast<long>(this) > reinterpret_cast<long>(pCompare) )
return GREATER; return GREATER;
else else
return EQUAL; return EQUAL;
...@@ -165,9 +165,9 @@ COMPARE NameNode::Compare( const NameNode * pCompare ) const ...@@ -165,9 +165,9 @@ COMPARE NameNode::Compare( const NameNode * pCompare ) const
COMPARE NameNode::Compare( const void * 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; return LESS;
else if( (long)this > (long)pCompare ) else if( reinterpret_cast<long>(this) > reinterpret_cast<long>(pCompare) )
return GREATER; return GREATER;
else else
return EQUAL; return EQUAL;
...@@ -302,8 +302,8 @@ bool NameNode::Insert( NameNode * pTN ) ...@@ -302,8 +302,8 @@ bool NameNode::Insert( NameNode * pTN )
void NameNode::OrderTree() void NameNode::OrderTree()
{ {
NameNode * pTmpLeft = (NameNode *)Left(); NameNode * pTmpLeft = static_cast<NameNode *>(Left());
NameNode * pTmpRight = (NameNode *)Right(); NameNode * pTmpRight = static_cast<NameNode *>(Right());
pLeft = NULL; pLeft = NULL;
pRight = NULL; pRight = NULL;
...@@ -315,8 +315,8 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ) ...@@ -315,8 +315,8 @@ void NameNode::SubOrderTree( NameNode * pOrderNode )
{ {
if( pOrderNode ) if( pOrderNode )
{ {
NameNode * pTmpLeft = (NameNode *)pOrderNode->Left(); NameNode * pTmpLeft = static_cast<NameNode *>(pOrderNode->Left());
NameNode * pTmpRight = (NameNode *)pOrderNode->Right(); NameNode * pTmpRight = static_cast<NameNode *>(pOrderNode->Right());
pOrderNode->pLeft = NULL; pOrderNode->pLeft = NULL;
pOrderNode->pRight = NULL; pOrderNode->pRight = NULL;
Insert( pOrderNode ); Insert( pOrderNode );
...@@ -327,14 +327,14 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ) ...@@ -327,14 +327,14 @@ void NameNode::SubOrderTree( NameNode * pOrderNode )
IdNode * IdNode::Search( sal_uInt32 nTypeName ) const 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 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; return LESS;
else if( GetId() > (sal_uInt32)(((const IdNode *)pSearch)->GetId()) ) else if( GetId() > (sal_uInt32)(static_cast<const IdNode *>(pSearch)->GetId()) )
return GREATER; return GREATER;
else else
return EQUAL; return EQUAL;
...@@ -358,13 +358,13 @@ sal_uInt32 IdNode::GetId() const ...@@ -358,13 +358,13 @@ sal_uInt32 IdNode::GetId() const
StringNode * StringNode::Search( const char * pSearch ) 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 COMPARE StringNode::Compare( const NameNode * pSearch ) const
{ {
int nCmp = strcmp( m_aName.getStr(), int nCmp = strcmp( m_aName.getStr(),
((const StringNode *)pSearch)->m_aName.getStr() ); static_cast<const StringNode *>(pSearch)->m_aName.getStr() );
if( nCmp < 0 ) if( nCmp < 0 )
return LESS; return LESS;
else if( nCmp > 0 ) else if( nCmp > 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment