diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 18:58:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:17 +0100 |
commit | 6a6991ed2ea628da2a7bf43a07963803445e85a9 (patch) | |
tree | 4bd7b89eaf4c68d05a923a56cab987fb5880a6dc /bridges/source/cpp_uno | |
parent | c3fb36ed26a6c8dce0a8026ef8b75190955d2443 (diff) |
Clean up C-style casts from pointers to void
Change-Id: I5c0372bce2564e58c78daf544cfcb106387c6894
Diffstat (limited to 'bridges/source/cpp_uno')
5 files changed, 11 insertions, 11 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx index 295596d154de..81547d7ff7ae 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx @@ -66,7 +66,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod( data.pFPR = pFPR; // Get pointer to method - sal_uInt64 pMethod = *((sal_uInt64 *)pThis); + sal_uInt64 pMethod = *static_cast<sal_uInt64 *>(pThis); pMethod += 8 * nVtableIndex; data.pMethod = *reinterpret_cast<sal_uInt64 *>(pMethod); @@ -76,7 +76,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod( { // 16-bytes aligned sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16; - pCallStack = (sal_uInt64 *) __builtin_alloca( nStackBytes ); + pCallStack = static_cast<sal_uInt64 *>(__builtin_alloca( nStackBytes )); std::memcpy( pCallStack, pStack, nStackBytes ); } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 3903cdadfd4d..3da87f2b91ab 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -95,12 +95,12 @@ static typelib_TypeClass cpp2uno_call( // stack space // parameters - void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); + void ** pUnoArgs = static_cast<void **>(alloca( 4 * sizeof(void *) * nParams )); void ** pCppArgs = pUnoArgs + nParams; // 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 - typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); + typelib_TypeDescription ** ppTempParamTypeDescr = reinterpret_cast<typelib_TypeDescription **>(pUnoArgs + (3 * nParams)); sal_Int32 nTempIndices = 0; diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index fc439a96c951..338fcb9caf98 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -81,7 +81,7 @@ static OUString toUNOname( char const * p ) extern "C" { static void _GLIBCXX_CDTOR_CALLABI 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; OUString unoName( toUNOname( header->exceptionType->name() ) ); ::typelib_typedescription_getByName( &pTD, unoName.pData ); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx index df6c4db4d552..08cd765639c9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx @@ -97,7 +97,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) #if defined(FREEBSD) && __FreeBSD_version < 702104 /* #i22253# */ rtti = (std::type_info *)dlsym( RTLD_DEFAULT, symName.getStr() ); #else - rtti = (std::type_info *)dlsym( m_hApp, symName.getStr() ); + rtti = static_cast<std::type_info *>(dlsym( m_hApp, symName.getStr() )); #endif if (rtti) diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index fb286db7943f..205d776f3809 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -100,7 +100,7 @@ static void cpp_call( { // Maxium space for [complex ret ptr], values | ptr ... // (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 pGPR[x86_64::MAX_GPR_REGS]; @@ -138,11 +138,11 @@ static void cpp_call( INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack ); // 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) - sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams); + sal_Int32 * pTempIndices = reinterpret_cast<sal_Int32 *>(pCppArgs + nParams); // 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; |