diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-31 13:16:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-31 13:16:43 +0200 |
commit | b3105952fbb04f51d8f1c310f0055219b94f2ee9 (patch) | |
tree | f5a8bc25e9f6c96814d754d14513387e10f573d7 /stoc | |
parent | c96f4e5684d3e7f145dcee5e3eeafd7491671d9b (diff) |
Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: Ib3610f9d244b15f8f752c0f781600f5c7e7a944f
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/corereflection/base.hxx | 2 | ||||
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 6 | ||||
-rw-r--r-- | stoc/source/javaloader/javaloader.cxx | 2 | ||||
-rw-r--r-- | stoc/source/proxy_factory/proxyfac.cxx | 6 | ||||
-rw-r--r-- | stoc/source/security/access_controller.cxx | 12 | ||||
-rw-r--r-- | stoc/source/security/permissions.cxx | 12 | ||||
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 4 |
7 files changed, 22 insertions, 22 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index d81cf768acf6..68462778e2b0 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -387,7 +387,7 @@ inline bool extract( } else if (rObj.getValueTypeClass() == css::uno::TypeClass_TYPE) { - rDest = pRefl->forType( reinterpret_cast< const css::uno::Type * >( rObj.getValue() )->getTypeLibType() ); + rDest = pRefl->forType( static_cast< const css::uno::Type * >( rObj.getValue() )->getTypeLibType() ); return rDest.is(); } } diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index d2e35676c23c..b8d4682b92b3 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -275,7 +275,7 @@ bool AdapterImpl::coerce_assign( // set runtime exception constructRuntimeException( pOutExc, "type coercion failed: " + - reinterpret_cast< Exception const * >( + static_cast< Exception const * >( p_exc->pData )->Message ); } ::uno_any_destruct( p_exc, 0 ); @@ -330,7 +330,7 @@ static void handleInvokExc( uno_Any * pDest, uno_Any * pSource ) { // unwrap invocation target exception uno_Any * target_exc = - &reinterpret_cast< reflection::InvocationTargetException * >( + &static_cast< reflection::InvocationTargetException * >( pSource->pData )->TargetException; ::uno_type_any_construct( pDest, target_exc->pData, target_exc->pType, 0 ); @@ -773,7 +773,7 @@ static inline AdapterImpl * lookup_adapter( t_ptr_set::const_iterator const iEnd( adapters_set.end() ); while (iEnd != iPos) { - AdapterImpl * that = reinterpret_cast< AdapterImpl * >( *iPos ); + AdapterImpl * that = static_cast< AdapterImpl * >( *iPos ); // iterate through all types if that is a matching adapter sal_Int32 nPosTypes; for ( nPosTypes = nTypes; nPosTypes--; ) diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index a3bb06f993fb..8c8a0a5e2e33 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -247,7 +247,7 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL throw RuntimeException( "javaloader error - no type information for XImplementationLoader"); - m_javaLoader = css::uno::Reference<XImplementationLoader>(reinterpret_cast<XImplementationLoader *>( + m_javaLoader = css::uno::Reference<XImplementationLoader>(static_cast<XImplementationLoader *>( java_curr.mapInterface(joJavaLoader, pType_XImplementationLoader))); pJNIEnv->DeleteLocalRef( joJavaLoader ); if(!m_javaLoader.is()) diff --git a/stoc/source/proxy_factory/proxyfac.cxx b/stoc/source/proxy_factory/proxyfac.cxx index 9e60c95ad53f..85f11f6670cc 100644 --- a/stoc/source/proxy_factory/proxyfac.cxx +++ b/stoc/source/proxy_factory/proxyfac.cxx @@ -134,7 +134,7 @@ UnoInterfaceReference FactoryImpl::binuno_queryInterface( UnoInterfaceReference ret; if (ret_val.pType->eTypeClass == typelib_TypeClass_INTERFACE) { - ret.set( *reinterpret_cast< uno_Interface ** >(ret_val.pData), + ret.set( *static_cast< uno_Interface ** >(ret_val.pData), SAL_NO_ACQUIRE ); typelib_typedescriptionreference_release( ret_val.pType ); } @@ -203,7 +203,7 @@ static void SAL_CALL binuno_proxy_free( { (void) pEnv; // avoid warning about unused parameter binuno_Proxy * proxy = static_cast< binuno_Proxy * >( - reinterpret_cast< uno_Interface * >( pProxy ) ); + static_cast< uno_Interface * >( pProxy ) ); OSL_ASSERT( proxy->m_root->m_factory->m_uno_env.get()->pExtEnv == pEnv ); delete proxy; } @@ -254,7 +254,7 @@ static void SAL_CALL binuno_proxy_dispatch( try { Type const & rType = - *reinterpret_cast< Type const * >( pArgs[ 0 ] ); + *static_cast< Type const * >( pArgs[ 0 ] ); Any ret( that->m_root->queryInterface( rType ) ); uno_type_copyAndConvertData( pReturn, &ret, ::getCppuType( &ret ).getTypeLibType(), diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index a50fb9931150..e772b9f161e1 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -276,12 +276,12 @@ static inline Reference< security::XAccessControlContext > getDynamicRestriction if ( typeName == "com.sun.star.security.XAccessControlContext" ) { return Reference< security::XAccessControlContext >( - *reinterpret_cast< security::XAccessControlContext ** const >( acc.pData ) ); + *static_cast< security::XAccessControlContext ** const >( acc.pData ) ); } else // try to query { return Reference< security::XAccessControlContext >::query( - *reinterpret_cast< XInterface ** const >( acc.pData ) ); + *static_cast< XInterface ** const >( acc.pData ) ); } } } @@ -530,14 +530,14 @@ static void dumpPermissions( inline void AccessController::clearPostPoned() { - delete reinterpret_cast< t_rec_vec * >( m_rec.getData() ); + delete static_cast< t_rec_vec * >( m_rec.getData() ); m_rec.setData( 0 ); } void AccessController::checkAndClearPostPoned() { // check postponed permissions - boost::scoped_ptr< t_rec_vec > rec( reinterpret_cast< t_rec_vec * >( m_rec.getData() ) ); + boost::scoped_ptr< t_rec_vec > rec( static_cast< t_rec_vec * >( m_rec.getData() ) ); m_rec.setData( 0 ); // takeover ownership OSL_ASSERT( rec.get() ); if (rec.get()) @@ -646,7 +646,7 @@ PermissionCollection AccessController::getEffectivePermissions( // call on policy // iff this is a recurring call for the default user, then grant all permissions - t_rec_vec * rec = reinterpret_cast< t_rec_vec * >( m_rec.getData() ); + t_rec_vec * rec = static_cast< t_rec_vec * >( m_rec.getData() ); if (rec) // tls entry exists => this is recursive call { if (demanded_perm.hasValue()) @@ -756,7 +756,7 @@ PermissionCollection AccessController::getEffectivePermissions( { // dont check postponed, just cleanup clearPostPoned(); - delete reinterpret_cast< t_rec_vec * >( m_rec.getData() ); + delete static_cast< t_rec_vec * >( m_rec.getData() ); m_rec.setData( 0 ); throw; } diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 85f8e02c503e..d6f0f793ef9a 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -493,17 +493,17 @@ PermissionCollection::PermissionCollection( if (perm_type.equals( cppu::UnoType<io::FilePermission>::get())) { m_head = new FilePermission( - *reinterpret_cast< io::FilePermission const * >( perm.pData ), m_head ); + *static_cast< io::FilePermission const * >( perm.pData ), m_head ); } else if (perm_type.equals( cppu::UnoType<connection::SocketPermission>::get())) { m_head = new SocketPermission( - *reinterpret_cast< connection::SocketPermission const * >( perm.pData ), m_head ); + *static_cast< connection::SocketPermission const * >( perm.pData ), m_head ); } else if (perm_type.equals( cppu::UnoType<security::RuntimePermission>::get())) { m_head = new RuntimePermission( - *reinterpret_cast< security::RuntimePermission const * >( perm.pData ), m_head ); + *static_cast< security::RuntimePermission const * >( perm.pData ), m_head ); } else if (perm_type.equals( cppu::UnoType<security::AllPermission>::get())) { @@ -578,7 +578,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const if (demanded_type.equals( cppu::UnoType<io::FilePermission>::get())) { FilePermission demanded( - *reinterpret_cast< io::FilePermission const * >( perm.pData ) ); + *static_cast< io::FilePermission const * >( perm.pData ) ); if (__implies( m_head, demanded )) { #ifdef __DIAGNOSE @@ -591,7 +591,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const else if (demanded_type.equals( cppu::UnoType<connection::SocketPermission>::get())) { SocketPermission demanded( - *reinterpret_cast< connection::SocketPermission const * >( perm.pData ) ); + *static_cast< connection::SocketPermission const * >( perm.pData ) ); if (__implies( m_head, demanded )) { #ifdef __DIAGNOSE @@ -604,7 +604,7 @@ void PermissionCollection::checkPermission( Any const & perm ) const else if (demanded_type.equals( cppu::UnoType<security::RuntimePermission>::get())) { RuntimePermission demanded( - *reinterpret_cast< security::RuntimePermission const * >( perm.pData ) ); + *static_cast< security::RuntimePermission const * >( perm.pData ) ); if (__implies( m_head, demanded )) { #ifdef __DIAGNOSE diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index fd318eb58629..a543da9f9735 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -1152,7 +1152,7 @@ sal_Bool OServiceManager::has( const Any & Element ) else if (Element.getValueTypeClass() == TypeClass_STRING) { OUString const & implName = - *reinterpret_cast< OUString const * >(Element.getValue()); + *static_cast< OUString const * >(Element.getValue()); MutexGuard aGuard( m_mutex ); return m_ImplementationNameMap.find( implName ) != m_ImplementationNameMap.end(); @@ -1231,7 +1231,7 @@ void OServiceManager::remove( const Any & Element ) else if (Element.getValueTypeClass() == TypeClass_STRING) { OUString const & implName = - *reinterpret_cast< OUString const * >(Element.getValue()); + *static_cast< OUString const * >(Element.getValue()); MutexGuard aGuard( m_mutex ); HashMap_OWString_Interface::const_iterator const iFind( m_ImplementationNameMap.find( implName ) ); |