From 41e35159786a2bcad416e3541ba90a69b9d2f0db Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 5 Jun 2014 08:13:49 +0200 Subject: cppu: remove SAL_THROW macro Change-Id: I2f1909f953846f0d0b6fb402b4beb373bba8b2a8 --- cppu/source/uno/IdentityMapping.cxx | 9 ++++--- cppu/source/uno/assign.hxx | 8 ++----- cppu/source/uno/constr.hxx | 5 +--- cppu/source/uno/copy.hxx | 7 +----- cppu/source/uno/data.cxx | 6 ----- cppu/source/uno/destr.hxx | 7 +----- cppu/source/uno/eq.hxx | 10 ++------ cppu/source/uno/lbmap.cxx | 47 +++++++++++++------------------------ cppu/source/uno/prim.hxx | 11 ++++----- 9 files changed, 32 insertions(+), 78 deletions(-) (limited to 'cppu/source/uno') diff --git a/cppu/source/uno/IdentityMapping.cxx b/cppu/source/uno/IdentityMapping.cxx index bf59a8534959..fce98bdf5966 100644 --- a/cppu/source/uno/IdentityMapping.cxx +++ b/cppu/source/uno/IdentityMapping.cxx @@ -38,12 +38,12 @@ struct IdentityMapping : public uno_Mapping extern "C" { -static void SAL_CALL s_free(uno_Mapping * pMapping) SAL_THROW(()) +static void SAL_CALL s_free(uno_Mapping * pMapping) { delete static_cast(pMapping); } -static void SAL_CALL s_acquire(uno_Mapping * pMapping) SAL_THROW(()) +static void SAL_CALL s_acquire(uno_Mapping * pMapping) { static rtl::OUString s_purpose; @@ -58,7 +58,7 @@ static void SAL_CALL s_acquire(uno_Mapping * pMapping) SAL_THROW(()) } } -static void SAL_CALL s_release(uno_Mapping * pMapping) SAL_THROW(()) +static void SAL_CALL s_release(uno_Mapping * pMapping) { if (!osl_atomic_decrement(&static_cast(pMapping )->m_nRef)) uno_revokeMapping(pMapping); @@ -68,7 +68,6 @@ static void SAL_CALL s_mapInterface(uno_Mapping * pMapping void ** ppOut, void * pInterface, SAL_UNUSED_PARAMETER struct _typelib_InterfaceTypeDescription * /*pInterfaceTypeDescr*/) - SAL_THROW(()) { *ppOut = pInterface; @@ -92,7 +91,7 @@ IdentityMapping::IdentityMapping(uno::Environment const & rEnv) } -uno_Mapping * createIdentityMapping(uno::Environment const & rEnv) SAL_THROW(()) +uno_Mapping * createIdentityMapping(uno::Environment const & rEnv) { return new IdentityMapping(rEnv); } diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx index 05c0d4a56021..28a4917b46b1 100644 --- a/cppu/source/uno/assign.hxx +++ b/cppu/source/uno/assign.hxx @@ -39,7 +39,7 @@ namespace cppu inline void _assignInterface( void ** ppDest, void * pSource, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW(()) + { _acquire( pSource, acquire ); void * const pToBeReleased = *ppDest; @@ -51,7 +51,6 @@ inline void * _queryInterface( void * pSource, typelib_TypeDescriptionReference * pDestType, uno_QueryInterfaceFunc queryInterface ) - SAL_THROW(()) { if (pSource) { @@ -65,14 +64,12 @@ inline void * _queryInterface( bool assignStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, - uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW(()); + uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ); inline bool _assignStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pTypeDescr->pBaseTypeDescription) { @@ -107,7 +104,6 @@ inline bool _assignData( void * pSource, typelib_TypeDescriptionReference * pSourceType, typelib_TypeDescription * pSourceTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pDest == pSource) return _type_equals( pDestType, pSourceType ); diff --git a/cppu/source/uno/constr.hxx b/cppu/source/uno/constr.hxx index 25859330f823..a174b805f749 100644 --- a/cppu/source/uno/constr.hxx +++ b/cppu/source/uno/constr.hxx @@ -32,13 +32,11 @@ namespace cppu void defaultConstructStruct( void * pMem, - typelib_CompoundTypeDescription * pCompType ) - SAL_THROW(()); + typelib_CompoundTypeDescription * pCompType ); inline void _defaultConstructStruct( void * pMem, typelib_CompoundTypeDescription * pTypeDescr ) - SAL_THROW(()) { if (pTypeDescr->pBaseTypeDescription) { @@ -60,7 +58,6 @@ inline void _defaultConstructData( void * pMem, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr ) - SAL_THROW(()) { switch (pType->eTypeClass) { diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx index 1113a7e9e157..55a23c14a5b3 100644 --- a/cppu/source/uno/copy.hxx +++ b/cppu/source/uno/copy.hxx @@ -54,14 +54,12 @@ inline uno_Sequence * allocSeq( void copyConstructStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, - uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW (()); + uno_AcquireFunc acquire, uno_Mapping * mapping ); inline void _copyConstructStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW (()) { if (pTypeDescr->pBaseTypeDescription) { @@ -107,7 +105,6 @@ inline void _copyConstructAnyFromData( uno_Any * pDestAny, void * pSource, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW (()) { TYPE_ACQUIRE( pType ); pDestAny->pType = pType; @@ -237,7 +234,6 @@ inline void _copyConstructAny( uno_Any * pDestAny, void * pSource, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW (()) { if (typelib_TypeClass_VOID == pType->eTypeClass) { @@ -521,7 +517,6 @@ inline void _copyConstructData( void * pDest, void * pSource, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW (()) { switch (pType->eTypeClass) { diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx index aef183cab9ed..3ef7acf9df59 100644 --- a/cppu/source/uno/data.cxx +++ b/cppu/source/uno/data.cxx @@ -117,7 +117,6 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p void defaultConstructStruct( void * pMem, typelib_CompoundTypeDescription * pCompType ) - SAL_THROW(()) { _defaultConstructStruct( pMem, pCompType ); } @@ -126,7 +125,6 @@ void copyConstructStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_AcquireFunc acquire, uno_Mapping * mapping ) - SAL_THROW(()) { _copyConstructStruct( pDest, pSource, pTypeDescr, acquire, mapping ); } @@ -135,7 +133,6 @@ void destructStruct( void * pValue, typelib_CompoundTypeDescription * pTypeDescr, uno_ReleaseFunc release ) - SAL_THROW(()) { _destructStruct( pValue, pTypeDescr, release ); } @@ -144,7 +141,6 @@ bool equalStruct( void * pDest, void *pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { return _equalStruct( pDest, pSource, pTypeDescr, queryInterface, release ); } @@ -153,7 +149,6 @@ bool assignStruct( void * pDest, void * pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW(()) { return _assignStruct( pDest, pSource, pTypeDescr, queryInterface, acquire, release ); } @@ -182,7 +177,6 @@ bool equalSequence( uno_Sequence * pDest, uno_Sequence * pSource, typelib_TypeDescriptionReference * pElementType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { return _equalSequence( pDest, pSource, pElementType, queryInterface, release ); } diff --git a/cppu/source/uno/destr.hxx b/cppu/source/uno/destr.hxx index 677f129ae550..46a71c27a9f7 100644 --- a/cppu/source/uno/destr.hxx +++ b/cppu/source/uno/destr.hxx @@ -33,14 +33,12 @@ namespace cppu void destructStruct( void * pValue, typelib_CompoundTypeDescription * pTypeDescr, - uno_ReleaseFunc release ) - SAL_THROW(()); + uno_ReleaseFunc release ); inline void _destructStruct( void * pValue, typelib_CompoundTypeDescription * pTypeDescr, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pTypeDescr->pBaseTypeDescription) { @@ -69,7 +67,6 @@ void destructSequence( inline void _destructAny( uno_Any * pAny, uno_ReleaseFunc release ) - SAL_THROW(()) { typelib_TypeDescriptionReference * pType = pAny->pType; @@ -142,7 +139,6 @@ inline sal_Int32 idestructElements( void * pElements, typelib_TypeDescriptionReference * pElementType, sal_Int32 nStartIndex, sal_Int32 nStopIndex, uno_ReleaseFunc release ) - SAL_THROW(()) { switch (pElementType->eTypeClass) { @@ -297,7 +293,6 @@ inline void _destructData( typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_ReleaseFunc release ) - SAL_THROW(()) { switch (pType->eTypeClass) { diff --git a/cppu/source/uno/eq.hxx b/cppu/source/uno/eq.hxx index 679fb3ddab82..dc064bef28b6 100644 --- a/cppu/source/uno/eq.hxx +++ b/cppu/source/uno/eq.hxx @@ -36,7 +36,6 @@ namespace cppu inline bool _equalObject( void * pI1, void * pI2, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pI1 == pI2) return true; @@ -66,14 +65,12 @@ inline bool _equalObject( bool equalStruct( void * pDest, void *pSource, typelib_CompoundTypeDescription * pTypeDescr, - uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()); + uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ); inline bool _equalStruct( void * pDest, void *pSource, typelib_CompoundTypeDescription * pTypeDescr, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pTypeDescr->pBaseTypeDescription && !equalStruct( pDest, pSource, pTypeDescr->pBaseTypeDescription, queryInterface, release )) @@ -103,14 +100,12 @@ inline bool _equalStruct( bool equalSequence( uno_Sequence * pDest, uno_Sequence * pSource, typelib_TypeDescriptionReference * pElementType, - uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()); + uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ); inline bool _equalSequence( uno_Sequence * pDest, uno_Sequence * pSource, typelib_TypeDescriptionReference * pElementType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { if (pDest == pSource) return true; @@ -269,7 +264,6 @@ inline bool _equalData( void * pSource, typelib_TypeDescriptionReference * pSourceType, uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW(()) { typelib_TypeClass eSourceTypeClass, eDestTypeClass; while (typelib_TypeClass_ANY == (eDestTypeClass = pDestType->eTypeClass)) diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index 46c1a6b21fa7..43c5d4af6e6f 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -60,39 +60,39 @@ class Mapping uno_Mapping * _pMapping; public: - inline explicit Mapping( uno_Mapping * pMapping = 0 ) SAL_THROW(()); - inline Mapping( const Mapping & rMapping ) SAL_THROW(()); - inline ~Mapping() SAL_THROW(()); - inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping ) SAL_THROW(()); - inline Mapping & SAL_CALL operator = ( const Mapping & rMapping ) SAL_THROW(()) + inline explicit Mapping( uno_Mapping * pMapping = 0 ); + inline Mapping( const Mapping & rMapping ); + inline ~Mapping(); + inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping ); + inline Mapping & SAL_CALL operator = ( const Mapping & rMapping ) { return operator = ( rMapping._pMapping ); } - inline uno_Mapping * SAL_CALL get() const SAL_THROW(()) + inline uno_Mapping * SAL_CALL get() const { return _pMapping; } - inline bool SAL_CALL is() const SAL_THROW(()) + inline bool SAL_CALL is() const { return (_pMapping != 0); } }; -inline Mapping::Mapping( uno_Mapping * pMapping ) SAL_THROW(()) +inline Mapping::Mapping( uno_Mapping * pMapping ) : _pMapping( pMapping ) { if (_pMapping) (*_pMapping->acquire)( _pMapping ); } -inline Mapping::Mapping( const Mapping & rMapping ) SAL_THROW(()) +inline Mapping::Mapping( const Mapping & rMapping ) : _pMapping( rMapping._pMapping ) { if (_pMapping) (*_pMapping->acquire)( _pMapping ); } -inline Mapping::~Mapping() SAL_THROW(()) +inline Mapping::~Mapping() { if (_pMapping) (*_pMapping->release)( _pMapping ); } -inline Mapping & Mapping::operator = ( uno_Mapping * pMapping ) SAL_THROW(()) +inline Mapping & Mapping::operator = ( uno_Mapping * pMapping ) { if (pMapping) (*pMapping->acquire)( pMapping ); @@ -113,7 +113,6 @@ struct MappingEntry MappingEntry( uno_Mapping * pMapping_, uno_freeMappingFunc freeMapping_, const OUString & rMappingName_ ) - SAL_THROW(()) : nRef( 1 ) , pMapping( pMapping_ ) , freeMapping( freeMapping_ ) @@ -123,13 +122,13 @@ struct MappingEntry struct FctOUStringHash : public std::unary_function< const OUString &, size_t > { - size_t operator()( const OUString & rKey ) const SAL_THROW(()) + size_t operator()( const OUString & rKey ) const { return (size_t)rKey.hashCode(); } }; struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t > { - size_t operator()( uno_Mapping * pKey ) const SAL_THROW(()) + size_t operator()( uno_Mapping * pKey ) const { return (size_t)pKey; } }; @@ -155,7 +154,7 @@ struct MappingsData t_OUStringSet aNegativeLibs; }; -static MappingsData & getMappingsData() SAL_THROW(()) +static MappingsData & getMappingsData() { static MappingsData * s_p = 0; if (! s_p) @@ -190,20 +189,17 @@ struct uno_Mediate_Mapping : public uno_Mapping uno_Mediate_Mapping( const Environment & rFrom_, const Environment & rTo_, const Mapping & rFrom2Uno_, const Mapping & rUno2To_, - const OUString & rAddPurpose ) - SAL_THROW(()); + const OUString & rAddPurpose ); }; extern "C" { static void SAL_CALL mediate_free( uno_Mapping * pMapping ) - SAL_THROW(()) { delete static_cast< uno_Mediate_Mapping * >( pMapping ); } static void SAL_CALL mediate_acquire( uno_Mapping * pMapping ) - SAL_THROW(()) { if (1 == osl_atomic_increment( & static_cast< uno_Mediate_Mapping * >( pMapping )->nRef )) @@ -217,7 +213,6 @@ static void SAL_CALL mediate_acquire( uno_Mapping * pMapping ) } static void SAL_CALL mediate_release( uno_Mapping * pMapping ) - SAL_THROW(()) { if (! osl_atomic_decrement( & static_cast< uno_Mediate_Mapping * >( pMapping )->nRef )) @@ -230,7 +225,6 @@ static void SAL_CALL mediate_mapInterface( uno_Mapping * pMapping, void ** ppOut, void * pInterface, typelib_InterfaceTypeDescription * pInterfaceTypeDescr ) - SAL_THROW(()) { OSL_ENSURE( pMapping && ppOut, "### null ptr!" ); if (pMapping && ppOut) @@ -266,7 +260,6 @@ uno_Mediate_Mapping::uno_Mediate_Mapping( const Environment & rFrom_, const Environment & rTo_, const Mapping & rFrom2Uno_, const Mapping & rUno2To_, const OUString & rAddPurpose_ ) - SAL_THROW(()) : nRef( 1 ) , aFrom( rFrom_ ) , aTo( rTo_ ) @@ -282,7 +275,6 @@ uno_Mediate_Mapping::uno_Mediate_Mapping( static inline OUString getMappingName( const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) - SAL_THROW(()) { OUStringBuffer aKey( 64 ); aKey.append( rAddPurpose ); @@ -300,7 +292,6 @@ static inline OUString getMappingName( static inline OUString getBridgeName( const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) - SAL_THROW(()) { OUStringBuffer aBridgeName( 16 ); if (!rAddPurpose.isEmpty()) @@ -317,7 +308,6 @@ static inline OUString getBridgeName( #ifndef DISABLE_DYNLOADING static inline void setNegativeBridge( const OUString & rBridgeName ) - SAL_THROW(()) { MappingsData & rData = getMappingsData(); MutexGuard aGuard( rData.aNegativeLibsMutex ); @@ -329,7 +319,6 @@ static inline void setNegativeBridge( const OUString & rBridgeName ) #ifdef DISABLE_DYNLOADING static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName ) - SAL_THROW(()) { if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" )) return CPPU_ENV_uno_ext_getMapping; @@ -354,7 +343,6 @@ static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName ) #else static inline oslModule loadModule( const OUString & rBridgeName ) - SAL_THROW(()) { bool bNeg; { @@ -381,7 +369,6 @@ static inline oslModule loadModule( const OUString & rBridgeName ) static Mapping loadExternalMapping( const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) - SAL_THROW(()) { OSL_ASSERT( rFrom.is() && rTo.is() ); if (rFrom.is() && rTo.is()) @@ -462,7 +449,7 @@ static Mapping loadExternalMapping( static Mapping getDirectMapping( const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose = OUString() ) - SAL_THROW(()) + { OSL_ASSERT( rFrom.is() && rTo.is() ); if (rFrom.is() && rTo.is()) @@ -492,7 +479,6 @@ static inline Mapping createMediateMapping( const Environment & rFrom, const Environment & rTo, const Mapping & rFrom2Uno, const Mapping & rUno2To, const OUString & rAddPurpose ) - SAL_THROW(()) { uno_Mapping * pRet = new uno_Mediate_Mapping( rFrom, rTo, rFrom2Uno, rUno2To, rAddPurpose ); // ref count initially 1 @@ -505,7 +491,6 @@ static inline Mapping createMediateMapping( static Mapping getMediateMapping( const Environment & rFrom, const Environment & rTo, const OUString & rAddPurpose ) - SAL_THROW(()) { Environment aUno; Mapping aUno2To; diff --git a/cppu/source/uno/prim.hxx b/cppu/source/uno/prim.hxx index d9dc6a23220d..265e2cdab2e7 100644 --- a/cppu/source/uno/prim.hxx +++ b/cppu/source/uno/prim.hxx @@ -49,7 +49,7 @@ inline void * _map( void * p, typelib_TypeDescriptionReference * pType, typelib_TypeDescription * pTypeDescr, uno_Mapping * mapping ) - SAL_THROW(()) + { void * pRet = 0; if (p) @@ -70,7 +70,7 @@ inline void * _map( return pRet; } -inline void _acquire( void * p, uno_AcquireFunc acquire ) SAL_THROW(()) +inline void _acquire( void * p, uno_AcquireFunc acquire ) { if (p) { @@ -85,7 +85,7 @@ inline void _acquire( void * p, uno_AcquireFunc acquire ) SAL_THROW(()) } } -inline void _release( void * p, uno_ReleaseFunc release ) SAL_THROW(()) +inline void _release( void * p, uno_ReleaseFunc release ) { if (p) { @@ -114,14 +114,13 @@ inline sal_uInt32 calcSeqMemSize( } -inline uno_Sequence * createEmptySequence() SAL_THROW(()) +inline uno_Sequence * createEmptySequence() { osl_atomic_increment( &g_emptySeq.nRefCount ); return &g_emptySeq; } inline typelib_TypeDescriptionReference * _getVoidType() - SAL_THROW(()) { if (! g_pVoidType) { @@ -153,7 +152,7 @@ extern "C" void * binuno_queryInterface( inline bool _type_equals( typelib_TypeDescriptionReference * pType1, typelib_TypeDescriptionReference * pType2 ) - SAL_THROW(()) + { return (pType1 == pType2 || (pType1->eTypeClass == pType2->eTypeClass && -- cgit v1.2.3