summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno/gcc3_aix_powerpc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-11-21 17:30:53 +0100
committerMichael Stahl <mstahl@redhat.com>2014-11-21 17:32:26 +0100
commit1276076ac8fcc84df64050f8aa194fa75386a0ea (patch)
tree258d77877c052464ff113f56355bbcc5d16e80a5 /bridges/source/cpp_uno/gcc3_aix_powerpc
parent329742e6c9da7cd7848d92a6846e3d1249d8d9b4 (diff)
ibridges: convert all legacy osl/diagnose.h assertions in source/cppu_uno
Change-Id: I4e78fac76b6bb4923e3b680d910afe5bb9640c33
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_aix_powerpc')
-rw-r--r--bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx10
-rw-r--r--bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx13
-rw-r--r--bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx6
3 files changed, 12 insertions, 17 deletions
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
index 5bae75ff87df..8fb27d251074 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/cpp2uno.cxx
@@ -83,7 +83,7 @@ static typelib_TypeClass cpp2uno_call(
++ovrflw;
// stack space
- OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ static_assert(sizeof(void *) == sizeof(sal_Int32), "### unexpected size!");
// parameters
void ** pUnoArgs = (void **)__builtin_alloca( 4 * sizeof(void *) * nParams );
void ** pCppArgs = pUnoArgs + nParams;
@@ -310,7 +310,7 @@ static typelib_TypeClass cpp_mediate(
void ** gpreg, double * fpreg, void ** ovrflw,
sal_uInt64 * pRegisterReturn /* space for register return */ )
{
- OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+ static_assert(sizeof(sal_Int32)==sizeof(void *), "### unexpected!");
// gpreg: [ret *], this, [other gpr params]
// fpreg: [fpr params]
@@ -350,7 +350,7 @@ static typelib_TypeClass cpp_mediate(
// determine called method
sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
- OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" );
+ assert(nMemberPos < pTypeDescr->nAllMembers);
TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
@@ -607,7 +607,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
for (sal_Int32 i = 0; i < type->nMembers; ++i) {
typelib_TypeDescription * member = 0;
TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
- OSL_ASSERT(member != 0);
+ assert(member != 0);
switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
// Getter:
@@ -640,7 +640,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
break;
default:
- OSL_ASSERT(false);
+ assert(false);
break;
}
TYPELIB_DANGER_RELEASE(member);
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
index 077afb00b085..8d743571b91b 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx
@@ -25,7 +25,6 @@
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
-#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <com/sun/star/uno/genfunc.hxx>
@@ -59,7 +58,7 @@ static OUString toUNOname( char const * p )
// example: N3com3sun4star4lang24IllegalArgumentExceptionE
OUStringBuffer buf( 64 );
- OSL_ASSERT( 'N' == *p );
+ assert( 'N' == *p );
++p; // skip N
while ('E' != *p)
@@ -147,7 +146,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
{
pair< t_rtti_map::iterator, bool > insertion(
m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
- OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" );
+ assert(insertion.second);
}
else
{
@@ -178,7 +177,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr )
pair< t_rtti_map::iterator, bool > insertion(
m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
- OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" );
+ assert(insertion.second);
}
else // taking already generated rtti
{
@@ -200,7 +199,7 @@ static void deleteException( void * pExc )
typelib_TypeDescription * pTD = 0;
OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pTD, unoName.pData );
- OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" );
+ assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!");
if (pTD)
{
::uno_destructData( pExc, pTD, cpp_release );
@@ -218,7 +217,6 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
// construct cpp exception object
typelib_TypeDescription * pTypeDescr = 0;
TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
- OSL_ASSERT( pTypeDescr );
if (! pTypeDescr)
terminate();
@@ -244,7 +242,6 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
}
rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
- OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
if (! rtti)
terminate();
}
@@ -255,14 +252,12 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
void fillUnoException( __cxa_exception * header, uno_Any * pExc, uno_Mapping * pCpp2Uno )
{
- OSL_ENSURE( header, "### no exception header!!!" );
if (! header)
terminate();
typelib_TypeDescription * pExcTypeDescr = 0;
OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
- OSL_ENSURE( pExcTypeDescr, "### can not get type description for exception!!!" );
if (! pExcTypeDescr)
terminate();
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx
index 34daa7a69da7..a879fda6f881 100644
--- a/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/uno2cpp.cxx
@@ -179,7 +179,7 @@ static void cpp_call(
// return
typelib_TypeDescription * pReturnTypeDescr = 0;
TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
- OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" );
+ assert(pReturnTypeDescr && "### expected return type description!");
void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
@@ -203,7 +203,7 @@ static void cpp_call(
INSERT_INT32(&pAdjustedThisPtr, pStack);
// stack space
- OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ static_assert( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
// args
void ** pCppArgs = (void **)__builtin_alloca( 3 * sizeof(void *) * nParams );
// indices of values this have to be converted (interface conversion cpp<=>uno)
@@ -293,7 +293,7 @@ static void cpp_call(
try
{
- OSL_ENSURE( !( (pCppStack - pCppStackStart ) & 3), "UNALIGNED STACK !!! (Please DO panic)" );
+ assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,