diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-09-24 11:01:54 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-09-24 12:40:44 +0200 |
commit | c3d8f8742e8bc713316a7e9b2351b94b9a297b59 (patch) | |
tree | 4c339143aeac5c34f88e55e0283a53a91ce00081 /bridges | |
parent | 6ad7a76d6f5c1f9a74464a263527764d5c3d4a30 (diff) |
Simplify assertion code
...avoiding conditional blocks and variables (that need careful #if'ing to avoid
them being either undefined or unused depending on NDEBUG and OSL_DEBUG_LEVEL
combintaion)
Change-Id: Ica9fe3857694f5c0a6e9079dfff05f2e0554b781
Reviewed-on: https://gerrit.libreoffice.org/60926
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
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 f0b2f815524c..68f868238e92 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -309,19 +309,15 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); -#if OSL_DEBUG_LEVEL > 0 - typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; -#endif switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: { -#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG - // determine vtable call index - sal_Int32 nMemberPos = reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)->nPosition; - assert(nMemberPos < pTypeDescr->nAllMembers); -#endif + assert( + (reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr) + ->nPosition) + < pThis->pTypeDescr->nAllMembers); VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast< @@ -366,11 +362,10 @@ void unoInterfaceProxyDispatch( } case typelib_TypeClass_INTERFACE_METHOD: { -#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG - // determine vtable call index - sal_Int32 nMemberPos = reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)->nPosition; - assert(nMemberPos < pTypeDescr->nAllMembers); -#endif + assert( + (reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr) + ->nPosition) + < pThis->pTypeDescr->nAllMembers); VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast< |