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

loplugin: cstylecast

Change-Id: I20eb45dda584c1c3a2e5d72425e49627fb7c3866
üst 26f2da07
......@@ -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 ));
}
};
......
......@@ -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
{
......
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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 )
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 )
......
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