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

loplugin:cstylecast

Change-Id: I7fd4ec85eac0693ae6a61ba0b854dd6091bdc6ef
üst ec0e0809
...@@ -75,7 +75,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod( ...@@ -75,7 +75,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
data.nFPR = nFPR; data.nFPR = nFPR;
// Get pointer to method // Get pointer to method
sal_uInt64 pMethod = *((sal_uInt64 *)pThis); sal_uInt64 pMethod = *static_cast<sal_uInt64 *>(pThis);
pMethod += 8 * nVtableIndex; pMethod += 8 * nVtableIndex;
data.pMethod = *reinterpret_cast<sal_uInt64 *>(pMethod); data.pMethod = *reinterpret_cast<sal_uInt64 *>(pMethod);
...@@ -84,7 +84,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod( ...@@ -84,7 +84,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
{ {
// 16-bytes aligned // 16-bytes aligned
sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16; sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16;
sal_uInt64 *pCallStack = (sal_uInt64 *) __builtin_alloca( nStackBytes ); sal_uInt64 *pCallStack = static_cast<sal_uInt64 *>(__builtin_alloca( nStackBytes ));
std::memcpy( pCallStack, pStack, nStackBytes ); std::memcpy( pCallStack, pStack, nStackBytes );
} }
......
...@@ -94,12 +94,12 @@ static typelib_TypeClass cpp2uno_call( ...@@ -94,12 +94,12 @@ static typelib_TypeClass cpp2uno_call(
// stack space // stack space
// parameters // parameters
void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); void ** pUnoArgs = static_cast<void **>(alloca( 4 * sizeof(void *) * nParams ));
void ** pCppArgs = pUnoArgs + nParams; void ** pCppArgs = pUnoArgs + nParams;
// indices of values this have to be converted (interface conversion cpp<=>uno) // indices of values this have to be converted (interface conversion cpp<=>uno)
sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams)); sal_Int32 * pTempIndices = reinterpret_cast<sal_Int32 *>(pUnoArgs + (2 * nParams));
// type descriptions for reconversions // type descriptions for reconversions
typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); typelib_TypeDescription ** ppTempParamTypeDescr = reinterpret_cast<typelib_TypeDescription **>(pUnoArgs + (3 * nParams));
sal_Int32 nTempIndices = 0; sal_Int32 nTempIndices = 0;
......
...@@ -193,7 +193,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) ...@@ -193,7 +193,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
buf.append( 'E' ); buf.append( 'E' );
OString symName( buf.makeStringAndClear() ); OString symName( buf.makeStringAndClear() );
rtti = (std::type_info *)dlsym( m_hApp, symName.getStr() ); rtti = static_cast<std::type_info *>(dlsym( m_hApp, symName.getStr() ));
if (rtti) if (rtti)
{ {
...@@ -254,7 +254,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) ...@@ -254,7 +254,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
static void deleteException( void * pExc ) static void deleteException( void * pExc )
{ {
__cxa_exception const * header = ((__cxa_exception const *)pExc - 1); __cxa_exception const * header = static_cast<__cxa_exception const *>(pExc) - 1;
typelib_TypeDescription * pTD = 0; typelib_TypeDescription * pTD = 0;
OUString unoName( toUNOname( header->exceptionType->name() ) ); OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pTD, unoName.pData ); ::typelib_typedescription_getByName( &pTD, unoName.pData );
......
...@@ -100,7 +100,7 @@ static void cpp_call( ...@@ -100,7 +100,7 @@ static void cpp_call(
{ {
// Maxium space for [complex ret ptr], values | ptr ... // Maxium space for [complex ret ptr], values | ptr ...
// (but will be used less - some of the values will be in pGPR and pFPR) // (but will be used less - some of the values will be in pGPR and pFPR)
sal_uInt64 *pStack = (sal_uInt64 *)__builtin_alloca( (nParams + 3) * sizeof(sal_uInt64) ); sal_uInt64 *pStack = static_cast<sal_uInt64 *>(__builtin_alloca( (nParams + 3) * sizeof(sal_uInt64) ));
sal_uInt64 *pStackStart = pStack; sal_uInt64 *pStackStart = pStack;
sal_uInt64 pGPR[x86_64::MAX_GPR_REGS]; sal_uInt64 pGPR[x86_64::MAX_GPR_REGS];
...@@ -138,11 +138,11 @@ static void cpp_call( ...@@ -138,11 +138,11 @@ static void cpp_call(
INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack ); INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack );
// Args // Args
void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); void ** pCppArgs = static_cast<void **>(alloca( 3 * sizeof(void *) * nParams ));
// Indices of values this have to be converted (interface conversion cpp<=>uno) // Indices of values this have to be converted (interface conversion cpp<=>uno)
sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams); sal_Int32 * pTempIndices = reinterpret_cast<sal_Int32 *>(pCppArgs + nParams);
// Type descriptions for reconversions // Type descriptions for reconversions
typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); typelib_TypeDescription ** ppTempParamTypeDescr = reinterpret_cast<typelib_TypeDescription **>(pCppArgs + (2 * nParams));
sal_Int32 nTempIndices = 0; sal_Int32 nTempIndices = 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