diff options
Diffstat (limited to 'cppu/source/typelib/typelib.cxx')
-rw-r--r-- | cppu/source/typelib/typelib.cxx | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index f869e795c077..4c75593558a8 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -100,7 +100,7 @@ static inline bool reallyWeak( typelib_TypeClass eTypeClass ) static inline sal_Int32 getDescriptionSize( typelib_TypeClass eTypeClass ) { - OSL_ASSERT( typelib_TypeClass_TYPEDEF != eTypeClass ); + assert( typelib_TypeClass_TYPEDEF != eTypeClass ); sal_Int32 nSize; // The reference is the description @@ -275,7 +275,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() i != ppTDR.end(); ++i ) { typelib_TypeDescriptionReference * pTDR = *i; - OSL_ASSERT( pTDR->nRefCount > pTDR->nStaticRefCount ); + assert( pTDR->nRefCount > pTDR->nStaticRefCount ); pTDR->nRefCount -= pTDR->nStaticRefCount; if( pTDR->pType && !pTDR->pType->bOnDemand ) @@ -381,7 +381,7 @@ static inline void typelib_typedescription_initTables( { typelib_TypeDescription * pM = nullptr; TYPELIB_DANGER_GET( &pM, pITD->ppAllMembers[i] ); - OSL_ASSERT( pM ); + assert( pM ); if (pM) { aReadWriteAttributes[i] = !reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(pM)->bReadOnly; @@ -457,7 +457,7 @@ void freeTypeDescription(typelib_TypeDescription const * desc) { bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { if (! (*ppTypeDescr)->bComplete) { - OSL_ASSERT( (typelib_TypeClass_STRUCT == (*ppTypeDescr)->eTypeClass || + assert( (typelib_TypeClass_STRUCT == (*ppTypeDescr)->eTypeClass || typelib_TypeClass_EXCEPTION == (*ppTypeDescr)->eTypeClass || typelib_TypeClass_ENUM == (*ppTypeDescr)->eTypeClass || typelib_TypeClass_INTERFACE == (*ppTypeDescr)->eTypeClass) && @@ -482,12 +482,12 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { { typelib_typedescriptionreference_getDescription( &pTD, reinterpret_cast<typelib_IndirectTypeDescription *>(pTD)->pType ); - OSL_ASSERT( pTD ); + assert( pTD ); if (! pTD) return false; } - OSL_ASSERT( typelib_TypeClass_TYPEDEF != pTD->eTypeClass ); + assert( typelib_TypeClass_TYPEDEF != pTD->eTypeClass ); // typedescription found // set to on demand pTD->bOnDemand = true; @@ -496,7 +496,7 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { && !pTD->bComplete && initTables) { // mandatory info from callback chain - OSL_ASSERT( reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD)->ppAllMembers ); + assert( reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD)->ppAllMembers ); // complete except of tables init typelib_typedescription_initTables( pTD ); pTD->bComplete = true; @@ -505,7 +505,7 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { // The type description is hold by the reference until // on demand is activated. ::typelib_typedescription_register( &pTD ); // replaces incomplete one - OSL_ASSERT( pTD == *ppTypeDescr ); // has to merge into existing one + assert( pTD == *ppTypeDescr ); // has to merge into existing one // insert into the chache MutexGuard aGuard( rInit.getMutex() ); @@ -520,7 +520,7 @@ bool complete(typelib_TypeDescription ** ppTypeDescr, bool initTables) { typelib_typedescription_acquire( pTD ); rInit.pCache->push_back( pTD ); - OSL_ASSERT( + assert( pTD->bComplete || (pTD->eTypeClass == typelib_TypeClass_INTERFACE && !initTables)); @@ -553,7 +553,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty( *ppRet = nullptr; } - OSL_ASSERT( typelib_TypeClass_TYPEDEF != eTypeClass ); + assert( typelib_TypeClass_TYPEDEF != eTypeClass ); typelib_TypeDescription * pRet; switch( eTypeClass ) @@ -711,7 +711,7 @@ void newTypeDescription( sal_Int32 nMembers, typelib_CompoundMember_Init * pCompoundMembers, typelib_StructMember_Init * pStructMembers) { - OSL_ASSERT( + assert( (pCompoundMembers == nullptr || pStructMembers == nullptr) && (pStructMembers == nullptr || eTypeClass == typelib_TypeClass_STRUCT)); if (typelib_TypeClass_TYPEDEF == eTypeClass) @@ -727,7 +727,7 @@ void newTypeDescription( { case typelib_TypeClass_SEQUENCE: { - OSL_ASSERT( nMembers == 0 ); + assert( nMembers == 0 ); typelib_typedescriptionreference_acquire( pType ); reinterpret_cast<typelib_IndirectTypeDescription *>(*ppRet)->pType = pType; } @@ -755,7 +755,7 @@ void newTypeDescription( pTmp->ppMemberNames = new rtl_uString *[ nMembers ]; bool polymorphic = eTypeClass == typelib_TypeClass_STRUCT && rtl::OUString::unacquired(&pTypeName).indexOf('<') >= 0; - OSL_ASSERT(!polymorphic || pStructMembers != nullptr); + assert(!polymorphic || pStructMembers != nullptr); if (polymorphic) { reinterpret_cast< typelib_StructTypeDescription * >(pTmp)-> pParameterizedTypes = new sal_Bool[nMembers]; @@ -958,11 +958,11 @@ void BaseList::calculate( e.directBaseMemberOffset = *directBaseMembers; e.base = desc; list.push_back(e); - OSL_ASSERT(desc->ppAllMembers != nullptr); + assert(desc->ppAllMembers != nullptr); members += desc->nMembers; } if (directBaseSet.insert(desc->aBase.pTypeName).second) { - OSL_ASSERT(desc->ppAllMembers != nullptr); + assert(desc->ppAllMembers != nullptr); *directBaseMembers += desc->nMembers; } } @@ -1004,10 +1004,10 @@ extern "C" void SAL_CALL typelib_typedescription_newMIInterface( &pITD->ppBaseTypes[i]), false)) { - OSL_ASSERT(false); + assert(false); return; } - OSL_ASSERT(pITD->ppBaseTypes[i] != nullptr); + assert(pITD->ppBaseTypes[i] != nullptr); } if (nBaseInterfaces > 0) { pITD->pBaseTypeDescription = pITD->ppBaseTypes[0]; @@ -1036,7 +1036,7 @@ extern "C" void SAL_CALL typelib_typedescription_newMIInterface( typelib_InterfaceTypeDescription const * pBase = i->base; typelib_InterfaceTypeDescription const * pDirectBase = pITD->ppBaseTypes[i->directBaseIndex]; - OSL_ASSERT(pBase->ppAllMembers != nullptr); + assert(pBase->ppAllMembers != nullptr); for (sal_Int32 j = 0; j < pBase->nMembers; ++j) { typelib_TypeDescriptionReference const * pDirectBaseMember = pDirectBase->ppAllMembers[i->directBaseMemberOffset + j]; @@ -1085,7 +1085,7 @@ namespace { typelib_TypeDescriptionReference ** copyExceptions( sal_Int32 count, rtl_uString ** typeNames) { - OSL_ASSERT(count >= 0); + assert(count >= 0); if (count == 0) { return nullptr; } @@ -1170,7 +1170,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod( (*ppRet)->ppExceptions = copyExceptions(nExceptions, ppExceptionNames); (*ppRet)->pInterface = pInterface; (*ppRet)->pBaseRef = nullptr; - OSL_ASSERT( + assert( (nAbsolutePosition >= pInterface->nAllMembers - pInterface->nMembers) && nAbsolutePosition < pInterface->nAllMembers); (*ppRet)->nIndex = nAbsolutePosition @@ -1242,7 +1242,7 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute( (*ppRet)->bReadOnly = bReadOnly; (*ppRet)->pInterface = pInterface; (*ppRet)->pBaseRef = nullptr; - OSL_ASSERT( + assert( (nAbsolutePosition >= pInterface->nAllMembers - pInterface->nMembers) && nAbsolutePosition < pInterface->nAllMembers); (*ppRet)->nIndex = nAbsolutePosition @@ -1283,7 +1283,7 @@ void deleteExceptions( static inline void typelib_typedescription_destructExtendedMembers( typelib_TypeDescription * pTD ) { - OSL_ASSERT( typelib_TypeClass_TYPEDEF != pTD->eTypeClass ); + assert( typelib_TypeClass_TYPEDEF != pTD->eTypeClass ); switch( pTD->eTypeClass ) { @@ -1391,7 +1391,7 @@ extern "C" void SAL_CALL typelib_typedescription_release( SAL_THROW_EXTERN_C() { sal_Int32 ref = osl_atomic_decrement( &pTD->nRefCount ); - OSL_ASSERT(ref >= 0); + assert(ref >= 0); if (0 == ref) { TypeDescriptor_Init_Impl &rInit = Init::get(); @@ -1468,10 +1468,10 @@ extern "C" void SAL_CALL typelib_typedescription_register( typelib_TypeDescriptionReference * pTDR = nullptr; typelib_typedescriptionreference_getByName( &pTDR, (*ppNewDescription)->pTypeName ); - OSL_ASSERT( (*ppNewDescription)->pWeakRef || reallyWeak( (*ppNewDescription)->eTypeClass ) ); + assert( (*ppNewDescription)->pWeakRef || reallyWeak( (*ppNewDescription)->eTypeClass ) ); if( pTDR ) { - OSL_ASSERT( (*ppNewDescription)->eTypeClass == pTDR->eTypeClass ); + assert( (*ppNewDescription)->eTypeClass == pTDR->eTypeClass ); if( pTDR->pType ) { if (reallyWeak( pTDR->eTypeClass )) @@ -1494,7 +1494,7 @@ extern "C" void SAL_CALL typelib_typedescription_register( } // take new descr pTDR->pType = *ppNewDescription; - OSL_ASSERT( ! (*ppNewDescription)->pWeakRef ); + assert( ! (*ppNewDescription)->pWeakRef ); (*ppNewDescription)->pWeakRef = pTDR; return; } @@ -1572,7 +1572,7 @@ extern "C" void SAL_CALL typelib_typedescription_register( // description is the weak itself, so register it (*rInit.pWeakMap)[pTDR->pTypeName->buffer] = pTDR; - OSL_ASSERT( static_cast<void *>(*ppNewDescription) == static_cast<void *>(pTDR) ); + assert( static_cast<void *>(*ppNewDescription) == static_cast<void *>(pTDR) ); } // By default this reference is not really weak. The reference hold the description @@ -1585,8 +1585,8 @@ extern "C" void SAL_CALL typelib_typedescription_register( pTDR->pType = *ppNewDescription; (*ppNewDescription)->pWeakRef = pTDR; - OSL_ASSERT( rtl_ustr_compare( pTDR->pTypeName->buffer, (*ppNewDescription)->pTypeName->buffer ) == 0 ); - OSL_ASSERT( pTDR->eTypeClass == (*ppNewDescription)->eTypeClass ); + assert( rtl_ustr_compare( pTDR->pTypeName->buffer, (*ppNewDescription)->pTypeName->buffer ) == 0 ); + assert( pTDR->eTypeClass == (*ppNewDescription)->eTypeClass ); } @@ -1624,7 +1624,7 @@ extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize( nSize = 0; rMaxIntegralTypeSize = 1; - OSL_ASSERT( typelib_TypeClass_TYPEDEF != pTypeDescription->eTypeClass ); + assert( typelib_TypeClass_TYPEDEF != pTypeDescription->eTypeClass ); switch( pTypeDescription->eTypeClass ) { @@ -2157,7 +2157,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_release( } rtl_uString_release( pRef->pTypeName ); - OSL_ASSERT( pRef->pType == nullptr ); + assert( pRef->pType == nullptr ); #if OSL_DEBUG_LEVEL > 0 osl_atomic_decrement( &rInit.nTypeDescriptionReferenceCount ); #endif @@ -2210,9 +2210,9 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getDescription( } typelib_typedescription_getByName( ppRet, pRef->pTypeName ); - OSL_ASSERT( !*ppRet || rtl_ustr_compare( pRef->pTypeName->buffer, (*ppRet)->pTypeName->buffer ) == 0 ); - OSL_ASSERT( !*ppRet || pRef->eTypeClass == (*ppRet)->eTypeClass ); - OSL_ASSERT( !*ppRet || pRef == (*ppRet)->pWeakRef ); + assert( !*ppRet || rtl_ustr_compare( pRef->pTypeName->buffer, (*ppRet)->pTypeName->buffer ) == 0 ); + assert( !*ppRet || pRef->eTypeClass == (*ppRet)->eTypeClass ); + assert( !*ppRet || pRef == (*ppRet)->pWeakRef ); pRef->pType = *ppRet; } |