summaryrefslogtreecommitdiffstats
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-24 11:01:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-24 12:40:44 +0200
commitc3d8f8742e8bc713316a7e9b2351b94b9a297b59 (patch)
tree4c339143aeac5c34f88e55e0283a53a91ce00081 /bridges
parentLooks like these functions can be static and not STDAPI (diff)
downloadcore-c3d8f8742e8bc713316a7e9b2351b94b9a297b59.tar.gz
core-c3d8f8742e8bc713316a7e9b2351b94b9a297b59.zip
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.cxx21
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<