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(
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;
}
......
......@@ -146,7 +146,7 @@ extern "C" void SAL_CALL delete_IdContainer( void * p )
{
if (p)
{
IdContainer * pId = reinterpret_cast< IdContainer * >( p );
IdContainer * pId = static_cast< IdContainer * >( p );
if (pId->pCurrentContext)
{
(*pId->pCurrentContextEnv->releaseInterface)(
......@@ -168,7 +168,7 @@ IdContainer * getIdContainer()
static ThreadKey s_key( delete_IdContainer );
oslThreadKey aKey = s_key.getThreadKey();
IdContainer * pId = reinterpret_cast< IdContainer * >( ::osl_getThreadKeyData( aKey ) );
IdContainer * pId = static_cast< IdContainer * >( ::osl_getThreadKeyData( aKey ) );
if (! pId)
{
pId = new IdContainer();
......
......@@ -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)
{
cppu::Enterable * pEnterable = reinterpret_cast<cppu::Enterable *>(pEnv->pReserved);
cppu::Enterable * pEnterable = static_cast<cppu::Enterable *>(pEnv->pReserved);
if (pEnterable)
pEnterable->callInto(s_pull, pCallee, pParam);
......@@ -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)
{
cppu::Enterable * pEnterable = reinterpret_cast<cppu::Enterable *>(pEnv->pReserved);
cppu::Enterable * pEnterable = static_cast<cppu::Enterable *>(pEnv->pReserved);
if (pEnterable)
pEnterable->callOut_v(pCallee, pParam);
......@@ -336,7 +336,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv)
switch(res)
{
case -1:
pEnterable = reinterpret_cast<cppu::Enterable *>(pCurrEnv->pReserved);
pEnterable = static_cast<cppu::Enterable *>(pCurrEnv->pReserved);
if (pEnterable)
pEnterable->leave();
pCurrEnv->release(pCurrEnv);
......@@ -344,7 +344,7 @@ extern "C" void SAL_CALL uno_Environment_enter(uno_Environment * pTargetEnv)
case 1:
pNextEnv->acquire(pNextEnv);
pEnterable = reinterpret_cast<cppu::Enterable *>(pNextEnv->pReserved);
pEnterable = static_cast<cppu::Enterable *>(pNextEnv->pReserved);
if (pEnterable)
pEnterable->enter();
break;
......@@ -363,7 +363,7 @@ int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pRea
rtl::OUString typeName(cppu::EnvDcp::getTypeName(pEnv->pTypeName));
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)
result = pEnterable->isValid(reinterpret_cast<rtl::OUString *>(pReason));
}
......
......@@ -95,7 +95,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
"exception occurred querying for interface "
<< OUString(pDestType->pTypeName) << ": ["
<< OUString(pExc->pType->pTypeName) << "] "
<< *reinterpret_cast<OUString const *>(pExc->pData));
<< *static_cast<OUString const *>(pExc->pData));
// Message is very first member
uno_any_destruct( pExc, 0 );
}
......
......@@ -882,7 +882,7 @@ static void SAL_CALL unoenv_computeObjectIdentifier(
static void SAL_CALL unoenv_acquireInterface(
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 );
}
......@@ -890,7 +890,7 @@ static void SAL_CALL unoenv_acquireInterface(
static void SAL_CALL unoenv_releaseInterface(
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 );
}
}
......
......@@ -36,12 +36,12 @@ namespace uno
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 )
{
reinterpret_cast< XInterface * >( pCppI )->release();
static_cast< XInterface * >( pCppI )->release();
}
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
{
try
{
Any aRet( reinterpret_cast< XInterface * >( pCppI )->queryInterface(
Any aRet( static_cast< XInterface * >( pCppI )->queryInterface(
* reinterpret_cast< const Type * >( &pType ) ) );
if (typelib_TypeClass_INTERFACE == aRet.pType->eTypeClass)
{
XInterface * pRet = reinterpret_cast< XInterface * >( aRet.pReserved );
XInterface * pRet = static_cast< XInterface * >( aRet.pReserved );
aRet.pReserved = 0;
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