Index: /trunk/src/VBox/Main/include/VirtualBoxBase.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 55943)
+++ /trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 55944)
@@ -157,9 +157,11 @@
  */
 #if defined(DEBUG)
-#define ComAssert(expr)    Assert(expr)
+# define ComAssert(expr)    Assert(expr)
 #else
-#define ComAssert(expr)    \
-    do { \
-        if (RT_UNLIKELY(!(expr))) \
+# define ComAssert(expr) \
+    do { \
+        if (RT_LIKELY(!!(expr))) \
+        { /* likely */ } \
+        else \
             setError(E_FAIL, \
                      "Assertion failed: [%s] at '%s' (%d) in %s.\nPlease contact the product vendor!", \
@@ -180,7 +182,7 @@
  */
 #if defined(DEBUG)
-#define ComAssertFailed()    AssertFailed()
+# define ComAssertFailed()  AssertFailed()
 #else
-#define ComAssertFailed()    \
+# define ComAssertFailed() \
     do { \
         setError(E_FAIL, \
@@ -200,9 +202,11 @@
  */
 #if defined(DEBUG)
-#define ComAssertMsg(expr, a)  AssertMsg(expr, a)
+# define ComAssertMsg(expr, a) AssertMsg(expr, a)
 #else
-#define ComAssertMsg(expr, a)  \
-    do { \
-        if (RT_UNLIKELY(!(expr))) \
+# define ComAssertMsg(expr, a) \
+    do { \
+        if (RT_LIKELY(!!(expr))) \
+        { /* likely */ } \
+        else \
             setError(E_FAIL, \
                      "Assertion failed: [%s] at '%s' (%d) in %s.\n%s.\nPlease contact the product vendor!", \
@@ -220,7 +224,7 @@
  */
 #if defined(DEBUG)
-#define ComAssertMsgFailed(a)   AssertMsgFailed(a)
+# define ComAssertMsgFailed(a)  AssertMsgFailed(a)
 #else
-#define ComAssertMsgFailed(a) \
+# define ComAssertMsgFailed(a) \
     do { \
         setError(E_FAIL, \
@@ -239,7 +243,7 @@
  */
 #if defined(DEBUG)
-#define ComAssertRC(vrc)    AssertRC(vrc)
+# define ComAssertRC(vrc)   AssertRC(vrc)
 #else
-#define ComAssertRC(vrc)    ComAssertMsgRC(vrc, ("%Rra", vrc))
+# define ComAssertRC(vrc)   ComAssertMsgRC(vrc, ("%Rra", vrc))
 #endif
 
@@ -254,7 +258,7 @@
  */
 #if defined(DEBUG)
-#define ComAssertMsgRC(vrc, msg)    AssertMsgRC(vrc, msg)
+# define ComAssertMsgRC(vrc, msg)   AssertMsgRC(vrc, msg)
 #else
-#define ComAssertMsgRC(vrc, msg)    ComAssertMsg(RT_SUCCESS(vrc), msg)
+# define ComAssertMsgRC(vrc, msg)   ComAssertMsg(RT_SUCCESS(vrc), msg)
 #endif
 
@@ -268,7 +272,7 @@
  */
 #if defined(DEBUG)
-#define ComAssertComRC(rc)  AssertComRC(rc)
+# define ComAssertComRC(rc) AssertComRC(rc)
 #else
-#define ComAssertComRC(rc)  ComAssertMsg(SUCCEEDED(rc), ("COM RC = %Rhrc (0x%08X)", (rc), (rc)))
+# define ComAssertComRC(rc) ComAssertMsg(SUCCEEDED(rc), ("COM RC = %Rhrc (0x%08X)", (rc), (rc)))
 #endif
 
@@ -365,5 +369,7 @@
 #define CheckComArgNotNull(arg) \
     do { \
-        if (RT_UNLIKELY((arg) == NULL)) \
+        if (RT_LIKELY((arg) == NULL)) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
     } while (0)
@@ -376,5 +382,7 @@
 #define CheckComArgMaybeNull(arg) \
     do { \
-        if (RT_UNLIKELY(!RT_VALID_PTR(arg) && (arg) != NULL)) \
+        if (RT_LIKELY(RT_VALID_PTR(arg) || (arg) == NULL)) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s is an invalid pointer"), #arg); \
     } while (0)
@@ -387,5 +395,7 @@
 #define CheckComArgPointerValid(arg) \
     do { \
-        if (RT_UNLIKELY(!RT_VALID_PTR(arg))) \
+        if (RT_LIKELY(RT_VALID_PTR(arg))) \
+        { /* likely */ }\
+        else \
             return setError(E_POINTER, \
                 tr("Argument %s points to invalid memory location (%p)"), \
@@ -400,5 +410,7 @@
 #define CheckComArgSafeArrayNotNull(arg) \
     do { \
-        if (RT_UNLIKELY(ComSafeArrayInIsNull(arg))) \
+        if (RT_LIKELY(!ComSafeArrayInIsNull(arg))) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
     } while (0)
@@ -412,5 +424,7 @@
     do { \
         IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
-        if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck))) \
+        if (RT_LIKELY(RT_VALID_PTR(bstrInCheck))) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s is an invalid pointer"), #a_bstrIn); \
     } while (0)
@@ -423,5 +437,7 @@
     do { \
         IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
-        if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck) || *(bstrInCheck) == '\0')) \
+        if (RT_LIKELY(RT_VALID_PTR(bstrInCheck) && *(bstrInCheck) != '\0')) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s is empty or an invalid pointer"), #a_bstrIn); \
     } while (0)
@@ -438,5 +454,7 @@
         Guid tmpGuid(a_Arg); \
         (a_GuidVar) = tmpGuid; \
-        if (RT_UNLIKELY((a_GuidVar).isValid() == false)) \
+        if (RT_LIKELY((a_GuidVar).isValid())) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, \
                 tr("GUID argument %s is not valid (\"%ls\")"), #a_Arg, Bstr(a_Arg).raw()); \
@@ -451,5 +469,7 @@
 #define CheckComArgExpr(arg, expr) \
     do { \
-        if (RT_UNLIKELY(!(expr))) \
+        if (RT_LIKELY(!!(expr))) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, \
                 tr("Argument %s is invalid (must be %s)"), #arg, #expr); \
@@ -467,5 +487,7 @@
 #define CheckComArgExprMsg(arg, expr, msg) \
     do { \
-        if (RT_UNLIKELY(!(expr))) \
+        if (RT_LIKELY(!!(expr))) \
+        { /* likely */ }\
+        else \
             return setError(E_INVALIDARG, tr("Argument %s %s"), \
                             #arg, Utf8StrFmt msg .c_str()); \
@@ -479,5 +501,7 @@
 #define CheckComArgOutPointerValid(arg) \
     do { \
-        if (RT_UNLIKELY(!VALID_PTR(arg))) \
+        if (RT_LIKELY(RT_VALID_PTR(arg))) \
+        { /* likely */ }\
+        else \
             return setError(E_POINTER, \
                 tr("Output argument %s points to invalid memory location (%p)"), \
@@ -492,5 +516,7 @@
 #define CheckComArgOutSafeArrayPointerValid(arg) \
     do { \
-        if (RT_UNLIKELY(ComSafeArrayOutIsNull(arg))) \
+        if (RT_LIKELY(!ComSafeArrayOutIsNull(arg))) \
+        { /* likely */ }\
+        else \
             return setError(E_POINTER, \
                             tr("Output argument %s points to invalid memory location (%p)"), \
@@ -535,5 +561,5 @@
  */
 #ifdef DEBUG
-#define DebugBreakThrow(a) \
+# define DebugBreakThrow(a) \
     do { \
         RTAssertDebugBreak(); \
@@ -541,5 +567,5 @@
 } while (0)
 #else
-#define DebugBreakThrow(a) throw (a)
+# define DebugBreakThrow(a) throw (a)
 #endif
 
