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(
// 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<
......
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