diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-18 21:32:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-20 09:06:51 +0100 |
commit | c2c134cda1c501df6b9eec580a63131dbf798f12 (patch) | |
tree | 3ae6c0fe2608ebaff260658e4ba36710c7bb8b35 /stoc/source/corereflection | |
parent | d6ca554fa0a41372f015875115165df614cdda68 (diff) |
Some more loplugin:cstylecast: stoc
Change-Id: I3d820a1df3750d20e704a163f45c16ea29a1b4bd
Diffstat (limited to 'stoc/source/corereflection')
-rw-r--r-- | stoc/source/corereflection/base.hxx | 12 | ||||
-rw-r--r-- | stoc/source/corereflection/crarray.cxx | 4 | ||||
-rw-r--r-- | stoc/source/corereflection/crcomp.cxx | 12 | ||||
-rw-r--r-- | stoc/source/corereflection/crenum.cxx | 2 | ||||
-rw-r--r-- | stoc/source/corereflection/criface.cxx | 20 |
5 files changed, 25 insertions, 25 deletions
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index 08bba8fa8fd9..7e6eaf0efb7f 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -215,7 +215,7 @@ class InterfaceIdlClassImpl public: typelib_InterfaceTypeDescription * getTypeDescr() const - { return (typelib_InterfaceTypeDescription *)IdlClassImpl::getTypeDescr(); } + { return reinterpret_cast<typelib_InterfaceTypeDescription *>(IdlClassImpl::getTypeDescr()); } // ctor/ dtor InterfaceIdlClassImpl( IdlReflectionServiceImpl * pReflection, @@ -250,7 +250,7 @@ class CompoundIdlClassImpl public: typelib_CompoundTypeDescription * getTypeDescr() const - { return (typelib_CompoundTypeDescription *)IdlClassImpl::getTypeDescr(); } + { return reinterpret_cast<typelib_CompoundTypeDescription *>(IdlClassImpl::getTypeDescr()); } // ctor/ dtor CompoundIdlClassImpl( IdlReflectionServiceImpl * pReflection, @@ -275,7 +275,7 @@ class ArrayIdlClassImpl { public: typelib_IndirectTypeDescription * getTypeDescr() const - { return (typelib_IndirectTypeDescription *)IdlClassImpl::getTypeDescr(); } + { return reinterpret_cast<typelib_IndirectTypeDescription *>(IdlClassImpl::getTypeDescr()); } // ctor ArrayIdlClassImpl( IdlReflectionServiceImpl * pReflection, @@ -313,7 +313,7 @@ class EnumIdlClassImpl public: typelib_EnumTypeDescription * getTypeDescr() const - { return (typelib_EnumTypeDescription *)IdlClassImpl::getTypeDescr(); } + { return reinterpret_cast<typelib_EnumTypeDescription *>(IdlClassImpl::getTypeDescr()); } // ctor/ dtor EnumIdlClassImpl( IdlReflectionServiceImpl * pReflection, @@ -379,7 +379,7 @@ inline bool extract( if (rObj.getValueTypeClass() == css::uno::TypeClass_INTERFACE) { return ::uno_type_assignData( - &rDest, ((typelib_TypeDescription *)pTo)->pWeakRef, + &rDest, pTo->aBase.pWeakRef, const_cast< void * >( rObj.getValue() ), rObj.getValueTypeRef(), reinterpret_cast< uno_QueryInterfaceFunc >(css::uno::cpp_queryInterface), reinterpret_cast< uno_AcquireFunc >(css::uno::cpp_acquire), @@ -401,7 +401,7 @@ inline bool coerce_assign( if (pTD->eTypeClass == typelib_TypeClass_INTERFACE) { css::uno::Reference< css::uno::XInterface > xVal; - if (extract( rSource, (typelib_InterfaceTypeDescription *)pTD, xVal, pRefl )) + if (extract( rSource, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD), xVal, pRefl )) { if (*(css::uno::XInterface **)pDest) (*(css::uno::XInterface **)pDest)->release(); diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx index 0dd2836e88be..e35d30ef1306 100644 --- a/stoc/source/corereflection/crarray.cxx +++ b/stoc/source/corereflection/crarray.cxx @@ -95,7 +95,7 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen ) } uno_Sequence ** ppSeq = (uno_Sequence **)rArray.getValue(); - uno_sequence_realloc( ppSeq, (typelib_TypeDescription *)getTypeDescr(), + uno_sequence_realloc( ppSeq, &getTypeDescr()->aBase, nLen, reinterpret_cast< uno_AcquireFunc >(cpp_acquire), reinterpret_cast< uno_ReleaseFunc >(cpp_release) ); @@ -168,7 +168,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal uno_Sequence ** ppSeq = (uno_Sequence **)rArray.getValue(); uno_sequence_reference2One( - ppSeq, (typelib_TypeDescription *)getTypeDescr(), + ppSeq, &getTypeDescr()->aBase, reinterpret_cast< uno_AcquireFunc >(cpp_acquire), reinterpret_cast< uno_ReleaseFunc >(cpp_release) ); rArray.pData = ppSeq; diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx index b0bf547f9f4f..9805938c56f0 100644 --- a/stoc/source/corereflection/crcomp.cxx +++ b/stoc/source/corereflection/crcomp.cxx @@ -129,7 +129,7 @@ Reference< XIdlClass > IdlCompFieldImpl::getDeclaringClass() if (! _xDeclClass.is()) { typelib_CompoundTypeDescription * pTD = - (typelib_CompoundTypeDescription *)getDeclTypeDescr(); + reinterpret_cast<typelib_CompoundTypeDescription *>(getDeclTypeDescr()); while (pTD) { typelib_TypeDescriptionReference ** ppTypeRefs = pTD->ppTypeRefs; @@ -137,7 +137,7 @@ Reference< XIdlClass > IdlCompFieldImpl::getDeclaringClass() { if (td_equals( (typelib_TypeDescription *)getTypeDescr(), ppTypeRefs[nPos] )) { - _xDeclClass = getReflection()->forType( (typelib_TypeDescription *)pTD ); + _xDeclClass = getReflection()->forType( &pTD->aBase ); return _xDeclClass; } } @@ -180,7 +180,7 @@ Any IdlCompFieldImpl::get( const Any & rObj ) typelib_TypeDescription * pTD = pObjTD; typelib_TypeDescription * pDeclTD = getDeclTypeDescr(); while (pTD && !typelib_typedescription_equals( pTD, pDeclTD )) - pTD = (typelib_TypeDescription *)((typelib_CompoundTypeDescription *)pTD)->pBaseTypeDescription; + pTD = &reinterpret_cast<typelib_CompoundTypeDescription *>(pTD)->pBaseTypeDescription->aBase; OSL_ENSURE( pTD, "### illegal object type!" ); if (pTD) @@ -213,7 +213,7 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue ) typelib_TypeDescription * pTD = pObjTD; typelib_TypeDescription * pDeclTD = getDeclTypeDescr(); while (pTD && !typelib_typedescription_equals( pTD, pDeclTD )) - pTD = (typelib_TypeDescription *)((typelib_CompoundTypeDescription *)pTD)->pBaseTypeDescription; + pTD = &reinterpret_cast<typelib_CompoundTypeDescription *>(pTD)->pBaseTypeDescription->aBase; OSL_ENSURE( pTD, "### illegal object type!" ); if (pTD) @@ -250,7 +250,7 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue ) typelib_TypeDescription * pTD = pObjTD; typelib_TypeDescription * pDeclTD = getDeclTypeDescr(); while (pTD && !typelib_typedescription_equals( pTD, pDeclTD )) - pTD = (typelib_TypeDescription *)((typelib_CompoundTypeDescription *)pTD)->pBaseTypeDescription; + pTD = &reinterpret_cast<typelib_CompoundTypeDescription *>(pTD)->pBaseTypeDescription->aBase; OSL_ENSURE( pTD, "### illegal object type!" ); if (pTD) @@ -320,7 +320,7 @@ Sequence< Reference< XIdlClass > > CompoundIdlClassImpl::getSuperclasses() { typelib_CompoundTypeDescription * pCompTypeDescr = getTypeDescr()->pBaseTypeDescription; if (pCompTypeDescr) - _xSuperClass = getReflection()->forType( (typelib_TypeDescription *)pCompTypeDescr ); + _xSuperClass = getReflection()->forType( &pCompTypeDescr->aBase ); } } if (_xSuperClass.is()) diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx index f6a8b69dd318..8cd09763aeb9 100644 --- a/stoc/source/corereflection/crenum.cxx +++ b/stoc/source/corereflection/crenum.cxx @@ -223,7 +223,7 @@ void EnumIdlClassImpl::createObject( Any & rObj ) throw(css::uno::RuntimeException, std::exception) { sal_Int32 eVal = - ((typelib_EnumTypeDescription *)IdlClassImpl::getTypeDescr())->nDefaultEnumValue; + reinterpret_cast<typelib_EnumTypeDescription *>(IdlClassImpl::getTypeDescr())->nDefaultEnumValue; rObj.setValue( &eVal, IdlClassImpl::getTypeDescr() ); } diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx index d98659db6ff0..872f98b297d9 100644 --- a/stoc/source/corereflection/criface.cxx +++ b/stoc/source/corereflection/criface.cxx @@ -50,7 +50,7 @@ class IdlAttributeFieldImpl { public: typelib_InterfaceAttributeTypeDescription * getAttributeTypeDescr() - { return (typelib_InterfaceAttributeTypeDescription *)getTypeDescr(); } + { return reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(getTypeDescr()); } IdlAttributeFieldImpl( IdlReflectionServiceImpl * pReflection, const OUString & rName, typelib_TypeDescription * pTypeDescr, typelib_TypeDescription * pDeclTypeDescr ) @@ -175,7 +175,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj ) throw(css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) { uno_Interface * pUnoI = getReflection()->mapToUno( - rObj, (typelib_InterfaceTypeDescription *)getDeclTypeDescr() ); + rObj, reinterpret_cast<typelib_InterfaceTypeDescription *>(getDeclTypeDescr()) ); OSL_ENSURE( pUnoI, "### illegal destination object given!" ); if (pUnoI) { @@ -215,7 +215,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue ) } uno_Interface * pUnoI = getReflection()->mapToUno( - rObj, (typelib_InterfaceTypeDescription *)getDeclTypeDescr() ); + rObj, reinterpret_cast<typelib_InterfaceTypeDescription *>(getDeclTypeDescr()) ); OSL_ENSURE( pUnoI, "### illegal destination object given!" ); if (pUnoI) { @@ -243,12 +243,12 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue ) { Reference< XInterface > xObj; bAssign = extract( - rValue, (typelib_InterfaceTypeDescription *)pTD, xObj, + rValue, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD), xObj, getReflection() ); if (bAssign) { *(void **)pArg = getReflection()->getCpp2Uno().mapInterface( - xObj.get(), (typelib_InterfaceTypeDescription *)pTD ); + xObj.get(), reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) ); } } else @@ -339,7 +339,7 @@ class IdlInterfaceMethodImpl public: typelib_InterfaceMethodTypeDescription * getMethodTypeDescr() - { return (typelib_InterfaceMethodTypeDescription *)getTypeDescr(); } + { return reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(getTypeDescr()); } IdlInterfaceMethodImpl( IdlReflectionServiceImpl * pReflection, const OUString & rName, typelib_TypeDescription * pTypeDescr, typelib_TypeDescription * pDeclTypeDescr ) @@ -598,7 +598,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > & } uno_Interface * pUnoI = getReflection()->mapToUno( - rObj, (typelib_InterfaceTypeDescription *)getDeclTypeDescr() ); + rObj, reinterpret_cast<typelib_InterfaceTypeDescription *>(getDeclTypeDescr()) ); OSL_ENSURE( pUnoI, "### illegal destination object given!" ); if (pUnoI) { @@ -651,12 +651,12 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > & { Reference< XInterface > xDest; bAssign = extract( - pCppArgs[nPos], (typelib_InterfaceTypeDescription *)pTD, + pCppArgs[nPos], reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD), xDest, getReflection() ); if (bAssign) { *(void **)ppUnoArgs[nPos] = getReflection()->getCpp2Uno().mapInterface( - xDest.get(), (typelib_InterfaceTypeDescription *)pTD ); + xDest.get(), reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) ); } } else @@ -819,7 +819,7 @@ void InterfaceIdlClassImpl::initMembers() typelib_TypeDescription * pTD = 0; typelib_typedescriptionreference_getDescription( &pTD, ppAllMembers[nPos] ); assert(pTD && "### cannot get type description!"); - pSortedMemberInit[nIndex].first = ((typelib_InterfaceMemberTypeDescription *)pTD)->pMemberName; + pSortedMemberInit[nIndex].first = reinterpret_cast<typelib_InterfaceMemberTypeDescription *>(pTD)->pMemberName; pSortedMemberInit[nIndex].second = pTD; } |