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

Reduce to static_cast any reinterpret_cast from void pointers

Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
üst 6d393f82
...@@ -172,7 +172,7 @@ extern "C" { static void SAL_CALL s_Proxy_dispatch( ...@@ -172,7 +172,7 @@ extern "C" { static void SAL_CALL s_Proxy_dispatch(
extern "C" void SAL_CALL Proxy_free(SAL_UNUSED_PARAMETER uno_ExtEnvironment * /*pEnv*/, void * pProxy) SAL_THROW_EXTERN_C() extern "C" void SAL_CALL Proxy_free(SAL_UNUSED_PARAMETER uno_ExtEnvironment * /*pEnv*/, void * pProxy) SAL_THROW_EXTERN_C()
{ {
Proxy * pThis = static_cast<Proxy * >(reinterpret_cast<uno_Interface *>(pProxy)); Proxy * pThis = static_cast<Proxy * >(static_cast<uno_Interface *>(pProxy));
delete pThis; delete pThis;
} }
......
...@@ -146,7 +146,7 @@ extern "C" void SAL_CALL delete_IdContainer( void * p ) ...@@ -146,7 +146,7 @@ extern "C" void SAL_CALL delete_IdContainer( void * p )
{ {
if (p) if (p)
{ {
IdContainer * pId = reinterpret_cast< IdContainer * >( p ); IdContainer * pId = static_cast< IdContainer * >( p );
if (pId->pCurrentContext) if (pId->pCurrentContext)
{ {
(*pId->pCurrentContextEnv->releaseInterface)( (*pId->pCurrentContextEnv->releaseInterface)(
...@@ -168,7 +168,7 @@ IdContainer * getIdContainer() ...@@ -168,7 +168,7 @@ IdContainer * getIdContainer()
static ThreadKey s_key( delete_IdContainer ); static ThreadKey s_key( delete_IdContainer );
oslThreadKey aKey = s_key.getThreadKey(); oslThreadKey aKey = s_key.getThreadKey();
IdContainer * pId = reinterpret_cast< IdContainer * >( ::osl_getThreadKeyData( aKey ) ); IdContainer * pId = static_cast< IdContainer * >( ::osl_getThreadKeyData( aKey ) );
if (! pId) if (! pId)
{ {
pId = new IdContainer(); pId = new IdContainer();
......
...@@ -228,7 +228,7 @@ extern "C" { static void s_pull(va_list * pParam) ...@@ -228,7 +228,7 @@ extern "C" { static void s_pull(va_list * pParam)
static void s_callInto_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam) static void s_callInto_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
{ {
cppu::Enterable * pEnterable = reinterpret_cast<cppu::Enterable *>(pEnv->pReserved); cppu::Enterable * pEnterable = static_cast<cppu::Enterable *>(pEnv->pReserved);
if (pEnterable) if (pEnterable)
pEnterable->callInto(s_pull, pCallee, pParam); pEnterable->callInto(s_pull, pCallee, pParam);
...@@ -247,7 +247,7 @@ static void s_callInto(uno_Environment * pEnv, uno_EnvCallee * pCallee, ...) ...@@ -247,7 +247,7 @@ static void s_callInto(uno_Environment * pEnv, uno_EnvCallee * pCallee, ...)
static void s_callOut_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam) static void s_callOut_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam)
{ {
cppu::Enterable * pEnterable = reinterpret_cast<cppu::Enterable *>(pEnv->pReserved); cppu::Enterable * pEnterable = static_cast<cppu::Enterable *>(pEnv->pReserved);
if (pEnterable) if (pEnterable)
pEnterable->callOut_v(pCallee, pParam); pEnterable->callOut_v(pCallee, pParam);
...@@ -336,7 +336,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv) ...@@ -336,7 +336,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv)
switch(res) switch(res)
{ {
case -1: case -1:
pEnterable = reinterpret_cast<cppu::Enterable *>(pCurrEnv->pReserved); pEnterable = static_cast<cppu::Enterable *>(pCurrEnv->pReserved);
if (pEnterable) if (pEnterable)
pEnterable->leave(); pEnterable->leave();
pCurrEnv->release(pCurrEnv); pCurrEnv->release(pCurrEnv);
...@@ -344,7 +344,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv) ...@@ -344,7 +344,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv)
case 1: case 1:
pNextEnv->acquire(pNextEnv); pNextEnv->acquire(pNextEnv);
pEnterable = reinterpret_cast<cppu::Enterable *>(pNextEnv->pReserved); pEnterable = static_cast<cppu::Enterable *>(pNextEnv->pReserved);
if (pEnterable) if (pEnterable)
pEnterable->enter(); pEnterable->enter();
break; break;
...@@ -363,7 +363,7 @@ int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pRea ...@@ -363,7 +363,7 @@ int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pRea
rtl::OUString typeName(cppu::EnvDcp::getTypeName(pEnv->pTypeName)); rtl::OUString typeName(cppu::EnvDcp::getTypeName(pEnv->pTypeName));
if (typeName == UNO_LB_UNO) if (typeName == UNO_LB_UNO)
{ {
cppu::Enterable * pEnterable = reinterpret_cast<cppu::Enterable *>(pEnv->pReserved); cppu::Enterable * pEnterable = static_cast<cppu::Enterable *>(pEnv->pReserved);
if (pEnterable) if (pEnterable)
result = pEnterable->isValid(reinterpret_cast<rtl::OUString *>(pReason)); result = pEnterable->isValid(reinterpret_cast<rtl::OUString *>(pReason));
} }
......
...@@ -95,7 +95,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p ...@@ -95,7 +95,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
"exception occurred querying for interface " "exception occurred querying for interface "
<< OUString(pDestType->pTypeName) << ": [" << OUString(pDestType->pTypeName) << ": ["
<< OUString(pExc->pType->pTypeName) << "] " << OUString(pExc->pType->pTypeName) << "] "
<< *reinterpret_cast<OUString const *>(pExc->pData)); << *static_cast<OUString const *>(pExc->pData));
// Message is very first member // Message is very first member
uno_any_destruct( pExc, 0 ); uno_any_destruct( pExc, 0 );
} }
......
...@@ -882,7 +882,7 @@ static void SAL_CALL unoenv_computeObjectIdentifier( ...@@ -882,7 +882,7 @@ static void SAL_CALL unoenv_computeObjectIdentifier(
static void SAL_CALL unoenv_acquireInterface( static void SAL_CALL unoenv_acquireInterface(
SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pUnoI_ ) SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pUnoI_ )
{ {
uno_Interface * pUnoI = reinterpret_cast< uno_Interface * >(pUnoI_); uno_Interface * pUnoI = static_cast< uno_Interface * >(pUnoI_);
(*pUnoI->acquire)( pUnoI ); (*pUnoI->acquire)( pUnoI );
} }
...@@ -890,7 +890,7 @@ static void SAL_CALL unoenv_acquireInterface( ...@@ -890,7 +890,7 @@ static void SAL_CALL unoenv_acquireInterface(
static void SAL_CALL unoenv_releaseInterface( static void SAL_CALL unoenv_releaseInterface(
SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pUnoI_ ) SAL_UNUSED_PARAMETER uno_ExtEnvironment *, void * pUnoI_ )
{ {
uno_Interface * pUnoI = reinterpret_cast< uno_Interface * >(pUnoI_); uno_Interface * pUnoI = static_cast< uno_Interface * >(pUnoI_);
(*pUnoI->release)( pUnoI ); (*pUnoI->release)( pUnoI );
} }
} }
......
...@@ -255,7 +255,7 @@ inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal ...@@ -255,7 +255,7 @@ inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal
{ {
if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass) if (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass)
{ {
value = (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False); value = (* static_cast< const sal_Bool * >( rAny.pData ) != sal_False);
return true; return true;
} }
return false; return false;
...@@ -265,7 +265,7 @@ template<> ...@@ -265,7 +265,7 @@ template<>
inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value ) inline bool SAL_CALL operator == ( const Any & rAny, const sal_Bool & value )
{ {
return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass && return (typelib_TypeClass_BOOLEAN == rAny.pType->eTypeClass &&
(value != sal_False) == (* reinterpret_cast< const sal_Bool * >( rAny.pData ) != sal_False)); (value != sal_False) == (* static_cast< const sal_Bool * >( rAny.pData ) != sal_False));
} }
...@@ -274,7 +274,7 @@ inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value ) ...@@ -274,7 +274,7 @@ inline bool SAL_CALL operator >>= ( Any const & rAny, bool & value )
{ {
if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN) if (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN)
{ {
value = *reinterpret_cast< sal_Bool const * >( value = *static_cast< sal_Bool const * >(
rAny.pData ) != sal_False; rAny.pData ) != sal_False;
return true; return true;
} }
...@@ -287,7 +287,7 @@ inline bool SAL_CALL operator == ( Any const & rAny, bool const & value ) ...@@ -287,7 +287,7 @@ inline bool SAL_CALL operator == ( Any const & rAny, bool const & value )
{ {
return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN && return (rAny.pType->eTypeClass == typelib_TypeClass_BOOLEAN &&
(value == (value ==
(*reinterpret_cast< sal_Bool const * >( rAny.pData ) (*static_cast< sal_Bool const * >( rAny.pData )
!= sal_False))); != sal_False)));
} }
...@@ -298,7 +298,7 @@ inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal ...@@ -298,7 +298,7 @@ inline bool SAL_CALL operator >>= ( const ::com::sun::star::uno::Any & rAny, sal
{ {
if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass) if (typelib_TypeClass_BYTE == rAny.pType->eTypeClass)
{ {
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
} }
return false; return false;
...@@ -311,11 +311,11 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value ) ...@@ -311,11 +311,11 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData ); value = * static_cast< const sal_Int16 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -328,11 +328,11 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value ) ...@@ -328,11 +328,11 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = (sal_uInt16)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) ); value = (sal_uInt16)( * static_cast< const sal_Int8 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -346,17 +346,17 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value ) ...@@ -346,17 +346,17 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData ); value = * static_cast< const sal_Int16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData ); value = * static_cast< const sal_Int32 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -369,17 +369,17 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value ) ...@@ -369,17 +369,17 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = (sal_uInt32)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) ); value = (sal_uInt32)( * static_cast< const sal_Int8 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = (sal_uInt32)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) ); value = (sal_uInt32)( * static_cast< const sal_Int16 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData ); value = * static_cast< const sal_uInt32 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -393,23 +393,23 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value ) ...@@ -393,23 +393,23 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData ); value = * static_cast< const sal_Int16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData ); value = * static_cast< const sal_Int32 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData ); value = * static_cast< const sal_uInt32 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_HYPER: case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_UNSIGNED_HYPER:
value = * reinterpret_cast< const sal_Int64 * >( rAny.pData ); value = * static_cast< const sal_Int64 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -422,23 +422,23 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value ) ...@@ -422,23 +422,23 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = (sal_uInt64)( * reinterpret_cast< const sal_Int8 * >( rAny.pData ) ); value = (sal_uInt64)( * static_cast< const sal_Int8 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = (sal_uInt64)( * reinterpret_cast< const sal_Int16 * >( rAny.pData ) ); value = (sal_uInt64)( * static_cast< const sal_Int16 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
value = (sal_uInt64)( * reinterpret_cast< const sal_Int32 * >( rAny.pData ) ); value = (sal_uInt64)( * static_cast< const sal_Int32 * >( rAny.pData ) );
return true; return true;
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData ); value = * static_cast< const sal_uInt32 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_HYPER: case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_UNSIGNED_HYPER:
value = * reinterpret_cast< const sal_uInt64 * >( rAny.pData ); value = * static_cast< const sal_uInt64 * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -452,16 +452,16 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, float & value ) ...@@ -452,16 +452,16 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, float & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData ); value = * static_cast< const sal_Int16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_FLOAT: case typelib_TypeClass_FLOAT:
value = * reinterpret_cast< const float * >( rAny.pData ); value = * static_cast< const float * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -475,25 +475,25 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, double & value ) ...@@ -475,25 +475,25 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, double & value )
switch (rAny.pType->eTypeClass) switch (rAny.pType->eTypeClass)
{ {
case typelib_TypeClass_BYTE: case typelib_TypeClass_BYTE:
value = * reinterpret_cast< const sal_Int8 * >( rAny.pData ); value = * static_cast< const sal_Int8 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_SHORT: case typelib_TypeClass_SHORT:
value = * reinterpret_cast< const sal_Int16 * >( rAny.pData ); value = * static_cast< const sal_Int16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_UNSIGNED_SHORT:
value = * reinterpret_cast< const sal_uInt16 * >( rAny.pData ); value = * static_cast< const sal_uInt16 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_LONG: case typelib_TypeClass_LONG:
value = * reinterpret_cast< const sal_Int32 * >( rAny.pData ); value = * static_cast< const sal_Int32 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_UNSIGNED_LONG:
value = * reinterpret_cast< const sal_uInt32 * >( rAny.pData ); value = * static_cast< const sal_uInt32 * >( rAny.pData );
return true; return true;
case typelib_TypeClass_FLOAT: case typelib_TypeClass_FLOAT:
value = * reinterpret_cast< const float * >( rAny.pData ); value = * static_cast< const float * >( rAny.pData );
return true; return true;
case typelib_TypeClass_DOUBLE: case typelib_TypeClass_DOUBLE:
value = * reinterpret_cast< const double * >( rAny.pData ); value = * static_cast< const double * >( rAny.pData );
return true; return true;
default: default:
return false; return false;
...@@ -506,7 +506,7 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value ) ...@@ -506,7 +506,7 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value )
{ {
if (typelib_TypeClass_STRING == rAny.pType->eTypeClass) if (typelib_TypeClass_STRING == rAny.pType->eTypeClass)
{ {
value = * reinterpret_cast< const ::rtl::OUString * >( rAny.pData ); value = * static_cast< const ::rtl::OUString * >( rAny.pData );
return true; return true;
} }
return false; return false;
...@@ -516,7 +516,7 @@ template<> ...@@ -516,7 +516,7 @@ template<>
inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value ) inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & value )
{ {
return (typelib_TypeClass_STRING == rAny.pType->eTypeClass && return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
value.equals( * reinterpret_cast< const ::rtl::OUString * >( rAny.pData ) )); value.equals( * static_cast< const ::rtl::OUString * >( rAny.pData ) ));
} }
// type // type
...@@ -525,7 +525,7 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value ) ...@@ -525,7 +525,7 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value )
{ {
if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass) if (typelib_TypeClass_TYPE == rAny.pType->eTypeClass)
{ {
value = * reinterpret_cast< const Type * >( rAny.pData ); value = * static_cast< const Type * >( rAny.pData );
return true; return true;
} }
return false; return false;
...@@ -535,7 +535,7 @@ template<> ...@@ -535,7 +535,7 @@ template<>
inline bool SAL_CALL operator == ( const Any & rAny, const Type & value ) inline bool SAL_CALL operator == ( const Any & rAny, const Type & value )
{ {
return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass && return (typelib_TypeClass_TYPE == rAny.pType->eTypeClass &&
value.equals( * reinterpret_cast< const Type * >( rAny.pData ) )); value.equals( * static_cast< const Type * >( rAny.pData ) ));
} }
// any // any
...@@ -557,7 +557,7 @@ inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value ...@@ -557,7 +557,7 @@ inline bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value
{ {
if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass) if (typelib_TypeClass_INTERFACE == rAny.pType->eTypeClass)
{ {
return reinterpret_cast< const BaseReference * >( rAny.pData )->operator == ( value ); return static_cast< const BaseReference * >( rAny.pData )->operator == ( value );
} }
return false; return false;
} }
......
...@@ -36,12 +36,12 @@ namespace uno ...@@ -36,12 +36,12 @@ namespace uno
inline void SAL_CALL cpp_acquire( void * pCppI ) inline void SAL_CALL cpp_acquire( void * pCppI )
{ {
reinterpret_cast< XInterface * >( pCppI )->acquire(); static_cast< XInterface * >( pCppI )->acquire();
} }
inline void SAL_CALL cpp_release( void * pCppI ) inline void SAL_CALL cpp_release( void * pCppI )
{ {
reinterpret_cast< XInterface * >( pCppI )->release(); static_cast< XInterface * >( pCppI )->release();
} }
inline void * SAL_CALL cpp_queryInterface( void * pCppI, typelib_TypeDescriptionReference * pType ) inline void * SAL_CALL cpp_queryInterface( void * pCppI, typelib_TypeDescriptionReference * pType )
...@@ -50,11 +50,11 @@ inline void * SAL_CALL cpp_queryInterface( void * pCppI, typelib_TypeDescription ...@@ -50,11 +50,11 @@ inline void * SAL_CALL cpp_queryInterface( void * pCppI, typelib_TypeDescription
{ {
try try
{ {
Any aRet( reinterpret_cast< XInterface * >( pCppI )->queryInterface( Any aRet( static_cast< XInterface * >( pCppI )->queryInterface(
* reinterpret_cast< const Type * >( &pType ) ) ); * reinterpret_cast< const Type * >( &pType ) ) );
if (typelib_TypeClass_INTERFACE == aRet.pType->eTypeClass) if (typelib_TypeClass_INTERFACE == aRet.pType->eTypeClass)
{ {
XInterface * pRet = reinterpret_cast< XInterface * >( aRet.pReserved ); XInterface * pRet = static_cast< XInterface * >( aRet.pReserved );
aRet.pReserved = 0; aRet.pReserved = 0;
return pRet; return pRet;
} }
......
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