summaryrefslogtreecommitdiff
path: root/bridges/source/cpp_uno/msvc_win32_x86-64
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/msvc_win32_x86-64
parent329742e6c9da7cd7848d92a6846e3d1249d8d9b4 (diff)
ibridges: convert all legacy osl/diagnose.h assertions in source/cppu_uno
Change-Id: I4e78fac76b6bb4923e3b680d910afe5bb9640c33
Diffstat (limited to 'bridges/source/cpp_uno/msvc_win32_x86-64')
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx14
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx25
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx6
3 files changed, 21 insertions, 24 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
index e4fe5be4bf48..abea68db423c 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/cpp2uno.cxx
@@ -255,7 +255,7 @@ extern "C" typelib_TypeClass cpp_vtable_call(
// Determine called method
int nMemberPos = pTD->pMapFunctionIndexToMemberIndex[nFunctionIndex];
- OSL_ENSURE( nMemberPos < pTD->nAllMembers, "### illegal member index!\n" );
+ assert(nMemberPos < pTD->nAllMembers);
TypeDescription aMemberDescr( pTD->ppAllMembers[nMemberPos] );
@@ -433,7 +433,7 @@ unsigned char * codeSnippet(
// jmp r11
*p++ = 0x41; *p++ = 0xFF; *p++ = 0xE3;
- OSL_ASSERT( p < code + codeSnippetSize );
+ assert(p < code + codeSnippetSize);
return code + codeSnippetSize;
}
@@ -491,7 +491,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
typelib_TypeDescription * pTD = NULL;
TYPELIB_DANGER_GET( &pTD, type->ppMembers[ member ] );
- OSL_ASSERT( pTD );
+ assert(pTD);
char param_kind[4];
int nr = 0;
@@ -515,7 +515,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
{
typelib_TypeDescription * pAttrTD = NULL;
TYPELIB_DANGER_GET( &pAttrTD, pIfaceAttrTD->pAttributeTypeRef );
- OSL_ASSERT( pAttrTD );
+ assert(pAttrTD);
// Setter
if ( pAttrTD->eTypeClass == typelib_TypeClass_FLOAT ||
@@ -535,7 +535,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
typelib_TypeDescription * pReturnTD = NULL;
TYPELIB_DANGER_GET( &pReturnTD, pMethodTD->pReturnTypeRef );
- OSL_ASSERT( pReturnTD );
+ assert(pReturnTD);
if ( !bridges::cpp_uno::shared::isSimpleType( pReturnTD ) )
{
@@ -548,7 +548,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
typelib_TypeDescription * pParamTD = NULL;
TYPELIB_DANGER_GET( &pParamTD, pMethodTD->pParams[param].pTypeRef );
- OSL_ASSERT( pParamTD );
+ assert(pParamTD);
if ( pParamTD->eTypeClass == typelib_TypeClass_FLOAT ||
pParamTD->eTypeClass == typelib_TypeClass_DOUBLE )
@@ -562,7 +562,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
TYPELIB_DANGER_RELEASE( pReturnTD );
}
else
- OSL_ASSERT( false );
+ assert(false);
TYPELIB_DANGER_RELEASE( pTD );
}
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index 90147a7dd858..a1c27c6948b5 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -245,6 +245,7 @@ void
#include "rtl/alloc.h"
#include "rtl/strbuf.hxx"
#include "rtl/ustrbuf.hxx"
+#include <sal/log.hxx>
#include "com/sun/star/uno/Any.hxx"
@@ -339,7 +340,7 @@ __type_info::~__type_info() throw ()
type_info * RTTInfos::getRTTI( OUString const & rUNOname ) throw ()
{
// a must be
- OSL_ENSURE( sizeof(__type_info) == sizeof(type_info), "### type info structure size differ!" );
+ static_assert(sizeof(__type_info) == sizeof(type_info), "### type info structure size differ!");
MutexGuard aGuard( _aMutex );
t_string2PtrMap::const_iterator const iFind( _allRTTI.find( rUNOname ) );
@@ -355,7 +356,7 @@ type_info * RTTInfos::getRTTI( OUString const & rUNOname ) throw ()
// put into map
pair< t_string2PtrMap::iterator, bool > insertion(
_allRTTI.insert( t_string2PtrMap::value_type( rUNOname, pRTTI ) ) );
- OSL_ENSURE( insertion.second, "### rtti insertion failed?!" );
+ assert(insertion.second && "### rtti insertion failed?!");
return (type_info *)pRTTI;
}
@@ -371,9 +372,7 @@ RTTInfos::RTTInfos() throw ()
RTTInfos::~RTTInfos() throw ()
{
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "> freeing generated RTTI infos... <" );
-#endif
+ SAL_INFO("bridges", "> freeing generated RTTI infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRTTI.begin() );
@@ -421,7 +420,7 @@ void GenerateConstructorTrampoline(
// jmp r11
*p++ = 0x41; *p++ = 0xFF; *p++ = 0xE3;
- OSL_ASSERT( p < code + codeSnippetSize );
+ assert( p < code + codeSnippetSize );
}
void GenerateDestructorTrampoline(
@@ -441,7 +440,7 @@ void GenerateDestructorTrampoline(
// jmp r11
*p++ = 0x41; *p++ = 0xFF; *p++ = 0xE3;
- OSL_ASSERT( p < code + codeSnippetSize );
+ assert( p < code + codeSnippetSize );
}
// This looks like it is the struct catchabletype above
@@ -541,7 +540,7 @@ RaiseInfo::RaiseInfo( typelib_TypeDescription * pTD )throw ()
BOOL success =
#endif
VirtualProtect( pCode, codeSize, PAGE_EXECUTE_READWRITE, &old_protect );
- OSL_ENSURE( success, "VirtualProtect() failed!" );
+ assert(success && "VirtualProtect() failed!");
::typelib_typedescription_acquire( pTD );
@@ -587,9 +586,7 @@ ExceptionInfos::ExceptionInfos() throw ()
ExceptionInfos::~ExceptionInfos() throw ()
{
-#if OSL_DEBUG_LEVEL > 1
- OSL_TRACE( "> freeing exception infos... <" );
-#endif
+ SAL_INFO("bridges", "> freeing exception infos... <");
MutexGuard aGuard( _aMutex );
for ( t_string2PtrMap::const_iterator iPos( _allRaiseInfos.begin() );
@@ -620,7 +617,7 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw
}
}
- OSL_ASSERT( pTD &&
+ assert( pTD &&
(pTD->eTypeClass == typelib_TypeClass_STRUCT ||
pTD->eTypeClass == typelib_TypeClass_EXCEPTION) );
@@ -637,7 +634,7 @@ RaiseInfo * ExceptionInfos::getRaiseInfo( typelib_TypeDescription * pTD ) throw
// Put into map
pair< t_string2PtrMap::iterator, bool > insertion(
s_pInfos->_allRaiseInfos.insert( t_string2PtrMap::value_type( rTypeName, (void *)pRaiseInfo ) ) );
- OSL_ENSURE( insertion.second, "### raise info insertion failed?!" );
+ assert(insertion.second && "### raise info insertion failed?!");
}
else
{
@@ -712,7 +709,7 @@ int mscx_filterCppException(
return EXCEPTION_CONTINUE_SEARCH;
bool rethrow = __CxxDetectRethrow( &pRecord );
- OSL_ASSERT( pRecord == pPointers->ExceptionRecord );
+ assert(pRecord == pPointers->ExceptionRecord);
if (rethrow && pRecord == pPointers->ExceptionRecord)
{
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
index 7937e649d98b..6befd6313941 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/uno2cpp.cxx
@@ -71,7 +71,7 @@ static bool cpp_call(
// Return type
typelib_TypeDescription * pReturnTD = NULL;
TYPELIB_DANGER_GET( &pReturnTD, pReturnTypeRef );
- OSL_ENSURE( pReturnTD, "### expected return type description!" );
+ assert(pReturnTD);
// 'this'
void * pAdjustedThisPtr = (void **)( pThis->getCppI() ) + aVtableSlot.offset;
@@ -309,7 +309,7 @@ void unoInterfaceProxyDispatch(
#if OSL_DEBUG_LEVEL > 0
// determine vtable call index
sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberTD)->nPosition;
- OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+ assert(nMemberPos < pTypeDescr->nAllMembers);
#endif
VtableSlot aVtableSlot(
getVtableSlot(
@@ -356,7 +356,7 @@ void unoInterfaceProxyDispatch(
#if OSL_DEBUG_LEVEL > 0
// determine vtable call index
sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberTD)->nPosition;
- OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+ assert(nMemberPos < pTypeDescr->nAllMembers);
#endif
VtableSlot aVtableSlot(
getVtableSlot(