Kaydet (Commit) c3d8f874 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 6ad7a76d
...@@ -309,19 +309,15 @@ void unoInterfaceProxyDispatch( ...@@ -309,19 +309,15 @@ void unoInterfaceProxyDispatch(
// is my surrogate // is my surrogate
bridges::cpp_uno::shared::UnoInterfaceProxy * pThis bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
= static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI);
#if OSL_DEBUG_LEVEL > 0
typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
#endif
switch (pMemberDescr->eTypeClass) switch (pMemberDescr->eTypeClass)
{ {
case typelib_TypeClass_INTERFACE_ATTRIBUTE: case typelib_TypeClass_INTERFACE_ATTRIBUTE:
{ {
#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG assert(
// determine vtable call index (reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)
sal_Int32 nMemberPos = reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)->nPosition; ->nPosition)
assert(nMemberPos < pTypeDescr->nAllMembers); < pThis->pTypeDescr->nAllMembers);
#endif
VtableSlot aVtableSlot( VtableSlot aVtableSlot(
getVtableSlot( getVtableSlot(
reinterpret_cast< reinterpret_cast<
...@@ -366,11 +362,10 @@ void unoInterfaceProxyDispatch( ...@@ -366,11 +362,10 @@ void unoInterfaceProxyDispatch(
} }
case typelib_TypeClass_INTERFACE_METHOD: case typelib_TypeClass_INTERFACE_METHOD:
{ {
#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG assert(
// determine vtable call index (reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)
sal_Int32 nMemberPos = reinterpret_cast<typelib_InterfaceMemberTypeDescription const *>(pMemberDescr)->nPosition; ->nPosition)
assert(nMemberPos < pTypeDescr->nAllMembers); < pThis->pTypeDescr->nAllMembers);
#endif
VtableSlot aVtableSlot( VtableSlot aVtableSlot(
getVtableSlot( getVtableSlot(
reinterpret_cast< reinterpret_cast<
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment