summaryrefslogtreecommitdiff
path: root/cppu/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-03-20 11:28:15 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-03-20 11:28:15 +0000
commite5f62bd39b2b62b15883fd8de8988c7edbc77a12 (patch)
tree8d26ca7683d105918e9517d83a61ebf1058d4938 /cppu/source
parentaafbcd11fba9e21b8a96d1d4047be4281074c1f5 (diff)
INTEGRATION: CWS uno1 (1.14.22.2.4); FILE MERGED
2003/02/25 16:41:28 dbo 1.14.22.2.4.1: #107762# avoid use of generated headers; minor modifications
Diffstat (limited to 'cppu/source')
-rw-r--r--cppu/source/typelib/typelib.cxx61
1 files changed, 28 insertions, 33 deletions
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index d322fed64417..9170f2f5dde0 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: typelib.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: hr $ $Date: 2003-03-19 16:55:42 $
+ * last change: $Author: vg $ $Date: 2003-03-20 12:28:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,12 +59,6 @@
*
************************************************************************/
-#ifdef CPPU_ASSERTIONS
-#define CPPU_TRACE OSL_TRACE
-#else
-#define CPPU_TRACE
-#endif
-
#include <hash_map>
#include <list>
@@ -273,7 +267,7 @@ struct TypeDescriptor_Init_Impl
inline void callChain( typelib_TypeDescription ** ppRet, rtl_uString * pName ) SAL_THROW( () );
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
// only for debugging
sal_Int32 nTypeDescriptionCount;
sal_Int32 nCompoundTypeDescriptionCount;
@@ -376,7 +370,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () )
delete [] ppTDR;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
aIt = pWeakMap->begin();
while( aIt != pWeakMap->end() )
{
@@ -384,12 +378,12 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () )
if (pTDR)
{
OString aTypeName( OUStringToOString( pTDR->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
- CPPU_TRACE( "### remaining type: %s; ref count = %d",
- aTypeName.getStr(), pTDR->nRefCount );
+ OSL_TRACE(
+ "### remaining type: %s; ref count = %d", aTypeName.getStr(), pTDR->nRefCount );
}
else
{
- CPPU_TRACE( "### remaining null type entry!?" );
+ OSL_TRACE( "### remaining null type entry!?" );
}
++aIt;
}
@@ -398,7 +392,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () )
delete pWeakMap;
pWeakMap = 0;
}
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
OSL_ASSERT( nTypeDescriptionCount == 0 );
OSL_ASSERT( nCompoundTypeDescriptionCount == 0 );
OSL_ASSERT( nUnionTypeDescriptionCount == 0 );
@@ -498,11 +492,11 @@ static inline void typelib_typedescription_initTables(
pReadWriteAttributes[i] = !((typelib_InterfaceAttributeTypeDescription *)pM)->bReadOnly;
TYPELIB_DANGER_RELEASE( pM );
}
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
else
{
OString aStr( OUStringToOString( pITD->ppAllMembers[i]->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
- CPPU_TRACE( "\n### cannot get attribute type description: %s", aStr.getStr() );
+ OSL_TRACE( "\n### cannot get attribute type description: %s", aStr.getStr() );
}
#endif
}
@@ -569,7 +563,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_ArrayTypeDescription * pTmp = new typelib_ArrayTypeDescription();
typelib_IndirectTypeDescription * pIndirect = (typelib_IndirectTypeDescription *)pTmp;
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nArrayTypeDescriptionCount );
#endif
pIndirect->pType = 0;
@@ -583,7 +577,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
typelib_IndirectTypeDescription * pTmp = new typelib_IndirectTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nIndirectTypeDescriptionCount );
#endif
pTmp->pType = 0;
@@ -595,7 +589,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_UnionTypeDescription * pTmp;
pTmp = new typelib_UnionTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nUnionTypeDescriptionCount );
#endif
pTmp->nMembers = 0;
@@ -614,7 +608,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_CompoundTypeDescription * pTmp;
pTmp = new typelib_CompoundTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nCompoundTypeDescriptionCount );
#endif
pTmp->pBaseTypeDescription = 0;
@@ -628,7 +622,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
typelib_EnumTypeDescription * pTmp = new typelib_EnumTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nEnumTypeDescriptionCount );
#endif
pTmp->nDefaultEnumValue = 0;
@@ -642,7 +636,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
typelib_InterfaceTypeDescription * pTmp = new typelib_InterfaceTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nInterfaceTypeDescriptionCount );
#endif
pTmp->pBaseTypeDescription = 0;
@@ -660,7 +654,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
typelib_InterfaceMethodTypeDescription * pTmp = new typelib_InterfaceMethodTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nInterfaceMethodTypeDescriptionCount );
#endif
pTmp->aBase.pMemberName = 0;
@@ -676,7 +670,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
typelib_InterfaceAttributeTypeDescription * pTmp = new typelib_InterfaceAttributeTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nInterfaceAttributeTypeDescriptionCount );
#endif
pTmp->aBase.pMemberName = 0;
@@ -687,7 +681,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
default:
{
pRet = new typelib_TypeDescription();
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nTypeDescriptionCount );
#endif
}
@@ -721,7 +715,7 @@ extern "C" void SAL_CALL typelib_typedescription_new(
{
if (typelib_TypeClass_TYPEDEF == eTypeClass)
{
- CPPU_TRACE( "### unexpected typedef!" );
+ OSL_TRACE( "### unexpected typedef!" );
typelib_typedescriptionreference_getDescription( ppRet, pType );
return;
}
@@ -1258,7 +1252,7 @@ extern "C" void SAL_CALL typelib_typedescription_release(
typelib_typedescription_destructExtendedMembers( pTD );
rtl_uString_release( pTD->pTypeName );
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
switch( pTD->eTypeClass )
{
case typelib_TypeClass_ARRAY:
@@ -1809,7 +1803,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_new(
}
else if (*ppTDR)
{
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
OString aStr( OUStringToOString( pTypeName, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( !"### typedef not found: ", aStr.getStr() );
#endif
@@ -1827,7 +1821,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_new(
if( reallyWeak( eTypeClass ) )
{
typelib_TypeDescriptionReference * pTDR = new typelib_TypeDescriptionReference();
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_incrementInterlockedCount( &aInit.nTypeDescriptionReferenceCount );
#endif
pTDR->nRefCount = 1;
@@ -1885,7 +1879,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_release(
rtl_uString_release( pRef->pTypeName );
OSL_ASSERT( pRef->pType == 0 );
-#ifdef CPPU_ASSERTIONS
+#if defined DEBUG
osl_decrementInterlockedCount( &aInit.nTypeDescriptionReferenceCount );
#endif
delete pRef;
@@ -2208,9 +2202,10 @@ extern "C" sal_Bool SAL_CALL typelib_typedescription_complete(
}
else
{
-#ifdef CPPU_ASSERTIONS
- OString aStr( OUStringToOString( (*ppTypeDescr)->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
- CPPU_TRACE( "\n### type cannot be completed: %s", aStr.getStr() );
+#if defined DEBUG
+ OString aStr(
+ OUStringToOString( (*ppTypeDescr)->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_TRACE( "\n### type cannot be completed: %s", aStr.getStr() );
#endif
return sal_False;
}