From c3d8f8742e8bc713316a7e9b2351b94b9a297b59 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 24 Sep 2018 11:01:54 +0200 Subject: 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 --- .../source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'bridges/source/cpp_uno/gcc3_linux_x86-64') 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(pMemberDescr)->nPosition; - assert(nMemberPos < pTypeDescr->nAllMembers); -#endif + assert( + (reinterpret_cast(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(pMemberDescr)->nPosition; - assert(nMemberPos < pTypeDescr->nAllMembers); -#endif + assert( + (reinterpret_cast(pMemberDescr) + ->nPosition) + < pThis->pTypeDescr->nAllMembers); VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast< -- cgit