Kaydet (Commit) 93b4ec39 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast, loplugin:redundantcast

Change-Id: If5d839b05c1babecc84b76d2bcdf47009d0f713c
üst d1b27a1d
......@@ -45,7 +45,7 @@ void cpp2uno_call(
void * pReturnValue )
{
// pCallStack: ret, [return ptr], this, params
char * pCppStack = (char *)(pCallStack +1);
char * pCppStack = reinterpret_cast<char *>(pCallStack +1);
// return
typelib_TypeDescription * pReturnTypeDescr = 0;
......@@ -78,12 +78,12 @@ void cpp2uno_call(
// stack space
static_assert(sizeof(void *) == sizeof(sal_Int32), "### unexpected size!");
// 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;
......@@ -248,7 +248,7 @@ extern "C" void cpp_vtable_call(
("illegal " + OUString::unacquired(&pTypeDescr->aBase.pTypeName)
+ " vtable index " + OUString::number(nFunctionIndex) + "/"
+ OUString::number(pTypeDescr->nMapFunctionIndexToMemberIndex)),
(XInterface *)pThis);
static_cast<XInterface *>(pThis));
}
// determine called method
......@@ -301,7 +301,7 @@ extern "C" void cpp_vtable_call(
case 0: // queryInterface() opt
{
typelib_TypeDescription * pTD = 0;
TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pCallStack[3] )->getTypeLibType() );
TYPELIB_DANGER_GET( &pTD, static_cast< Type * >( pCallStack[3] )->getTypeLibType() );
if (pTD)
{
XInterface * pInterface = 0;
......@@ -313,7 +313,7 @@ extern "C" void cpp_vtable_call(
if (pInterface)
{
::uno_any_construct(
reinterpret_cast< uno_Any * >( pCallStack[1] ),
static_cast< uno_Any * >( pCallStack[1] ),
&pInterface, pTD, cpp_acquire );
pInterface->release();
TYPELIB_DANGER_RELEASE( pTD );
......@@ -335,7 +335,7 @@ extern "C" void cpp_vtable_call(
}
default:
{
throw RuntimeException( "no member description found!", (XInterface *)pThis );
throw RuntimeException( "no member description found!", static_cast<XInterface *>(pThis) );
}
}
}
......
......@@ -142,7 +142,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
#if defined(FREEBSD) && __FreeBSD_version < 702104 /* #i22253# */
rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
#else
rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
rtti = static_cast<type_info *>(dlsym( m_hApp, symName.getStr() ));
#endif
if (rtti)
......@@ -200,7 +200,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
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 );
......
......@@ -46,7 +46,7 @@ static void cpp_call(
{
// max space for: [complex ret ptr], values|ptr ...
char * pCppStack =
(char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) );
static_cast<char *>(alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ));
char * pCppStackStart = pCppStack;
// return
......@@ -84,11 +84,11 @@ static void cpp_call(
// stack space
static_assert(sizeof(void *) == sizeof(sal_Int32), "### unexpected size!");
// 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;
......@@ -328,7 +328,7 @@ void unoInterfaceProxyDispatch(
case 0: // queryInterface() opt
{
typelib_TypeDescription * pTD = 0;
TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
TYPELIB_DANGER_GET( &pTD, static_cast< Type * >( pArgs[0] )->getTypeLibType() );
if (pTD)
{
uno_Interface * pInterface = 0;
......@@ -339,7 +339,7 @@ void unoInterfaceProxyDispatch(
if (pInterface)
{
::uno_any_construct(
reinterpret_cast< uno_Any * >( pReturn ),
static_cast< uno_Any * >( pReturn ),
&pInterface, pTD, 0 );
(*pInterface->release)( pInterface );
TYPELIB_DANGER_RELEASE( pTD );
......
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