diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-13 18:05:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-13 18:21:35 +0100 |
commit | 4a8d478ff217fd1805bb739efdea985f3d947bae (patch) | |
tree | 5254cbaa1d3d6b769a6f155da43d5ff73e28c941 | |
parent | e1fee5ae6e762994737ec80d2fb267d8b956339a (diff) |
loplugin:cstylecast (gcc3_linux_intel)
Change-Id: I89c3c2c63c1c1b7478d94c713341db1cd24f0ab8
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx | 24 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/except.cxx | 4 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx | 24 |
3 files changed, 26 insertions, 26 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx index c3a3650bf667..39455a96abcc 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx @@ -63,7 +63,7 @@ void cpp2uno_call( } else // complex return via ptr (pCppReturn) { - pCppReturn = *(void **)pCppStack; + pCppReturn = *reinterpret_cast<void **>(pCppStack); pCppStack += sizeof(void *); pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( @@ -114,7 +114,7 @@ void cpp2uno_call( } else // ptr to complex value | ref { - pCppArgs[nPos] = *(void **)pCppStack; + pCppArgs[nPos] = *reinterpret_cast<void **>(pCppStack); if (! rParam.bIn) // is pure out { @@ -129,7 +129,7 @@ void cpp2uno_call( pParamTypeDescr )) { uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), - *(void **)pCppStack, pParamTypeDescr, + *reinterpret_cast<void **>(pCppStack), pParamTypeDescr, pThis->getBridge()->getCpp2Uno() ); pTempIndices[nTempIndices] = nPos; // has to be reconverted // will be released at reconversion @@ -137,7 +137,7 @@ void cpp2uno_call( } else // direct way { - pUnoArgs[nPos] = *(void **)pCppStack; + pUnoArgs[nPos] = *reinterpret_cast<void **>(pCppStack); // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } @@ -266,7 +266,7 @@ extern "C" void cpp_vtable_call( // is GET method cpp2uno_call( pCppI, aMemberDescr.get(), - ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef, + reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(aMemberDescr.get())->pAttributeTypeRef, 0, 0, // no params pCallStack, pReturnValue ); } @@ -275,7 +275,7 @@ extern "C" void cpp_vtable_call( // is SET method typelib_MethodParameter aParam; aParam.pTypeRef = - ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; + reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; @@ -307,8 +307,8 @@ extern "C" void cpp_vtable_call( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, - (typelib_InterfaceTypeDescription *)pTD ); + reinterpret_cast<void **>(&pInterface), pCppI->getOid().pData, + reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) ); if (pInterface) { @@ -326,9 +326,9 @@ extern "C" void cpp_vtable_call( default: cpp2uno_call( pCppI, aMemberDescr.get(), - ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef, - ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams, - ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams, + reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->pReturnTypeRef, + reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->nParams, + reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->pParams, pCallStack, pReturnValue ); } break; @@ -428,7 +428,7 @@ unsigned char * codeSnippet( // jmp privateSnippetExecutor: *p++ = 0xE9; *reinterpret_cast< sal_Int32 * >(p) - = ((unsigned char *) exec) - p - sizeof (sal_Int32) - writetoexecdiff; + = reinterpret_cast<unsigned char *>(exec) - p - sizeof (sal_Int32) - writetoexecdiff; p += sizeof (sal_Int32); assert(p - code <= codeSnippetSize); return code + codeSnippetSize; diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx index faabee730b2b..9ccdd35364e4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx @@ -118,7 +118,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) { type_info * rtti; - OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; + OUString const & unoName = OUString::unacquired(&pTypeDescr->aBase.pTypeName); MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); @@ -257,7 +257,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) #endif } } - rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); + rtti = (type_info *)s_rtti->getRTTI( reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr) ); TYPELIB_DANGER_RELEASE( pTypeDescr ); assert(rtti && "### no rtti for throwing exception!"); if (! rtti) diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index ed05bd043ab0..8e714c1922c3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -67,7 +67,7 @@ static void cpp_call( else { // complex return via ptr - pCppReturn = *(void **)pCppStack + pCppReturn = *reinterpret_cast<void **>(pCppStack) = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -78,7 +78,7 @@ static void cpp_call( // push this void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI()) + aVtableSlot.offset; - *(void**)pCppStack = pAdjustedThisPtr; + *reinterpret_cast<void **>(pCppStack) = pAdjustedThisPtr; pCppStack += sizeof( void* ); // stack space @@ -123,7 +123,7 @@ static void cpp_call( { // cpp out is constructed mem, uno out is not! uno_constructData( - *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + *reinterpret_cast<void **>(pCppStack) = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pParamTypeDescr ); pTempIndices[nTempIndices] = nPos; // default constructed for cpp call // will be released at reconversion @@ -134,7 +134,7 @@ static void cpp_call( pParamTypeDescr )) { uno_copyAndConvertData( - *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + *reinterpret_cast<void **>(pCppStack) = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); @@ -144,7 +144,7 @@ static void cpp_call( } else // direct way { - *(void **)pCppStack = pCppArgs[nPos] = pUnoArgs[nPos]; + *reinterpret_cast<void **>(pCppStack) = pCppArgs[nPos] = pUnoArgs[nPos]; // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } @@ -158,7 +158,7 @@ static void cpp_call( CPPU_CURRENT_NAMESPACE::callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, pCppReturn, pReturnTypeDescr, bSimpleReturn, - (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); + reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occurred... *ppUnoExc = 0; @@ -276,7 +276,7 @@ void unoInterfaceProxyDispatch( // dependent dispatch cpp_call( pThis, aVtableSlot, - ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, + reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>(pMemberDescr)->pAttributeTypeRef, 0, 0, // no params pReturn, pArgs, ppException ); } @@ -285,7 +285,7 @@ void unoInterfaceProxyDispatch( // is SET typelib_MethodParameter aParam; aParam.pTypeRef = - ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; + reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>(pMemberDescr)->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; @@ -334,7 +334,7 @@ void unoInterfaceProxyDispatch( uno_Interface * pInterface = 0; (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), - (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); + reinterpret_cast<void **>(&pInterface), pThis->oid.pData, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) ); if (pInterface) { @@ -353,9 +353,9 @@ void unoInterfaceProxyDispatch( // dependent dispatch cpp_call( pThis, aVtableSlot, - ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, - ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, - ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, + reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->pReturnTypeRef, + reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->nParams, + reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->pParams, pReturn, pArgs, ppException ); } break; |