diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-17 18:13:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:45 +0100 |
commit | 4130c64355e08efb84ef1f7e304c01849c2529c6 (patch) | |
tree | 145939d467a78d610302c958d70754673dacab8c /basic | |
parent | 931ec049e0a0cc89cf13412032fbcf5dbd1e49f4 (diff) |
Some more loplugin:cstylecast: basic
Change-Id: Ib22bc7408d333a7080fa44c9c3ac9535ccf00752
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/image.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 6 | ||||
-rw-r--r-- | basic/source/comp/buffer.cxx | 4 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 12 | ||||
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 2 |
6 files changed, 24 insertions, 24 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index ea2e7335f622..71930a3b23e5 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -182,9 +182,9 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) nLegacyCodeSize = (sal_uInt16) nCodeSize; pLegacyPCode = pCode; - PCodeBuffConvertor< sal_uInt16, sal_uInt32 > aLegacyToNew( (sal_uInt8*)pLegacyPCode, nLegacyCodeSize ); + PCodeBuffConvertor< sal_uInt16, sal_uInt32 > aLegacyToNew( reinterpret_cast<sal_uInt8*>(pLegacyPCode), nLegacyCodeSize ); aLegacyToNew.convert(); - pCode = (char*)aLegacyToNew.GetBuffer(); + pCode = reinterpret_cast<char*>(aLegacyToNew.GetBuffer()); nCodeSize = aLegacyToNew.GetSize(); // we don't release the legacy buffer // right now, thats because the module @@ -320,9 +320,9 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) if ( bLegacy ) { ReleaseLegacyBuffer(); // release any previously held buffer - PCodeBuffConvertor< sal_uInt32, sal_uInt16 > aNewToLegacy( (sal_uInt8*)pCode, nCodeSize ); + PCodeBuffConvertor< sal_uInt32, sal_uInt16 > aNewToLegacy( reinterpret_cast<sal_uInt8*>(pCode), nCodeSize ); aNewToLegacy.convert(); - pLegacyPCode = (char*)aNewToLegacy.GetBuffer(); + pLegacyPCode = reinterpret_cast<char*>(aNewToLegacy.GetBuffer()); nLegacyCodeSize = aNewToLegacy.GetSize(); r.Write( pLegacyPCode, nLegacyCodeSize ); } @@ -512,12 +512,12 @@ const SbxObject* SbiImage::FindType (const OUString& aTypeName) const sal_uInt16 SbiImage::CalcLegacyOffset( sal_Int32 nOffset ) { - return SbiCodeGen::calcLegacyOffSet( (sal_uInt8*)pCode, nOffset ) ; + return SbiCodeGen::calcLegacyOffSet( reinterpret_cast<sal_uInt8*>(pCode), nOffset ) ; } sal_uInt32 SbiImage::CalcNewOffset( sal_Int16 nOffset ) { - return SbiCodeGen::calcNewOffSet( (sal_uInt8*)pLegacyPCode, nOffset ) ; + return SbiCodeGen::calcNewOffSet( reinterpret_cast<sal_uInt8*>(pLegacyPCode), nOffset ) ; } void SbiImage::ReleaseLegacyBuffer() diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index e0309f4a0c25..76ff71356b3c 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -550,7 +550,7 @@ static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); typelib_TypeDescription * pTD = 0; aType.getDescription( &pTD ); - Type aElementType( ((typelib_IndirectTypeDescription *)pTD)->pType ); + Type aElementType( reinterpret_cast<typelib_IndirectTypeDescription *>(pTD)->pType ); ::typelib_typedescription_release( pTD ); sal_Int32 nLen = xIdlArray->getLen( aValue ); @@ -770,7 +770,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) typelib_TypeDescription * pTD = 0; aType.getDescription( &pTD ); OSL_ASSERT( pTD && pTD->eTypeClass == typelib_TypeClass_SEQUENCE ); - Type aElementType( ((typelib_IndirectTypeDescription *)pTD)->pType ); + Type aElementType( reinterpret_cast<typelib_IndirectTypeDescription *>(pTD)->pType ); ::typelib_typedescription_release( pTD ); // build an Array in Basic @@ -1345,7 +1345,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper typelib_TypeDescription * pSeqTD = 0; typelib_typedescription_getByName( &pSeqTD, aClassName.pData ); OSL_ASSERT( pSeqTD ); - Type aElemType( ((typelib_IndirectTypeDescription *)pSeqTD)->pType ); + Type aElemType( reinterpret_cast<typelib_IndirectTypeDescription *>(pSeqTD)->pType ); // convert all array member and register them sal_Int32 nIdx = nLower; @@ -1388,7 +1388,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper OSL_ASSERT( pSeqTD ); if( pSeqTD->eTypeClass == typelib_TypeClass_SEQUENCE ) { - aCurType = Type( ((typelib_IndirectTypeDescription *)pSeqTD)->pType ); + aCurType = Type( reinterpret_cast<typelib_IndirectTypeDescription *>(pSeqTD)->pType ); nSeqLevel++; } else @@ -4843,10 +4843,10 @@ void SbUnoStructRefObject::initMemberCache() sal_Int32 nAll = 0; typelib_TypeDescription * pTD = 0; maMemberInfo.getType().getDescription(&pTD); - typelib_CompoundTypeDescription * pCompTypeDescr = (typelib_CompoundTypeDescription *)pTD; + typelib_CompoundTypeDescription * pCompTypeDescr = reinterpret_cast<typelib_CompoundTypeDescription *>(pTD); for ( ; pCompTypeDescr; pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription ) nAll += pCompTypeDescr->nMembers; - for ( pCompTypeDescr = (typelib_CompoundTypeDescription *)pTD; pCompTypeDescr; + for ( pCompTypeDescr = reinterpret_cast<typelib_CompoundTypeDescription *>(pTD); pCompTypeDescr; pCompTypeDescr = pCompTypeDescr->pBaseTypeDescription ) { typelib_TypeDescriptionReference ** ppTypeRefs = pCompTypeDescr->ppTypeRefs; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index a9981240e034..b3b7fd051703 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1501,7 +1501,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, sal_uInt16& nCol, bool bFollowJumps, const SbiImage* pImg ) const { - sal_uInt32 nPC = (sal_uInt32) ( p - (const sal_uInt8*) pImage->GetCode() ); + sal_uInt32 nPC = (sal_uInt32) ( p - reinterpret_cast<const sal_uInt8*>(pImage->GetCode()) ); while( nPC < pImage->GetCodeSize() ) { SbiOpcode eOp = (SbiOpcode ) ( *p++ ); @@ -1511,7 +1511,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, SAL_WARN_IF( !pImg, "basic", "FindNextStmnt: pImg==NULL with FollowJumps option" ); sal_uInt32 nOp1 = *p++; nOp1 |= *p++ << 8; nOp1 |= *p++ << 16; nOp1 |= *p++ << 24; - p = (const sal_uInt8*) pImg->GetCode() + nOp1; + p = reinterpret_cast<const sal_uInt8*>(pImg->GetCode()) + nOp1; } else if( eOp >= SbOP1_START && eOp <= SbOP1_END ) p += 4, nPC += 4; @@ -1542,7 +1542,7 @@ bool SbModule::IsBreakable( sal_uInt16 nLine ) const { if( !pImage ) return false; - const sal_uInt8* p = (const sal_uInt8* ) pImage->GetCode(); + const sal_uInt8* p = reinterpret_cast<const sal_uInt8*>(pImage->GetCode()); sal_uInt16 nl, nc; while( ( p = FindNextStmnt( p, nl, nc ) ) != NULL ) if( nl == nLine ) diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx index fa09ef9c144b..bb61087ee731 100644 --- a/basic/source/comp/buffer.cxx +++ b/basic/source/comp/buffer.cxx @@ -112,7 +112,7 @@ void SbiBuffer::Patch( sal_uInt32 off, sal_uInt32 val ) { sal_uInt16 val1 = static_cast<sal_uInt16>( val & 0xFFFF ); sal_uInt16 val2 = static_cast<sal_uInt16>( val >> 16 ); - sal_uInt8* p = (sal_uInt8*) pBuf + off; + sal_uInt8* p = reinterpret_cast<sal_uInt8*>(pBuf) + off; *p++ = (char) ( val1 & 0xFF ); *p++ = (char) ( val1 >> 8 ); *p++ = (char) ( val2 & 0xFF ); @@ -134,7 +134,7 @@ void SbiBuffer::Chain( sal_uInt32 off ) sal_uInt32 val2 = (nOff >> 16); do { - ip = (sal_uInt8*) pBuf + i; + ip = reinterpret_cast<sal_uInt8*>(pBuf) + i; sal_uInt8* pTmp = ip; i = *pTmp++; i |= *pTmp++ << 8; i |= *pTmp++ << 16; i |= *pTmp++ << 24; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 1595d5cd313e..0dea79052318 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -584,7 +584,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart ) pRestart = NULL; pNext = NULL; pCode = - pStmnt = (const sal_uInt8* ) pImg->GetCode() + nStart; + pStmnt = reinterpret_cast<const sal_uInt8*>(pImg->GetCode()) + nStart; bRun = bError = true; bInError = false; @@ -1184,7 +1184,7 @@ void SbiRuntime::PushForEach() if( (pArray = PTR_CAST(SbxDimArray,pObj)) != NULL ) { p->eForType = FOR_EACH_ARRAY; - p->refEnd = (SbxVariable*)pArray; + p->refEnd = reinterpret_cast<SbxVariable*>(pArray); short nDims = pArray->GetDims(); p->pArrayLowerBounds = new sal_Int32[nDims]; @@ -2953,7 +2953,7 @@ void SbiRuntime::StepJUMP( sal_uInt32 nOp1 ) if( nOp1 >= pImg->GetCodeSize() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); #endif - pCode = (const sal_uInt8*) pImg->GetCode() + nOp1; + pCode = reinterpret_cast<const sal_uInt8*>(pImg->GetCode()) + nOp1; } // evaluate TOS, conditional jump (+target) @@ -2995,7 +2995,7 @@ void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 ) } if( n < 1 || static_cast<sal_uInt32>(n) > nOp1 ) n = static_cast<sal_Int16>( nOp1 + 1 ); - nOp1 = (sal_uInt32) ( (const char*) pCode - pImg->GetCode() ) + 5 * --n; + nOp1 = (sal_uInt32) ( reinterpret_cast<const char*>(pCode) - pImg->GetCode() ) + 5 * --n; StepJUMP( nOp1 ); } @@ -3006,7 +3006,7 @@ void SbiRuntime::StepGOSUB( sal_uInt32 nOp1 ) PushGosub( pCode ); if( nOp1 >= pImg->GetCodeSize() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); - pCode = (const sal_uInt8*) pImg->GetCode() + nOp1; + pCode = reinterpret_cast<const sal_uInt8*>(pImg->GetCode()) + nOp1; } // UP-return (+0 or target) @@ -3047,7 +3047,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 ) } else { - SbxDimArray* pArray = (SbxDimArray*)(SbxVariable*)p->refEnd; + SbxDimArray* pArray = reinterpret_cast<SbxDimArray*>((SbxVariable*)p->refEnd); short nDims = pArray->GetDims(); // Empty array? diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 4754c98785f1..0d77d4d9a6b8 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -268,7 +268,7 @@ void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx ) return; } SbxVarEntry* p = new SbxVarEntry; - *((SbxVariableRef*) p) = pVar; + p->mpVar = pVar; size_t nSize = mpVarEntries->size(); if( nIdx > nSize ) { |