VirtualBox

Changeset 8580 in vbox for trunk


Ignore:
Timestamp:
May 5, 2008 1:56:33 PM (17 years ago)
Author:
vboxsync
Message:

AssertMsgBreakVoid -> AssertMsgBreak.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/assert.h

    r8579 r8580  
    410410
    411411
     412/** @def AssertMsgBreak
     413 * Assert that an expression is true and breaks if it isn't.
     414 * In RT_STRICT mode it will hit a breakpoint before returning.
     415 *
     416 * @param   expr    Expression which should be true.
     417 * @param   a       printf argument list (in parenthesis).
     418 * @todo Rename to AssertMsgBreak.
     419 */
     420#ifdef RT_STRICT
     421# define AssertMsgBreak(expr, a)  \
     422    if (RT_UNLIKELY(!(expr))) \
     423    { \
     424        AssertMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
     425        AssertMsg2 a; \
     426        AssertBreakpoint(); \
     427        break; \
     428    } else do {} while (0)
     429#else
     430# define AssertMsgBreak(expr, a) \
     431    if (RT_UNLIKELY(!(expr))) \
     432        break; \
     433    else do {} while (0)
     434#endif
     435
    412436/** @def AssertMsgBreakStmt
    413437 * Assert that an expression is true and breaks if it isn't.
     
    434458    } else do {} while (0)
    435459#endif
    436 
    437 /** @def AssertMsgBreakVoid
    438  * Assert that an expression is true and breaks if it isn't.
    439  * In RT_STRICT mode it will hit a breakpoint before returning.
    440  *
    441  * @param   expr    Expression which should be true.
    442  * @param   a       printf argument list (in parenthesis).
    443  * @todo Rename to AssertMsgBreak.
    444  */
    445 #ifdef RT_STRICT
    446 # define AssertMsgBreakVoid(expr, a)  \
    447     if (RT_UNLIKELY(!(expr))) \
    448     { \
    449         AssertMsg1(#expr, __LINE__, __FILE__, __PRETTY_FUNCTION__); \
    450         AssertMsg2 a; \
    451         AssertBreakpoint(); \
    452         break; \
    453     } else do {} while (0)
    454 #else
    455 # define AssertMsgBreakVoid(expr, a) \
    456     if (RT_UNLIKELY(!(expr))) \
    457         break; \
    458     else do {} while (0)
    459 #endif
    460 
    461460
    462461/** @def AssertFailed
     
    14871486 */
    14881487#define AssertMsgRCBreakVoid(rc, msg) \
    1489     if (1) { AssertMsgBreakVoid(RT_SUCCESS(rc), msg); NOREF(rc); } else do {} while (0)
     1488    if (1) { AssertMsgBreak(RT_SUCCESS(rc), msg); NOREF(rc); } else do {} while (0)
    14901489
    14911490/** @def AssertRCSuccess
     
    15321531 * @todo Rename to AssertRCSuccessBreak.
    15331532 */
    1534 #define AssertRCSuccessBreakVoid(rc)    AssertMsgBreakVoid((rc) == VINF_SUCCESS, ("%Vra\n", (rc)))
     1533#define AssertRCSuccessBreakVoid(rc)    AssertMsgBreak((rc) == VINF_SUCCESS, ("%Vra\n", (rc)))
    15351534
    15361535
     
    19121911 * @todo Rename to AssertPtrBreak.
    19131912 */
    1914 #define AssertPtrBreakVoid(pv)  AssertMsgBreakVoid(VALID_PTR(pv), ("%p\n", (pv)))
     1913#define AssertPtrBreakVoid(pv)  AssertMsgBreak(VALID_PTR(pv), ("%p\n", (pv)))
    19151914
    19161915/** @def AssertPtrNull
     
    19501949 * @todo Rename to AssertPtrNullBreak.
    19511950 */
    1952 #define AssertPtrNullBreakVoid(pv)  AssertMsgBreakVoid(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)))
     1951#define AssertPtrNullBreakVoid(pv)  AssertMsgBreak(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)))
    19531952
    19541953/** @def AssertGCPhys32
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp

    r8565 r8580  
    673673            if (g_enmState == kClipboardState_SettingViewer)
    674674                break;
    675             AssertMsgBreakVoid(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState));
     675            AssertMsgBreak(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState));
    676676            VBoxServiceClipboardOS2Poll();
    677677            break;
     
    684684            if (g_enmState == kClipboardState_Destroying)
    685685                break; /* it's us doing the replacing, ignore. */
    686             AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));
     686            AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));
    687687            VBoxServiceClipboardOS2Destroyed();
    688688            break;
     
    693693         */
    694694        case WM_RENDERFMT:
    695             AssertMsgBreakVoid(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));
     695            AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));
    696696            VBoxServiceClipboardOS2RenderFormat(SHORT1FROMMP(mp1));
    697697            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r8567 r8580  
    10171017                qFind (storageBusChannels.begin(), storageBusChannels.end(),
    10181018                       aChannel);
    1019             AssertMsgBreakVoid (it != storageBusChannels.end(),
    1020                                 ("No value for {%s}\n", aChannel.latin1()));
     1019            AssertMsgBreak (it != storageBusChannels.end(),
     1020                            ("No value for {%s}\n", aChannel.latin1()));
    10211021            channel = (LONG) (it - storageBusChannels.begin());
    10221022            break;
     
    10681068        case KStorageBus_SATA:
    10691069        {
    1070             AssertMsgBreakVoid (aDevice == 0, ("Invalid device %d\n", aDevice));
     1070            AssertMsgBreak (aDevice == 0, ("Invalid device %d\n", aDevice));
    10711071            /* always zero so far for SATA */
    10721072            break;
     
    11051105        case KStorageBus_SATA:
    11061106        {
    1107             AssertMsgBreakVoid(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1()));
     1107            AssertMsgBreak(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1()));
    11081108            /* always zero for SATA so far. */
    11091109            break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette