summaryrefslogtreecommitdiff
path: root/cppu/source/typelib/typelib.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/typelib/typelib.cxx')
-rw-r--r--cppu/source/typelib/typelib.cxx109
1 files changed, 55 insertions, 54 deletions
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 3e5f2fe81df2..7bb9fb036503 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: typelib.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: dbo $ $Date: 2000-12-15 11:04:23 $
+ * last change: $Author: dbo $ $Date: 2000-12-21 14:39:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -141,7 +141,7 @@ struct AlignSize_Impl
// the value of the maximal alignment
static sal_Int32 nMaxAlignment = (sal_Int32)&((AlignSize_Impl *) 16)->dDouble - 16;
-static inline sal_Int32 adjustAlignment( sal_Int32 nRequestedAlignment )
+static inline sal_Int32 adjustAlignment( sal_Int32 nRequestedAlignment ) throw ()
{
if( nRequestedAlignment > nMaxAlignment )
nRequestedAlignment = nMaxAlignment;
@@ -151,18 +151,19 @@ static inline sal_Int32 adjustAlignment( sal_Int32 nRequestedAlignment )
/**
* Calculate the new size of the struktur.
*/
-static inline sal_Int32 newAlignedSize( sal_Int32 OldSize, sal_Int32 ElementSize, sal_Int32 NeededAlignment )
+static inline sal_Int32 newAlignedSize(
+ sal_Int32 OldSize, sal_Int32 ElementSize, sal_Int32 NeededAlignment ) throw ()
{
NeededAlignment = adjustAlignment( NeededAlignment );
return (OldSize + NeededAlignment -1) / NeededAlignment * NeededAlignment + ElementSize;
}
-inline sal_Bool reallyWeak( typelib_TypeClass eTypeClass )
+static inline sal_Bool reallyWeak( typelib_TypeClass eTypeClass ) throw ()
{
return TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK( eTypeClass );
}
-inline sal_Int32 getDescriptionSize( typelib_TypeClass eTypeClass )
+static inline sal_Int32 getDescriptionSize( typelib_TypeClass eTypeClass ) throw ()
{
OSL_ASSERT( typelib_TypeClass_TYPEDEF != eTypeClass );
@@ -210,21 +211,21 @@ inline sal_Int32 getDescriptionSize( typelib_TypeClass eTypeClass )
//-----------------------------------------------------------------------------
-void SAL_CALL typelib_typedescriptionreference_getByName(
+extern "C" void SAL_CALL typelib_typedescriptionreference_getByName(
typelib_TypeDescriptionReference ** ppRet,
- rtl_uString * pName );
+ rtl_uString * pName ) throw ();
//-----------------------------------------------------------------------------
struct equalStr_Impl
{
- sal_Bool operator()(const sal_Unicode * const & s1, const sal_Unicode * const & s2) const
+ sal_Bool operator()(const sal_Unicode * const & s1, const sal_Unicode * const & s2) const throw ()
{ return 0 == rtl_ustr_compare( s1, s2 ); }
};
//-----------------------------------------------------------------------------
struct hashStr_Impl
{
- size_t operator()(const sal_Unicode * const & s) const
+ size_t operator()(const sal_Unicode * const & s) const throw ()
{ return rtl_ustr_hashCode( s ); }
};
@@ -258,10 +259,10 @@ struct TypeDescriptor_Init_Impl
// The mutex to guard all type library accesses
Mutex * pMutex;
- inline Mutex & getMutex();
+ inline Mutex & getMutex() throw ();
inline void callChain(
- typelib_TypeDescription ** ppRet, rtl_uString * pName );
+ typelib_TypeDescription ** ppRet, rtl_uString * pName ) throw ();
#ifdef CPPU_ASSERTIONS
// only for debugging
@@ -275,10 +276,10 @@ struct TypeDescriptor_Init_Impl
sal_Int32 nInterfaceTypeDescriptionCount;
sal_Int32 nTypeDescriptionReferenceCount;
#endif
- ~TypeDescriptor_Init_Impl();
+ ~TypeDescriptor_Init_Impl() throw ();
};
//__________________________________________________________________________________________________
-inline Mutex & TypeDescriptor_Init_Impl::getMutex()
+inline Mutex & TypeDescriptor_Init_Impl::getMutex() throw ()
{
if( !pMutex )
{
@@ -290,7 +291,7 @@ inline Mutex & TypeDescriptor_Init_Impl::getMutex()
}
//__________________________________________________________________________________________________
inline void TypeDescriptor_Init_Impl::callChain(
- typelib_TypeDescription ** ppRet, rtl_uString * pName )
+ typelib_TypeDescription ** ppRet, rtl_uString * pName ) throw ()
{
if (pCallbacks)
{
@@ -313,13 +314,13 @@ inline void TypeDescriptor_Init_Impl::callChain(
// never called
#if defined(CPPU_LEAK_STATIC_DATA) && defined(__SUNPRO_CC) && (__SUNPRO_CC == 0x500)
-static void dumb_sunpro5_must_have_dtor_stl_hashmap_code_if_compiled_with_minus_g()
+static void dumb_sunpro5_must_have_dtor_stl_hashmap_code_if_compiled_with_minus_g() throw ()
{
delete (WeakMap_Impl *)0xbeef1e;
}
#endif
//__________________________________________________________________________________________________
-TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl()
+TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() throw ()
{
#ifndef CPPU_LEAK_STATIC_DATA
if( pCache )
@@ -422,7 +423,7 @@ static TypeDescriptor_Init_Impl aInit;
//------------------------------------------------------------------------
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_registerCallback(
- void * pContext, typelib_typedescription_Callback pCallback )
+ void * pContext, typelib_typedescription_Callback pCallback ) throw ()
{
// todo mt safe: guard is no solution, can not acquire while calling callback!
// OslGuard aGuard( aInit.getMutex() );
@@ -433,7 +434,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_registerCallback(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_revokeCallback(
- void * pContext, typelib_typedescription_Callback pCallback )
+ void * pContext, typelib_typedescription_Callback pCallback ) throw ()
{
if( aInit.pCallbacks )
{
@@ -460,14 +461,14 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_revokeCallback(
//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
+extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
const typelib_TypeDescription * pTypeDescription,
sal_Int32 nOffset,
- sal_Int32 & rMaxIntegralTypeSize );
+ sal_Int32 & rMaxIntegralTypeSize ) throw ();
//------------------------------------------------------------------------
-inline static void typelib_typedescription_initTables(
- typelib_TypeDescription * pTD )
+static inline void typelib_typedescription_initTables(
+ typelib_TypeDescription * pTD ) throw ()
{
typelib_InterfaceTypeDescription * pITD = (typelib_InterfaceTypeDescription *)pTD;
@@ -536,10 +537,10 @@ inline static void typelib_typedescription_initTables(
}
//------------------------------------------------------------------------
-void SAL_CALL typelib_typedescription_newEmpty(
+extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_TypeDescription ** ppRet,
typelib_TypeClass eTypeClass,
- rtl_uString * pTypeName )
+ rtl_uString * pTypeName ) throw ()
{
if( *ppRet )
{
@@ -689,7 +690,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_new(
rtl_uString * pTypeName,
typelib_TypeDescriptionReference * pType,
sal_Int32 nMembers,
- typelib_CompoundMember_Init * pMembers )
+ typelib_CompoundMember_Init * pMembers ) throw ()
{
if (typelib_TypeClass_TYPEDEF == eTypeClass)
{
@@ -769,7 +770,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newUnion(
sal_Int64 nDefaultDiscriminant,
typelib_TypeDescriptionReference * pDefaultTypeRef,
sal_Int32 nMembers,
- typelib_Union_Init * pMembers )
+ typelib_Union_Init * pMembers ) throw ()
{
typelib_typedescription_newEmpty( ppRet, typelib_TypeClass_UNION, pTypeName );
// discriminant type
@@ -820,7 +821,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newEnum(
sal_Int32 nDefaultValue,
sal_Int32 nEnumValues,
rtl_uString ** ppEnumNames,
- sal_Int32 * pEnumValues )
+ sal_Int32 * pEnumValues ) throw ()
{
typelib_typedescription_newEmpty( ppRet, typelib_TypeClass_ENUM, pTypeName );
typelib_EnumTypeDescription * pEnum = (typelib_EnumTypeDescription *)*ppRet;
@@ -848,7 +849,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newInterface(
sal_uInt32 nUik1, sal_uInt16 nUik2, sal_uInt16 nUik3, sal_uInt32 nUik4, sal_uInt32 nUik5,
typelib_TypeDescriptionReference * pBaseInterface,
sal_Int32 nMembers,
- typelib_TypeDescriptionReference ** ppMembers )
+ typelib_TypeDescriptionReference ** ppMembers ) throw ()
{
typelib_InterfaceTypeDescription * pITD = 0;
typelib_typedescription_newEmpty(
@@ -921,7 +922,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newInterfaceMetho
sal_Int32 nParams,
typelib_Parameter_Init * pParams,
sal_Int32 nExceptions,
- rtl_uString ** ppExceptionNames )
+ rtl_uString ** ppExceptionNames ) throw ()
{
typelib_typedescription_newEmpty(
(typelib_TypeDescription **)ppRet, typelib_TypeClass_INTERFACE_METHOD, pTypeName );
@@ -987,7 +988,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newInterfaceAttri
rtl_uString * pTypeName,
typelib_TypeClass eAttributeTypeClass,
rtl_uString * pAttributeTypeName,
- sal_Bool bReadOnly )
+ sal_Bool bReadOnly ) throw ()
{
typelib_typedescription_newEmpty(
(typelib_TypeDescription **)ppRet, typelib_TypeClass_INTERFACE_ATTRIBUTE, pTypeName );
@@ -1018,7 +1019,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_newInterfaceAttri
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_acquire(
- typelib_TypeDescription * pTypeDescription )
+ typelib_TypeDescription * pTypeDescription ) throw ()
{
osl_incrementInterlockedCount( &pTypeDescription->nRefCount );
}
@@ -1026,7 +1027,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_acquire(
//------------------------------------------------------------------------
// frees anything except typelib_TypeDescription base!
static inline void typelib_typedescription_destructExtendedMembers(
- typelib_TypeDescription * pTD )
+ typelib_TypeDescription * pTD ) throw ()
{
OSL_ASSERT( typelib_TypeClass_TYPEDEF != pTD->eTypeClass );
@@ -1145,7 +1146,7 @@ static inline void typelib_typedescription_destructExtendedMembers(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_release(
- typelib_TypeDescription * pTD )
+ typelib_TypeDescription * pTD ) throw ()
{
OSL_ASSERT(pTD->nRefCount > 0);
@@ -1218,7 +1219,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_release(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_register(
- typelib_TypeDescription ** ppNewDescription )
+ typelib_TypeDescription ** ppNewDescription ) throw ()
{
// connect the description with the weak reference
ClearableMutexGuard aGuard( aInit.getMutex() );
@@ -1347,8 +1348,8 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_register(
}
//------------------------------------------------------------------------
-inline static sal_Bool type_equals(
- typelib_TypeDescriptionReference * p1, typelib_TypeDescriptionReference * p2 )
+static inline sal_Bool type_equals(
+ typelib_TypeDescriptionReference * p1, typelib_TypeDescriptionReference * p2 ) throw ()
{
return (p1 == p2 ||
(p1->eTypeClass == p2->eTypeClass &&
@@ -1356,17 +1357,17 @@ inline static sal_Bool type_equals(
rtl_ustr_compare( p1->pTypeName->buffer, p2->pTypeName->buffer ) == 0));
}
extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescription_equals(
- const typelib_TypeDescription * p1, const typelib_TypeDescription * p2 )
+ const typelib_TypeDescription * p1, const typelib_TypeDescription * p2 ) throw ()
{
return type_equals(
(typelib_TypeDescriptionReference *)p1, (typelib_TypeDescriptionReference *)p2 );
}
//------------------------------------------------------------------------
-sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
+extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
const typelib_TypeDescription * pTypeDescription,
sal_Int32 nOffset,
- sal_Int32 & rMaxIntegralTypeSize )
+ sal_Int32 & rMaxIntegralTypeSize ) throw ()
{
sal_Int32 nSize;
if( pTypeDescription->nSize )
@@ -1514,7 +1515,7 @@ sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_getByName(
- typelib_TypeDescription ** ppRet, rtl_uString * pName )
+ typelib_TypeDescription ** ppRet, rtl_uString * pName ) throw ()
{
if( *ppRet )
{
@@ -1649,7 +1650,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescription_getByName(
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_newByAsciiName(
typelib_TypeDescriptionReference ** ppTDR,
typelib_TypeClass eTypeClass,
- const sal_Char * pTypeName )
+ const sal_Char * pTypeName ) throw ()
{
OUString aTypeName( OUString::createFromAscii( pTypeName ) );
typelib_typedescriptionreference_new( ppTDR, eTypeClass, aTypeName.pData );
@@ -1658,7 +1659,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_newByAsc
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_new(
typelib_TypeDescriptionReference ** ppTDR,
typelib_TypeClass eTypeClass,
- rtl_uString * pTypeName )
+ rtl_uString * pTypeName ) throw ()
{
if( eTypeClass == typelib_TypeClass_TYPEDEF )
{
@@ -1751,14 +1752,14 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_new(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_acquire(
- typelib_TypeDescriptionReference * pRef )
+ typelib_TypeDescriptionReference * pRef ) throw ()
{
osl_incrementInterlockedCount( &pRef->nRefCount );
}
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_release(
- typelib_TypeDescriptionReference * pRef )
+ typelib_TypeDescriptionReference * pRef ) throw ()
{
// Is it a type description?
if( reallyWeak( pRef->eTypeClass ) )
@@ -1793,7 +1794,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_release(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_getDescription(
typelib_TypeDescription ** ppRet,
- typelib_TypeDescriptionReference * pRef )
+ typelib_TypeDescriptionReference * pRef ) throw ()
{
if( *ppRet )
{
@@ -1840,9 +1841,9 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_getDescr
}
//------------------------------------------------------------------------
-void SAL_CALL typelib_typedescriptionreference_getByName(
+extern "C" void SAL_CALL typelib_typedescriptionreference_getByName(
typelib_TypeDescriptionReference ** ppRet,
- rtl_uString * pName )
+ rtl_uString * pName ) throw ()
{
if( *ppRet )
{
@@ -1871,7 +1872,7 @@ void SAL_CALL typelib_typedescriptionreference_getByName(
//------------------------------------------------------------------------
extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescriptionreference_equals(
const typelib_TypeDescriptionReference * p1,
- const typelib_TypeDescriptionReference * p2 )
+ const typelib_TypeDescriptionReference * p2 ) throw ()
{
return (p1 == p2 ||
(p1->eTypeClass == p2->eTypeClass &&
@@ -1882,7 +1883,7 @@ extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescriptionreference_equa
//##################################################################################################
extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_assign(
typelib_TypeDescriptionReference ** ppDest,
- typelib_TypeDescriptionReference * pSource )
+ typelib_TypeDescriptionReference * pSource ) throw ()
{
if (*ppDest != pSource)
{
@@ -1893,7 +1894,7 @@ extern "C" SAL_DLLEXPORT void SAL_CALL typelib_typedescriptionreference_assign(
}
//##################################################################################################
-extern "C" SAL_DLLEXPORT void SAL_CALL typelib_setCacheSize( sal_Int32 nNewSize )
+extern "C" SAL_DLLEXPORT void SAL_CALL typelib_setCacheSize( sal_Int32 nNewSize ) throw ()
{
OSL_ENSHURE( nNewSize >= 0, "### illegal cache size given!" );
if (nNewSize >= 0)
@@ -1931,7 +1932,7 @@ static sal_Bool s_aAssignableFromTab[11][11] =
//##################################################################################################
extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom(
typelib_TypeDescriptionReference * pAssignable,
- typelib_TypeDescriptionReference * pFrom )
+ typelib_TypeDescriptionReference * pFrom ) throw ()
{
if (pAssignable && pFrom)
{
@@ -1994,7 +1995,7 @@ extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescriptionreference_isAs
//##################################################################################################
extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescription_isAssignableFrom(
typelib_TypeDescription * pAssignable,
- typelib_TypeDescription * pFrom )
+ typelib_TypeDescription * pFrom ) throw ()
{
return typelib_typedescriptionreference_isAssignableFrom(
pAssignable->pWeakRef, pFrom->pWeakRef );
@@ -2002,7 +2003,7 @@ extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescription_isAssignableF
//##################################################################################################
extern "C" SAL_DLLEXPORT sal_Bool SAL_CALL typelib_typedescription_complete(
- typelib_TypeDescription ** ppTypeDescr )
+ typelib_TypeDescription ** ppTypeDescr ) throw ()
{
if (! (*ppTypeDescr)->bComplete)
{