Kaydet (Commit) e56bec5c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast: deal with remaining pointer casts

Change-Id: I27516cc532e46b6e43a2f2f292246f1414e9f9b3
üst f61f7609
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
bool Insert( ObjNode* pTN ) //< insert a new node in the b-tree bool Insert( ObjNode* pTN ) //< insert a new node in the b-tree
{ {
return IdNode::Insert( (IdNode *)pTN ); return IdNode::Insert( static_cast<IdNode *>(pTN) );
} }
CLASS_DATA GetRscObj() //< get the Object from this Node CLASS_DATA GetRscObj() //< get the Object from this Node
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
} }
bool Insert( RefNode* pTN ) //< insert a new node in the b-tree bool Insert( RefNode* pTN ) //< insert a new node in the b-tree
{ {
return IdNode::Insert( (IdNode *)pTN ); return IdNode::Insert( static_cast<IdNode *>(pTN) );
} }
bool PutObjNode( ObjNode * pPutObject ); bool PutObjNode( ObjNode * pPutObject );
......
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
~RscPtrPtr(); ~RscPtrPtr();
void Reset(); void Reset();
sal_uInt32 Append( void * ); sal_uInt32 Append( void * );
sal_uInt32 Append( char * pStr ) { return Append( (void *)pStr ); } sal_uInt32 Append( char * pStr ) { return Append( static_cast<void *>(pStr) ); }
sal_uInt32 GetCount() { return nCount; } sal_uInt32 GetCount() { return nCount; }
void * GetEntry( sal_uInt32 nEle ); void * GetEntry( sal_uInt32 nEle );
void ** GetBlock() { return pMem; } void ** GetBlock() { return pMem; }
......
...@@ -64,7 +64,7 @@ void RscNameTable::SetSort( bool bSorted ) ...@@ -64,7 +64,7 @@ void RscNameTable::SetSort( bool bSorted )
if( bSort && pTable) if( bSort && pTable)
{ {
// Schluesselwort Feld sortieren // Schluesselwort Feld sortieren
qsort( (void *)pTable, nEntries, qsort( static_cast<void *>(pTable), nEntries,
sizeof( KEY_STRUCT ), KeyCompare ); sizeof( KEY_STRUCT ), KeyCompare );
} }
}; };
...@@ -73,7 +73,7 @@ Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, sal_IntPtr nValue ) ...@@ -73,7 +73,7 @@ Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, sal_IntPtr nValue )
{ {
if( pTable ) if( pTable )
pTable = static_cast<KEY_STRUCT *>( pTable = static_cast<KEY_STRUCT *>(
rtl_reallocateMemory( (void *)pTable, rtl_reallocateMemory( static_cast<void *>(pTable),
((nEntries +1) * sizeof( KEY_STRUCT )) )); ((nEntries +1) * sizeof( KEY_STRUCT )) ));
else else
pTable = static_cast<KEY_STRUCT *>( pTable = static_cast<KEY_STRUCT *>(
......
...@@ -96,7 +96,7 @@ static bool CallPrePro( const OString& rInput, ...@@ -96,7 +96,7 @@ static bool CallPrePro( const OString& rInput,
aNewCmdL.Append( rsc_strdup( rInput.getStr() ) ); aNewCmdL.Append( rsc_strdup( rInput.getStr() ) );
aNewCmdL.Append( rsc_strdup( rOutput.getStr() ) ); aNewCmdL.Append( rsc_strdup( rOutput.getStr() ) );
aNewCmdL.Append( (void *)0 ); aNewCmdL.Append( static_cast<void *>(nullptr) );
if ( bVerbose ) if ( bVerbose )
{ {
...@@ -115,7 +115,7 @@ static bool CallPrePro( const OString& rInput, ...@@ -115,7 +115,7 @@ static bool CallPrePro( const OString& rInput,
OStringBuffer aTmpStr; OStringBuffer aTmpStr;
aTmpStr.append('@').append(aRspFileName); aTmpStr.append('@').append(aRspFileName);
aRespCmdL.Append( rsc_strdup( aTmpStr.getStr() ) ); aRespCmdL.Append( rsc_strdup( aTmpStr.getStr() ) );
aRespCmdL.Append( (void *)0 ); aRespCmdL.Append( static_cast<void *>(nullptr) );
pCmdL = &aRespCmdL; pCmdL = &aRespCmdL;
for( i = 0; i < (int)(aNewCmdL.GetCount() -1); i++ ) for( i = 0; i < (int)(aNewCmdL.GetCount() -1); i++ )
......
...@@ -59,7 +59,7 @@ void RscClass::Pre_dtor() ...@@ -59,7 +59,7 @@ void RscClass::Pre_dtor()
RscClass::~RscClass() RscClass::~RscClass()
{ {
if( pVarTypeList ) if( pVarTypeList )
rtl_freeMemory( (void *)pVarTypeList ); rtl_freeMemory( static_cast<void *>(pVarTypeList) );
} }
RSCCLASS_TYPE RscClass::GetClassType() const RSCCLASS_TYPE RscClass::GetClassType() const
...@@ -234,7 +234,7 @@ ERRTYPE RscClass::SetVariable( Atom nVarName, ...@@ -234,7 +234,7 @@ ERRTYPE RscClass::SetVariable( Atom nVarName,
{ {
if( pVarTypeList ) if( pVarTypeList )
{ {
pVarTypeList = static_cast<VARTYPE_STRUCT *>(rtl_reallocateMemory( (void *)pVarTypeList, pVarTypeList = static_cast<VARTYPE_STRUCT *>(rtl_reallocateMemory( static_cast<void *>(pVarTypeList),
((nEntries +1) * sizeof( VARTYPE_STRUCT )) )); ((nEntries +1) * sizeof( VARTYPE_STRUCT )) ));
} }
else else
......
...@@ -36,7 +36,7 @@ RscConst::RscConst( Atom nId, sal_uInt32 nTypeId ) ...@@ -36,7 +36,7 @@ RscConst::RscConst( Atom nId, sal_uInt32 nTypeId )
RscConst::~RscConst() RscConst::~RscConst()
{ {
if( pVarArray ) if( pVarArray )
rtl_freeMemory( (void *)pVarArray ); rtl_freeMemory( static_cast<void *>(pVarArray) );
} }
RSCCLASS_TYPE RscConst::GetClassType() const RSCCLASS_TYPE RscConst::GetClassType() const
...@@ -47,7 +47,7 @@ RSCCLASS_TYPE RscConst::GetClassType() const ...@@ -47,7 +47,7 @@ RSCCLASS_TYPE RscConst::GetClassType() const
ERRTYPE RscConst::SetConstant( Atom nVarName, sal_Int32 lValue ) ERRTYPE RscConst::SetConstant( Atom nVarName, sal_Int32 lValue )
{ {
if( pVarArray ) if( pVarArray )
pVarArray = static_cast<VarEle *>(rtl_reallocateMemory( (void *)pVarArray, pVarArray = static_cast<VarEle *>(rtl_reallocateMemory( static_cast<void *>(pVarArray),
((nEntries +1) * sizeof( VarEle )) )); ((nEntries +1) * sizeof( VarEle )) ));
else else
pVarArray = static_cast<VarEle *>(rtl_allocateMemory( ((nEntries +1) * sizeof( VarEle )) )); pVarArray = static_cast<VarEle *>(rtl_allocateMemory( ((nEntries +1) * sizeof( VarEle )) ));
......
...@@ -187,7 +187,7 @@ char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv, sal_uInt32 nArgc ) ...@@ -187,7 +187,7 @@ char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv, sal_uInt32 nArgc )
else else
ppCmd->Append( rsc_strdup( *(ppArgv +i) ) ); ppCmd->Append( rsc_strdup( *(ppArgv +i) ) );
} }
ppCmd->Append( (void *)0 ); ppCmd->Append( static_cast<void *>(nullptr) );
return NULL; return NULL;
} }
...@@ -214,7 +214,7 @@ void RscPtrPtr :: Reset() ...@@ -214,7 +214,7 @@ void RscPtrPtr :: Reset()
if( pMem[ i ] ) if( pMem[ i ] )
rtl_freeMemory( pMem[ i ] ); rtl_freeMemory( pMem[ i ] );
} }
rtl_freeMemory( (void *)pMem ); rtl_freeMemory( static_cast<void *>(pMem) );
}; };
nCount = 0; nCount = 0;
pMem = NULL; pMem = NULL;
...@@ -225,7 +225,7 @@ sal_uInt32 RscPtrPtr :: Append( void * pBuffer ) ...@@ -225,7 +225,7 @@ sal_uInt32 RscPtrPtr :: Append( void * pBuffer )
if( !pMem ) if( !pMem )
pMem = static_cast<void **>(rtl_allocateMemory( (nCount +1) * sizeof( void * ) )); pMem = static_cast<void **>(rtl_allocateMemory( (nCount +1) * sizeof( void * ) ));
else else
pMem = static_cast<void **>(rtl_reallocateMemory( (void *)pMem, pMem = static_cast<void **>(rtl_reallocateMemory( static_cast<void *>(pMem),
((nCount +1) * sizeof( void * ) ((nCount +1) * sizeof( void * )
) )); ) ));
pMem[ nCount ] = pBuffer; pMem[ nCount ] = pBuffer;
......
...@@ -69,15 +69,15 @@ BiNode * BiNode::ChangeDLListBTree( BiNode * pList ) ...@@ -69,15 +69,15 @@ BiNode * BiNode::ChangeDLListBTree( BiNode * pList )
} }
else else
{ {
pList = (BiNode *)0; pList = nullptr;
} }
if( NULL != (pTmp = pMiddle->Left()) ) // rechten Zeiger auf Null if( NULL != (pTmp = pMiddle->Left()) ) // rechten Zeiger auf Null
pTmp->pRight = (BiNode *)0; pTmp->pRight = nullptr;
// linken Zeiger auf Null // linken Zeiger auf Null
BiNode * pRightNode = pMiddle->Right(); BiNode * pRightNode = pMiddle->Right();
if (pRightNode) if (pRightNode)
pRightNode->pLeft = (BiNode *)0; pRightNode->pLeft = nullptr;
pMiddle->pLeft = ChangeDLListBTree( pList ); pMiddle->pLeft = ChangeDLListBTree( pList );
pMiddle->pRight = ChangeDLListBTree( pRightNode ); pMiddle->pRight = ChangeDLListBTree( pRightNode );
...@@ -198,7 +198,7 @@ NameNode* NameNode::SearchParent( const NameNode * pSearch ) const ...@@ -198,7 +198,7 @@ NameNode* NameNode::SearchParent( const NameNode * pSearch ) const
return Right()->SearchParent( pSearch ); return Right()->SearchParent( pSearch );
} }
} }
return (NameNode *)NULL; return nullptr;
} }
// search for a node. // search for a node.
...@@ -327,7 +327,7 @@ void NameNode::SubOrderTree( NameNode * pOrderNode ) ...@@ -327,7 +327,7 @@ void NameNode::SubOrderTree( NameNode * pOrderNode )
IdNode * IdNode::Search( sal_uInt32 nTypeName ) const IdNode * IdNode::Search( sal_uInt32 nTypeName ) const
{ {
return static_cast<IdNode *>(NameNode::Search( (const void *)&nTypeName )); return static_cast<IdNode *>(NameNode::Search( static_cast<const void *>(&nTypeName) ));
} }
COMPARE IdNode::Compare( const NameNode * pSearch ) const COMPARE IdNode::Compare( const NameNode * pSearch ) const
...@@ -358,7 +358,7 @@ sal_uInt32 IdNode::GetId() const ...@@ -358,7 +358,7 @@ sal_uInt32 IdNode::GetId() const
StringNode * StringNode::Search( const char * pSearch ) const StringNode * StringNode::Search( const char * pSearch ) const
{ {
return static_cast<StringNode *>(NameNode::Search( (const void *)pSearch )); return static_cast<StringNode *>(NameNode::Search( static_cast<const void *>(pSearch) ));
} }
COMPARE StringNode::Compare( const NameNode * pSearch ) const COMPARE StringNode::Compare( const NameNode * pSearch ) const
......
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