diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-11-21 17:30:53 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-11-21 17:32:26 +0100 |
commit | 1276076ac8fcc84df64050f8aa194fa75386a0ea (patch) | |
tree | 258d77877c052464ff113f56355bbcc5d16e80a5 /bridges/source/cpp_uno/gcc3_linux_x86-64 | |
parent | 329742e6c9da7cd7848d92a6846e3d1249d8d9b4 (diff) |
ibridges: convert all legacy osl/diagnose.h assertions in source/cppu_uno
Change-Id: I4e78fac76b6bb4923e3b680d910afe5bb9640c33
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_x86-64')
4 files changed, 19 insertions, 31 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx index 2a6668684912..bdcc8183f56a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx @@ -54,7 +54,7 @@ #include "abi.hxx" -#include <osl/diagnose.h> +#include <sal/log.hxx> using namespace x86_64; @@ -244,10 +244,9 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c } default: -#if OSL_DEBUG_LEVEL > 1 - OSL_TRACE( "Unhandled case: pType->eTypeClass == %d", pTypeRef->eTypeClass ); -#endif - OSL_ASSERT(false); + SAL_WARN("bridges", "Unhandled case: pType->eTypeClass == " + << pTypeRef->eTypeClass); + assert(false); } return 0; /* Never reached. */ } @@ -287,10 +286,8 @@ bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool return false; break; default: -#if OSL_DEBUG_LEVEL > 1 - OSL_TRACE( "Unhandled case: classes[n] == %d", classes[n] ); -#endif - OSL_ASSERT(false); + SAL_WARN("bridges", "Unhandled case: classes[n] == " << classes[n]); + assert(false); } return true; } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index aa91f3f7ed21..1e1264356850 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -24,7 +24,6 @@ #include <rtl/alloc.h> #include <osl/mutex.hxx> -#include <osl/diagnose.h> #include <com/sun/star/uno/genfunc.hxx> #include "com/sun/star/uno/RuntimeException.hpp" @@ -121,7 +120,7 @@ static typelib_TypeClass cpp2uno_call( if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( rParam.pTypeRef ) ) // value { // Simple types must fit exactly one register on x86_64 - OSL_ASSERT( bFitsRegisters && ( ( nUsedSSE == 1 && nUsedGPR == 0 ) || ( nUsedSSE == 0 && nUsedGPR == 1 ) ) ); + assert( bFitsRegisters && ( ( nUsedSSE == 1 && nUsedGPR == 0 ) || ( nUsedSSE == 0 && nUsedGPR == 1 ) ) ); if ( nUsedSSE == 1 ) { @@ -296,7 +295,7 @@ typelib_TypeClass cpp_vtable_call( // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; - OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!\n" ); + assert(nMemberPos < pTypeDescr->nAllMembers); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); @@ -485,7 +484,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( typelib_TypeDescription * pTD = 0; TYPELIB_DANGER_GET( &pTD, type->ppMembers[ nPos ] ); - OSL_ASSERT( pTD ); + assert(pTD); if ( typelib_TypeClass_INTERFACE_ATTRIBUTE == pTD->eTypeClass ) { @@ -514,7 +513,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( x86_64::return_in_hidden_param( pMethodTD->pReturnTypeRef ) ); } else - OSL_ASSERT( false ); + assert(false); TYPELIB_DANGER_RELEASE( pTD ); } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index 92df84bded44..7c0de0ff8135 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -22,7 +22,6 @@ #include <string.h> #include <rtl/ustrbuf.hxx> -#include <osl/diagnose.h> #include <sal/log.hxx> #include <com/sun/star/uno/genfunc.hxx> @@ -51,7 +50,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) @@ -86,7 +85,7 @@ static void _GLIBCXX_CDTOR_CALLABI 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 ); @@ -111,7 +110,7 @@ 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 ); + assert(pTypeDescr); if (! pTypeDescr) { throw RuntimeException( @@ -127,7 +126,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) // avoiding locked counts rtti = x86_64::getRtti(*pTypeDescr); TYPELIB_DANGER_RELEASE( pTypeDescr ); - OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); + assert(rtti && "### no rtti for throwing exception!"); if (! rtti) { throw RuntimeException( @@ -146,10 +145,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping RuntimeException aRE( "no exception header!" ); Type const & rType = ::getCppuType( &aRE ); uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); -#if OSL_DEBUG_LEVEL > 0 - OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_FAIL( cstr.getStr() ); -#endif + SAL_WARN("bridges", aRE.Message); return; } @@ -165,10 +161,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping RuntimeException aRE( OUString("exception type not found: ") + unoName ); Type const & rType = ::getCppuType( &aRE ); uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); -#if OSL_DEBUG_LEVEL > 0 - OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_FAIL( cstr.getStr() ); -#endif + SAL_WARN("bridges", aRE.Message); } else { diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index c0da72837aa2..8f59f9fe2bda 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -24,7 +24,6 @@ #include "rtl/alloc.h" #include "rtl/ustrbuf.hxx" -#include <osl/diagnose.h> #include <com/sun/star/uno/genfunc.hxx> #include "com/sun/star/uno/RuntimeException.hpp" @@ -113,7 +112,7 @@ static void cpp_call( // Return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); + assert(pReturnTypeDescr); void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion (see below) @@ -328,7 +327,7 @@ void unoInterfaceProxyDispatch( #if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; - OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); + assert(nMemberPos < pTypeDescr->nAllMembers); #endif VtableSlot aVtableSlot( getVtableSlot( @@ -377,7 +376,7 @@ void unoInterfaceProxyDispatch( #if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; - OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); + assert(nMemberPos < pTypeDescr->nAllMembers); #endif VtableSlot aVtableSlot( getVtableSlot( |