Kaydet (Commit) 26655d09 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Reduce to static_cast any reinterpret_cast from void pointers

Change-Id: I19b86fba87df57c4c65c658d051b664c527214eb
üst 14a4390b
......@@ -306,7 +306,7 @@ void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_
n = classify_argument( pTypeRef, classes, 0 );
sal_uInt64 *pStructAlign = reinterpret_cast<sal_uInt64 *>( pStruct );
sal_uInt64 *pStructAlign = static_cast<sal_uInt64 *>( pStruct );
for ( n--; n >= 0; n-- )
switch ( classes[n] )
{
......
......@@ -125,25 +125,25 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
{
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
*reinterpret_cast<sal_uInt64 *>( pRegisterReturn ) = data.rax;
*static_cast<sal_uInt64 *>( pRegisterReturn ) = data.rax;
break;
case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG:
case typelib_TypeClass_ENUM:
*reinterpret_cast<sal_uInt32 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt32*>( &data.rax );
*static_cast<sal_uInt32 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt32*>( &data.rax );
break;
case typelib_TypeClass_CHAR:
case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT:
*reinterpret_cast<sal_uInt16 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt16*>( &data.rax );
*static_cast<sal_uInt16 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt16*>( &data.rax );
break;
case typelib_TypeClass_BOOLEAN:
case typelib_TypeClass_BYTE:
*reinterpret_cast<sal_uInt8 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt8*>( &data.rax );
*static_cast<sal_uInt8 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt8*>( &data.rax );
break;
case typelib_TypeClass_FLOAT:
case typelib_TypeClass_DOUBLE:
*reinterpret_cast<double *>( pRegisterReturn ) = data.xmm0;
*static_cast<double *>( pRegisterReturn ) = data.xmm0;
break;
default:
{
......
......@@ -339,7 +339,7 @@ typelib_TypeClass cpp_vtable_call(
case 0: // queryInterface() opt
{
typelib_TypeDescription * pTD = 0;
TYPELIB_DANGER_GET( &pTD, reinterpret_cast<Type *>( gpreg[2] )->getTypeLibType() );
TYPELIB_DANGER_GET( &pTD, static_cast<Type *>( gpreg[2] )->getTypeLibType() );
if ( pTD )
{
XInterface * pInterface = 0;
......@@ -351,7 +351,7 @@ typelib_TypeClass cpp_vtable_call(
if ( pInterface )
{
::uno_any_construct( reinterpret_cast<uno_Any *>( gpreg[0] ),
::uno_any_construct( static_cast<uno_Any *>( gpreg[0] ),
&pInterface, pTD, cpp_acquire );
pInterface->release();
......
......@@ -412,7 +412,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;
......@@ -423,7 +423,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 );
......
......@@ -56,8 +56,8 @@ void cpp2unoMapping(
assert(ppUnoI && pTypeDescr);
if (*ppUnoI)
{
(*reinterpret_cast< uno_Interface * >( *ppUnoI )->release)(
reinterpret_cast< uno_Interface * >( *ppUnoI ) );
(*static_cast< uno_Interface * >( *ppUnoI )->release)(
static_cast< uno_Interface * >( *ppUnoI ) );
*ppUnoI = 0;
}
if (pCppI)
......
......@@ -100,7 +100,7 @@ static void s_stub_computeObjectIdentifier(va_list * pParam)
{
::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > xHome(
reinterpret_cast< ::com::sun::star::uno::XInterface * >(
static_cast< ::com::sun::star::uno::XInterface * >(
pInterface ),
::com::sun::star::uno::UNO_QUERY );
assert(xHome.is() && "### query to XInterface failed!");
......@@ -142,7 +142,7 @@ static void s_stub_acquireInterface(va_list * pParam)
/*uno_ExtEnvironment * pExtEnv = */va_arg(*pParam, uno_ExtEnvironment *);
void * pCppI = va_arg(*pParam, void *);
reinterpret_cast< ::com::sun::star::uno::XInterface * >( pCppI )->acquire();
static_cast< ::com::sun::star::uno::XInterface * >( pCppI )->acquire();
}
static void SAL_CALL acquireInterface( uno_ExtEnvironment * pExtEnv, void * pCppI )
......@@ -155,7 +155,7 @@ static void s_stub_releaseInterface(va_list * pParam)
/*uno_ExtEnvironment * pExtEnv = */va_arg(*pParam, uno_ExtEnvironment *);
void * pCppI = va_arg(*pParam, void *);
reinterpret_cast< ::com::sun::star::uno::XInterface * >( pCppI )->release();
static_cast< ::com::sun::star::uno::XInterface * >( pCppI )->release();
}
static void SAL_CALL releaseInterface( uno_ExtEnvironment * pExtEnv, void * pCppI )
......
......@@ -32,7 +32,7 @@ void freeUnoInterfaceProxy(uno_ExtEnvironment * pEnv, void * pProxy)
{
UnoInterfaceProxy * pThis =
static_cast< UnoInterfaceProxy * >(
reinterpret_cast< uno_Interface * >( pProxy ) );
static_cast< uno_Interface * >( pProxy ) );
if (pEnv != pThis->pBridge->getUnoEnv()) {
assert(false);
}
......
......@@ -94,14 +94,14 @@ void Bridge::handle_uno_exc( JNI_context const & jni, uno_Any * uno_exc ) const
{
#if OSL_DEBUG_LEVEL > 0
// append java stack trace to Message member
reinterpret_cast< ::com::sun::star::uno::Exception * >(
static_cast< ::com::sun::star::uno::Exception * >(
uno_exc->pData )->Message += jni.get_stack_trace();
#endif
SAL_INFO(
"bridges",
"exception occurred java->uno: ["
<< OUString::unacquired(&uno_exc->pType->pTypeName) << "] "
<< reinterpret_cast<css::uno::Exception const *>(
<< static_cast<css::uno::Exception const *>(
uno_exc->pData)->Message);
// signal exception
jvalue java_exc;
......
......@@ -114,7 +114,7 @@ void Bridge::handle_java_exc(
SAL_INFO(
"bridges",
"exception occurred uno->java: [" << exc_name << "] "
<< (reinterpret_cast<css::uno::Exception const *>(uno_exc->pData)
<< (static_cast<css::uno::Exception const *>(uno_exc->pData)
->Message));
}
......@@ -520,7 +520,7 @@ extern "C"
void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy )
SAL_THROW_EXTERN_C()
{
UNO_proxy * that = reinterpret_cast< UNO_proxy * >( proxy );
UNO_proxy * that = static_cast< UNO_proxy * >( proxy );
Bridge const * bridge = that->m_bridge;
assert(env == bridge->m_uno_env); (void) env;
......@@ -655,7 +655,7 @@ void SAL_CALL UNO_proxy_dispatch(
case 0: // queryInterface()
{
TypeDescr demanded_td(
*reinterpret_cast< typelib_TypeDescriptionReference ** >(
*static_cast< typelib_TypeDescriptionReference ** >(
uno_args[ 0 ] ) );
if (typelib_TypeClass_INTERFACE !=
demanded_td.get()->eTypeClass)
......@@ -733,7 +733,7 @@ void SAL_CALL UNO_proxy_dispatch(
else // object does not support demanded interface
{
uno_any_construct(
reinterpret_cast< uno_Any * >( uno_ret ),
static_cast< uno_Any * >( uno_ret ),
0, 0, 0 );
}
// no exception occurred
......@@ -743,7 +743,7 @@ void SAL_CALL UNO_proxy_dispatch(
else
{
uno_any_construct(
reinterpret_cast< uno_Any * >( uno_ret ),
static_cast< uno_Any * >( uno_ret ),
&pInterface, demanded_td.get(), 0 );
(*pInterface->release)( pInterface );
*uno_exc = 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