[Libreoffice-commits] core.git: bridges/source

Stephan Bergmann sbergman at redhat.com
Sun Mar 29 05:48:34 PDT 2015


 bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx |    4 ++--
 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx           |    6 +++---
 bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx            |    4 ++--
 bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx           |    8 ++++----
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 66f0c17d244cdc8d5a96ca3fe97aef68b45ad0cc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 29 14:48:05 2015 +0200

    loplugin:cstylecast
    
    Change-Id: I7fd4ec85eac0693ae6a61ba0b854dd6091bdc6ef

diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
index 7b49e23..86a81dc 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
@@ -75,7 +75,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
     data.nFPR = nFPR;
 
     // 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);
 
@@ -84,7 +84,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
     {
         // 16-bytes aligned
         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 );
     }
 
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx
index 259aff7..ae877ac 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx
@@ -94,12 +94,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_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
index 7132c46..34ab8fe 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx
@@ -193,7 +193,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
         buf.append( 'E' );
 
         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)
         {
@@ -254,7 +254,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
 
 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;
     OUString unoName( toUNOname( header->exceptionType->name() ) );
     ::typelib_typedescription_getByName( &pTD, unoName.pData );
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx
index a90d030..1e3e118 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_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;
 


More information about the Libreoffice-commits mailing list