- Timestamp:
- May 5, 2008 1:56:33 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/assert.h
r8579 r8580 410 410 411 411 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 412 436 /** @def AssertMsgBreakStmt 413 437 * Assert that an expression is true and breaks if it isn't. … … 434 458 } else do {} while (0) 435 459 #endif 436 437 /** @def AssertMsgBreakVoid438 * 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_STRICT446 # 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 #else455 # define AssertMsgBreakVoid(expr, a) \456 if (RT_UNLIKELY(!(expr))) \457 break; \458 else do {} while (0)459 #endif460 461 460 462 461 /** @def AssertFailed … … 1487 1486 */ 1488 1487 #define AssertMsgRCBreakVoid(rc, msg) \ 1489 if (1) { AssertMsgBreak Void(RT_SUCCESS(rc), msg); NOREF(rc); } else do {} while (0)1488 if (1) { AssertMsgBreak(RT_SUCCESS(rc), msg); NOREF(rc); } else do {} while (0) 1490 1489 1491 1490 /** @def AssertRCSuccess … … 1532 1531 * @todo Rename to AssertRCSuccessBreak. 1533 1532 */ 1534 #define AssertRCSuccessBreakVoid(rc) AssertMsgBreak Void((rc) == VINF_SUCCESS, ("%Vra\n", (rc)))1533 #define AssertRCSuccessBreakVoid(rc) AssertMsgBreak((rc) == VINF_SUCCESS, ("%Vra\n", (rc))) 1535 1534 1536 1535 … … 1912 1911 * @todo Rename to AssertPtrBreak. 1913 1912 */ 1914 #define AssertPtrBreakVoid(pv) AssertMsgBreak Void(VALID_PTR(pv), ("%p\n", (pv)))1913 #define AssertPtrBreakVoid(pv) AssertMsgBreak(VALID_PTR(pv), ("%p\n", (pv))) 1915 1914 1916 1915 /** @def AssertPtrNull … … 1950 1949 * @todo Rename to AssertPtrNullBreak. 1951 1950 */ 1952 #define AssertPtrNullBreakVoid(pv) AssertMsgBreak Void(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv)))1951 #define AssertPtrNullBreakVoid(pv) AssertMsgBreak(VALID_PTR(pv) || (pv) == NULL, ("%p\n", (pv))) 1953 1952 1954 1953 /** @def AssertGCPhys32 -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
r8565 r8580 673 673 if (g_enmState == kClipboardState_SettingViewer) 674 674 break; 675 AssertMsgBreak Void(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState));675 AssertMsgBreak(g_enmState == kClipboardState_Viewer, ("g_enmState=%d\n", g_enmState)); 676 676 VBoxServiceClipboardOS2Poll(); 677 677 break; … … 684 684 if (g_enmState == kClipboardState_Destroying) 685 685 break; /* it's us doing the replacing, ignore. */ 686 AssertMsgBreak Void(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));686 AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 687 687 VBoxServiceClipboardOS2Destroyed(); 688 688 break; … … 693 693 */ 694 694 case WM_RENDERFMT: 695 AssertMsgBreak Void(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState));695 AssertMsgBreak(g_enmState == kClipboardState_Owner, ("g_enmState=%d\n", g_enmState)); 696 696 VBoxServiceClipboardOS2RenderFormat(SHORT1FROMMP(mp1)); 697 697 break; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r8567 r8580 1017 1017 qFind (storageBusChannels.begin(), storageBusChannels.end(), 1018 1018 aChannel); 1019 AssertMsgBreak Void(it != storageBusChannels.end(),1020 1019 AssertMsgBreak (it != storageBusChannels.end(), 1020 ("No value for {%s}\n", aChannel.latin1())); 1021 1021 channel = (LONG) (it - storageBusChannels.begin()); 1022 1022 break; … … 1068 1068 case KStorageBus_SATA: 1069 1069 { 1070 AssertMsgBreak Void(aDevice == 0, ("Invalid device %d\n", aDevice));1070 AssertMsgBreak (aDevice == 0, ("Invalid device %d\n", aDevice)); 1071 1071 /* always zero so far for SATA */ 1072 1072 break; … … 1105 1105 case KStorageBus_SATA: 1106 1106 { 1107 AssertMsgBreak Void(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1()));1107 AssertMsgBreak(aDevice.isEmpty(), ("Invalid device {%s}\n", aDevice.latin1())); 1108 1108 /* always zero for SATA so far. */ 1109 1109 break;
Note:
See TracChangeset
for help on using the changeset viewer.