Index: /trunk/src/VBox/Main/include/VirtualBoxBase.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 23635)
+++ /trunk/src/VBox/Main/include/VirtualBoxBase.h	(revision 23636)
@@ -138,12 +138,12 @@
  */
 #if defined (DEBUG)
-#define ComAssert(expr)    Assert (expr)
+#define ComAssert(expr)    Assert(expr)
 #else
 #define ComAssert(expr)    \
     do { \
-        if (!(expr)) \
-            setError (E_FAIL, "Assertion failed: [%s] at '%s' (%d) in %s.\n" \
-                              "Please contact the product vendor!", \
-                      #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+        if (RT_UNLIKELY(!(expr))) \
+            setError(E_FAIL, "Assertion failed: [%s] at '%s' (%d) in %s.\n" \
+                             "Please contact the product vendor!", \
+                     #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
     } while (0)
 #endif
@@ -159,13 +159,13 @@
  */
 #if defined (DEBUG)
-#define ComAssertMsg(expr, a)  AssertMsg (expr, a)
+#define ComAssertMsg(expr, a)  AssertMsg(expr, a)
 #else
 #define ComAssertMsg(expr, a)  \
     do { \
-        if (!(expr)) \
-            setError (E_FAIL, "Assertion failed: [%s] at '%s' (%d) in %s.\n" \
-                              "%s.\n" \
-                              "Please contact the product vendor!", \
-                      #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .raw()); \
+        if (RT_UNLIKELY(!(expr))) \
+            setError(E_FAIL, "Assertion failed: [%s] at '%s' (%d) in %s.\n" \
+                             "%s.\n" \
+                             "Please contact the product vendor!", \
+                     #expr, __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .raw()); \
     } while (0)
 #endif
@@ -180,7 +180,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
 
@@ -195,7 +195,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
 
@@ -212,7 +212,7 @@
 #define ComAssertFailed()   \
     do { \
-        setError (E_FAIL, "Assertion failed at '%s' (%d) in %s.\n" \
-                          "Please contact the product vendor!", \
-                  __FILE__, __LINE__, __PRETTY_FUNCTION__); \
+        setError(E_FAIL, "Assertion failed at '%s' (%d) in %s.\n" \
+                         "Please contact the product vendor!", \
+                 __FILE__, __LINE__, __PRETTY_FUNCTION__); \
     } while (0)
 #endif
@@ -231,8 +231,8 @@
 #define ComAssertMsgFailed(a)   \
     do { \
-        setError (E_FAIL, "Assertion failed at '%s' (%d) in %s.\n" \
-                          "%s.\n" \
-                          "Please contact the product vendor!", \
-                  __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .raw()); \
+        setError(E_FAIL, "Assertion failed at '%s' (%d) in %s.\n" \
+                         "%s.\n" \
+                         "Please contact the product vendor!", \
+                 __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .raw()); \
     } while (0)
 #endif
@@ -249,5 +249,5 @@
 #define ComAssertMsgFailedPos(a, file, line, func)              \
     do {                                                        \
-        AssertMsg1 ((const char *) 0, line, file, func);        \
+        AssertMsg1((const char *)0, line, file, func);          \
         AssertMsg2 a;                                           \
         AssertBreakpoint();                                     \
@@ -256,9 +256,9 @@
 #define ComAssertMsgFailedPos(a, file, line, func)              \
     do {                                                        \
-        setError (E_FAIL,                                       \
-                  "Assertion failed at '%s' (%d) in %s.\n"      \
-                  "%s.\n"                                       \
-                  "Please contact the product vendor!",         \
-                  file, line, func, Utf8StrFmt a .raw());       \
+        setError(E_FAIL,                                        \
+                 "Assertion failed at '%s' (%d) in %s.\n"       \
+                 "%s.\n"                                        \
+                 "Please contact the product vendor!",          \
+                 file, line, func, Utf8StrFmt a .raw());        \
     } while (0)
 #endif
@@ -273,7 +273,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
 
@@ -281,14 +281,14 @@
 /** Special version of ComAssert that returns ret if expr fails */
 #define ComAssertRet(expr, ret)             \
-    do { ComAssert (expr); if (!(expr)) return (ret); } while (0)
+    do { ComAssert(expr); if (!(expr)) return (ret); } while (0)
 /** Special version of ComAssertMsg that returns ret if expr fails */
 #define ComAssertMsgRet(expr, a, ret)       \
-    do { ComAssertMsg (expr, a); if (!(expr)) return (ret); } while (0)
+    do { ComAssertMsg(expr, a); if (!(expr)) return (ret); } while (0)
 /** Special version of ComAssertRC that returns ret if vrc does not succeed */
 #define ComAssertRCRet(vrc, ret)            \
-    do { ComAssertRC (vrc); if (!RT_SUCCESS (vrc)) return (ret); } while (0)
+    do { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) return (ret); } while (0)
 /** Special version of ComAssertMsgRC that returns ret if vrc does not succeed */
 #define ComAssertMsgRCRet(vrc, msg, ret)    \
-    do { ComAssertMsgRC (vrc, msg); if (!RT_SUCCESS (vrc)) return (ret); } while (0)
+    do { ComAssertMsgRC(vrc, msg); if (!RT_SUCCESS(vrc)) return (ret); } while (0)
 /** Special version of ComAssertFailed that returns ret */
 #define ComAssertFailedRet(ret)             \
@@ -296,25 +296,25 @@
 /** Special version of ComAssertMsgFailed that returns ret */
 #define ComAssertMsgFailedRet(msg, ret)     \
-    do { ComAssertMsgFailed (msg); return (ret); } while (0)
+    do { ComAssertMsgFailed(msg); return (ret); } while (0)
 /** Special version of ComAssertComRC that returns ret if rc does not succeed */
 #define ComAssertComRCRet(rc, ret)          \
-    do { ComAssertComRC (rc); if (!SUCCEEDED (rc)) return (ret); } while (0)
+    do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return (ret); } while (0)
 /** Special version of ComAssertComRC that returns rc if rc does not succeed */
 #define ComAssertComRCRetRC(rc)             \
-    do { ComAssertComRC (rc); if (!SUCCEEDED (rc)) return (rc); } while (0)
+    do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return (rc); } while (0)
 
 
 /** Special version of ComAssert that evaluates eval and breaks if expr fails */
 #define ComAssertBreak(expr, eval)                \
-    if (1) { ComAssert (expr); if (!(expr)) { eval; break; } } else do {} while (0)
+    if (1) { ComAssert(expr); if (!(expr)) { eval; break; } } else do {} while (0)
 /** Special version of ComAssertMsg that evaluates eval and breaks if expr fails */
 #define ComAssertMsgBreak(expr, a, eval)          \
-    if (1)  { ComAssertMsg (expr, a); if (!(expr)) { eval; break; } } else do {} while (0)
+    if (1)  { ComAssertMsg(expr, a); if (!(expr)) { eval; break; } } else do {} while (0)
 /** Special version of ComAssertRC that evaluates eval and breaks if vrc does not succeed */
 #define ComAssertRCBreak(vrc, eval)               \
-    if (1)  { ComAssertRC (vrc); if (!RT_SUCCESS (vrc)) { eval; break; } } else do {} while (0)
+    if (1)  { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) { eval; break; } } else do {} while (0)
 /** Special version of ComAssertMsgRC that evaluates eval and breaks if vrc does not succeed */
 #define ComAssertMsgRCBreak(vrc, msg, eval)       \
-    if (1)  { ComAssertMsgRC (vrc, msg); if (!RT_SUCCESS (vrc)) { eval; break; } } else do {} while (0)
+    if (1)  { ComAssertMsgRC(vrc, msg); if (!RT_SUCCESS(vrc)) { eval; break; } } else do {} while (0)
 /** Special version of ComAssertFailed that evaluates eval and breaks */
 #define ComAssertFailedBreak(eval)                \
@@ -325,22 +325,22 @@
 /** Special version of ComAssertComRC that evaluates eval and breaks if rc does not succeed */
 #define ComAssertComRCBreak(rc, eval)             \
-    if (1)  { ComAssertComRC (rc); if (!SUCCEEDED (rc)) { eval; break; } } else do {} while (0)
+    if (1)  { ComAssertComRC(rc); if (!SUCCEEDED(rc)) { eval; break; } } else do {} while (0)
 /** Special version of ComAssertComRC that just breaks if rc does not succeed */
 #define ComAssertComRCBreakRC(rc)                 \
-    if (1)  { ComAssertComRC (rc); if (!SUCCEEDED (rc)) { break; } } else do {} while (0)
+    if (1)  { ComAssertComRC(rc); if (!SUCCEEDED(rc)) { break; } } else do {} while (0)
 
 
 /** Special version of ComAssert that evaluates eval and throws it if expr fails */
 #define ComAssertThrow(expr, eval)                \
-    if (1) { ComAssert (expr); if (!(expr)) { throw (eval); } } else do {} while (0)
+    if (1) { ComAssert(expr); if (!(expr)) { throw (eval); } } else do {} while (0)
 /** Special version of ComAssertMsg that evaluates eval and throws it if expr fails */
 #define ComAssertMsgThrow(expr, a, eval)          \
-    if (1)  { ComAssertMsg (expr, a); if (!(expr)) { throw (eval); } } else do {} while (0)
+    if (1)  { ComAssertMsg(expr, a); if (!(expr)) { throw (eval); } } else do {} while (0)
 /** Special version of ComAssertRC that evaluates eval and throws it if vrc does not succeed */
 #define ComAssertRCThrow(vrc, eval)               \
-    if (1)  { ComAssertRC (vrc); if (!RT_SUCCESS (vrc)) { throw (eval); } } else do {} while (0)
+    if (1)  { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) { throw (eval); } } else do {} while (0)
 /** Special version of ComAssertMsgRC that evaluates eval and throws it if vrc does not succeed */
 #define ComAssertMsgRCThrow(vrc, msg, eval)       \
-    if (1)  { ComAssertMsgRC (vrc, msg); if (!RT_SUCCESS (vrc)) { throw (eval); } } else do {} while (0)
+    if (1)  { ComAssertMsgRC(vrc, msg); if (!RT_SUCCESS(vrc)) { throw (eval); } } else do {} while (0)
 /** Special version of ComAssertFailed that evaluates eval and throws it */
 #define ComAssertFailedThrow(eval)                \
@@ -351,8 +351,8 @@
 /** Special version of ComAssertComRC that evaluates eval and throws it if rc does not succeed */
 #define ComAssertComRCThrow(rc, eval)             \
-    if (1)  { ComAssertComRC (rc); if (!SUCCEEDED (rc)) { throw (eval); } } else do {} while (0)
+    if (1)  { ComAssertComRC(rc); if (!SUCCEEDED(rc)) { throw (eval); } } else do {} while (0)
 /** Special version of ComAssertComRC that just throws rc if rc does not succeed */
 #define ComAssertComRCThrowRC(rc)                 \
-    if (1)  { ComAssertComRC (rc); if (!SUCCEEDED (rc)) { throw rc; } } else do {} while (0)
+    if (1)  { ComAssertComRC(rc); if (!SUCCEEDED(rc)) { throw rc; } } else do {} while (0)
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -365,6 +365,6 @@
 #define CheckComArgNotNull(arg) \
     do { \
-        if ((arg) == NULL) \
-            return setError (E_INVALIDARG, tr ("Argument %s is NULL"), #arg); \
+        if (RT_UNLIKELY((arg) == NULL)) \
+            return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
     } while (0)
 
@@ -376,6 +376,6 @@
 #define CheckComArgSafeArrayNotNull(arg) \
     do { \
-        if (ComSafeArrayInIsNull (arg)) \
-            return setError (E_INVALIDARG, tr ("Argument %s is NULL"), #arg); \
+        if (RT_UNLIKELY(ComSafeArrayInIsNull(arg))) \
+            return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
     } while (0)
 
@@ -387,7 +387,7 @@
 #define CheckComArgStrNotEmptyOrNull(arg) \
     do { \
-        if ((arg) == NULL || *(arg) == '\0') \
-            return setError (E_INVALIDARG, \
-                tr ("Argument %s is empty or NULL"), #arg); \
+        if (RT_UNLIKELY((arg) == NULL || *(arg) == '\0')) \
+            return setError(E_INVALIDARG, \
+                tr("Argument %s is empty or NULL"), #arg); \
     } while (0)
 
@@ -400,7 +400,7 @@
 #define CheckComArgExpr(arg, expr) \
     do { \
-        if (!(expr)) \
-            return setError (E_INVALIDARG, \
-                tr ("Argument %s is invalid (must be %s)"), #arg, #expr); \
+        if (RT_UNLIKELY(!(expr))) \
+            return setError(E_INVALIDARG, \
+                tr("Argument %s is invalid (must be %s)"), #arg, #expr); \
     } while (0)
 
@@ -416,7 +416,7 @@
 #define CheckComArgExprMsg(arg, expr, msg) \
     do { \
-        if (!(expr)) \
-            return setError (E_INVALIDARG, tr ("Argument %s %s"), \
-                             #arg, Utf8StrFmt msg .raw()); \
+        if (RT_UNLIKELY(!(expr))) \
+            return setError(E_INVALIDARG, tr ("Argument %s %s"), \
+                            #arg, Utf8StrFmt msg .raw()); \
     } while (0)
 
@@ -428,7 +428,7 @@
 #define CheckComArgOutPointerValid(arg) \
     do { \
-        if (!VALID_PTR (arg)) \
-            return setError (E_POINTER, \
-                tr ("Output argument %s points to invalid memory location (%p)"), \
+        if (RT_UNLIKELY(!VALID_PTR(arg))) \
+            return setError(E_POINTER, \
+                tr("Output argument %s points to invalid memory location (%p)"), \
                 #arg, (void *) (arg)); \
     } while (0)
@@ -441,7 +441,7 @@
 #define CheckComArgOutSafeArrayPointerValid(arg) \
     do { \
-        if (ComSafeArrayOutIsNull (arg)) \
-            return setError (E_POINTER, \
-                tr ("Output argument %s points to invalid memory location (%p)"), \
+        if (RT_UNLIKELY(ComSafeArrayOutIsNull(arg))) \
+            return setError(E_POINTER, \
+                tr("Output argument %s points to invalid memory location (%p)"), \
                 #arg, (void *) (arg)); \
     } while (0)
@@ -452,5 +452,5 @@
 #define ReturnComNotImplemented() \
     do { \
-        return setError (E_NOTIMPL, tr ("Method %s is not implemented"), __FUNCTION__); \
+        return setError(E_NOTIMPL, tr("Method %s is not implemented"), __FUNCTION__); \
     } while (0)
 
@@ -584,5 +584,5 @@
     virtual void uninit() {}
 
-    virtual HRESULT addCaller (State *aState = NULL, bool aLimited = false);
+    virtual HRESULT addCaller(State *aState = NULL, bool aLimited = false);
     virtual void releaseCaller();
 
@@ -592,7 +592,7 @@
      * better self-descriptiveness. See #addCaller() for more info.
      */
-    HRESULT addLimitedCaller (State *aState = NULL)
-    {
-        return addCaller (aState, true /* aLimited */);
+    HRESULT addLimitedCaller(State *aState = NULL)
+    {
+        return addCaller(aState, true /* aLimited */);
     }
 
@@ -619,5 +619,5 @@
      *       self-descriptiveness.
      */
-    template <bool aLimited>
+    template<bool aLimited>
     class AutoCallerBase
     {
@@ -633,11 +633,11 @@
          *                  NotReady).
          */
-        AutoCallerBase (VirtualBoxBaseProto *aObj)
-            : mObj (aObj)
-            , mRC (S_OK)
-            , mState (NotReady)
+        AutoCallerBase(VirtualBoxBaseProto *aObj)
+            : mObj(aObj)
+            , mRC(S_OK)
+            , mState(NotReady)
         {
             if (mObj)
-                mRC =  mObj->addCaller (&mState, aLimited);
+                mRC = mObj->addCaller(&mState, aLimited);
         }
 
@@ -648,5 +648,5 @@
         ~AutoCallerBase()
         {
-            if (mObj && SUCCEEDED (mRC))
+            if (mObj && SUCCEEDED(mRC))
                 mObj->releaseCaller();
         }
@@ -663,5 +663,5 @@
          * |true| means the number of callers was successfully increased.
          */
-        bool isOk() const { return SUCCEEDED (mRC); }
+        bool isOk() const { return SUCCEEDED(mRC); }
 
         /**
@@ -678,6 +678,6 @@
         void release()
         {
-            Assert (SUCCEEDED (mRC));
-            if (SUCCEEDED (mRC))
+            Assert(SUCCEEDED(mRC));
+            if (SUCCEEDED(mRC))
             {
                 if (mObj)
@@ -693,7 +693,7 @@
         void add()
         {
-            Assert (!SUCCEEDED (mRC));
-            if (mObj && !SUCCEEDED (mRC))
-                mRC = mObj->addCaller (&mState, aLimited);
+            Assert(!SUCCEEDED(mRC));
+            if (mObj && !SUCCEEDED(mRC))
+                mRC = mObj->addCaller(&mState, aLimited);
         }
 
@@ -704,10 +704,10 @@
          * @param aObj  New object to attach, may be @c NULL.
          */
-        void attach (VirtualBoxBaseProto *aObj)
+        void attach(VirtualBoxBaseProto *aObj)
         {
             /* detect simple self-reattachment */
             if (mObj != aObj)
             {
-                if (mObj && SUCCEEDED (mRC))
+                if (mObj && SUCCEEDED(mRC))
                     release();
                 mObj = aObj;
@@ -717,10 +717,10 @@
 
         /** Verbose equivalent to <tt>attach (NULL)</tt>. */
-        void detach() { attach (NULL); }
+        void detach() { attach(NULL); }
 
     private:
 
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoCallerBase)
-        DECLARE_CLS_NEW_DELETE_NOOP (AutoCallerBase)
+        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoCallerBase)
+        DECLARE_CLS_NEW_DELETE_NOOP(AutoCallerBase)
 
         VirtualBoxBaseProto *mObj;
@@ -752,5 +752,5 @@
      * See AutoCallerBase for more information about auto caller functionality.
      */
-    typedef AutoCallerBase <false> AutoCaller;
+    typedef AutoCallerBase<false> AutoCaller;
 
     /**
@@ -777,5 +777,5 @@
      * See AutoCallerBase for more information about auto caller functionality.
      */
-    typedef AutoCallerBase <true> AutoLimitedCaller;
+    typedef AutoCallerBase<true> AutoLimitedCaller;
 
 protected:
@@ -836,5 +836,5 @@
         enum Result { Failed = 0x0, Succeeded = 0x1, Limited = 0x2 };
 
-        AutoInitSpan (VirtualBoxBaseProto *aObj, Result aResult = Failed);
+        AutoInitSpan(VirtualBoxBaseProto *aObj, Result aResult = Failed);
         ~AutoInitSpan();
 
@@ -873,6 +873,6 @@
     private:
 
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoInitSpan)
-        DECLARE_CLS_NEW_DELETE_NOOP (AutoInitSpan)
+        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoInitSpan)
+        DECLARE_CLS_NEW_DELETE_NOOP(AutoInitSpan)
 
         VirtualBoxBaseProto *mObj;
@@ -930,5 +930,5 @@
     public:
 
-        AutoReinitSpan (VirtualBoxBaseProto *aObj);
+        AutoReinitSpan(VirtualBoxBaseProto *aObj);
         ~AutoReinitSpan();
 
@@ -948,6 +948,6 @@
     private:
 
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoReinitSpan)
-        DECLARE_CLS_NEW_DELETE_NOOP (AutoReinitSpan)
+        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoReinitSpan)
+        DECLARE_CLS_NEW_DELETE_NOOP(AutoReinitSpan)
 
         VirtualBoxBaseProto *mObj;
@@ -999,5 +999,5 @@
     public:
 
-        AutoUninitSpan (VirtualBoxBaseProto *aObj);
+        AutoUninitSpan(VirtualBoxBaseProto *aObj);
         ~AutoUninitSpan();
 
@@ -1010,6 +1010,6 @@
     private:
 
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoUninitSpan)
-        DECLARE_CLS_NEW_DELETE_NOOP (AutoUninitSpan)
+        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoUninitSpan)
+        DECLARE_CLS_NEW_DELETE_NOOP(AutoUninitSpan)
 
         VirtualBoxBaseProto *mObj;
@@ -1070,5 +1070,5 @@
     public:
 
-        AutoMayUninitSpan (VirtualBoxBaseProto *aObj);
+        AutoMayUninitSpan(VirtualBoxBaseProto *aObj);
         ~AutoMayUninitSpan();
 
@@ -1095,6 +1095,6 @@
     private:
 
-        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP (AutoMayUninitSpan)
-        DECLARE_CLS_NEW_DELETE_NOOP (AutoMayUninitSpan)
+        DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoMayUninitSpan)
+        DECLARE_CLS_NEW_DELETE_NOOP(AutoMayUninitSpan)
 
         VirtualBoxBaseProto *mObj;
@@ -1115,7 +1115,7 @@
 private:
 
-    void setState (State aState)
-    {
-        Assert (mState != aState);
+    void setState(State aState)
+    {
+        Assert(mState != aState);
         mState = aState;
         mStateChangeThread = RTThreadSelf();
@@ -1160,15 +1160,15 @@
  */
 #define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(C) \
-    virtual HRESULT addCaller (VirtualBoxBaseProto::State *aState = NULL, \
-                               bool aLimited = false) \
+    virtual HRESULT addCaller(VirtualBoxBaseProto::State *aState = NULL, \
+                              bool aLimited = false) \
     { \
         VirtualBoxBaseProto::State state; \
-        HRESULT rc = VirtualBoxBaseProto::addCaller (&state, aLimited); \
-        if (FAILED (rc)) \
+        HRESULT rc = VirtualBoxBaseProto::addCaller(&state, aLimited); \
+        if (FAILED(rc)) \
         { \
             if (state == VirtualBoxBaseProto::Limited) \
-                rc = setError (rc, tr ("The object functionality is limited")); \
+                rc = setError(rc, tr("The object functionality is limited")); \
             else \
-                rc = setError (rc, tr ("The object is not ready")); \
+                rc = setError(rc, tr("The object is not ready")); \
         } \
         if (aState) \
@@ -1181,5 +1181,5 @@
 class ATL_NO_VTABLE VirtualBoxBase
     : virtual public VirtualBoxBaseProto
-    , public CComObjectRootEx <CComMultiThreadModel>
+    , public CComObjectRootEx<CComMultiThreadModel>
 {
 
@@ -1201,6 +1201,6 @@
     {}
 
-    static const char *translate (const char *context, const char *sourceText,
-                                  const char *comment = 0);
+    static const char *translate(const char *context, const char *sourceText,
+                                 const char *comment = 0);
 };
 
@@ -1211,5 +1211,5 @@
 {
 protected:
-    static bool cutClassNameFrom__PRETTY_FUNCTION__ (char *aPrettyFunctionName);
+    static bool cutClassNameFrom__PRETTY_FUNCTION__(char *aPrettyFunctionName);
 };
 
@@ -1236,5 +1236,5 @@
  *       ambiguity of the #tr() function).
  */
-template <class C>
+template<class C>
 class VirtualBoxSupportTranslation : virtual protected VirtualBoxSupportTranslationBase
 {
@@ -1254,8 +1254,8 @@
      *      specified context.
      */
-    inline static const char *tr (const char *aSourceText,
-                                  const char *aComment = NULL)
-    {
-        return VirtualBoxBase::translate (className(), aSourceText, aComment);
+    inline static const char *tr(const char *aSourceText,
+                                 const char *aComment = NULL)
+    {
+        return VirtualBoxBase::translate(className(), aSourceText, aComment);
     }
 
@@ -1264,9 +1264,9 @@
     static const char *className()
     {
-        static char fn [sizeof (__PRETTY_FUNCTION__) + 1];
+        static char fn[sizeof(__PRETTY_FUNCTION__) + 1];
         if (!sClassName)
         {
-            strcpy (fn, __PRETTY_FUNCTION__);
-            cutClassNameFrom__PRETTY_FUNCTION__ (fn);
+            strcpy(fn, __PRETTY_FUNCTION__);
+            cutClassNameFrom__PRETTY_FUNCTION__(fn);
             sClassName = fn;
         }
@@ -1279,5 +1279,5 @@
 };
 
-template <class C>
+template<class C>
 const char *VirtualBoxSupportTranslation<C>::sClassName = NULL;
 
@@ -1292,8 +1292,8 @@
  */
 #define VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE(C) \
-    inline static const char *tr (const char *aSourceText, \
-                                  const char *aComment = NULL) \
+    inline static const char *tr(const char *aSourceText, \
+                                 const char *aComment = NULL) \
     { \
-        return VirtualBoxSupportTranslation<C>::tr (aSourceText, aComment); \
+        return VirtualBoxSupportTranslation<C>::tr(aSourceText, aComment); \
     }
 
@@ -1314,7 +1314,7 @@
 class VirtualBoxSupportErrorInfoImplBase
 {
-    static HRESULT setErrorInternal (HRESULT aResultCode, const GUID &aIID,
-                                     const Bstr &aComponent, const Bstr &aText,
-                                     bool aWarning, bool aLogIt);
+    static HRESULT setErrorInternal(HRESULT aResultCode, const GUID &aIID,
+                                    const Bstr &aComponent, const Bstr &aText,
+                                    bool aWarning, bool aLogIt);
 
 protected:
@@ -1401,7 +1401,7 @@
          * @copydoc com::FWResult::FWResult().
          */
-        MultiResult (HRESULT aRC = E_FAIL) : FWResult (aRC) { init(); }
-
-        MultiResult (const MultiResult &aThat) : FWResult (aThat)
+        MultiResult(HRESULT aRC = E_FAIL) : FWResult(aRC) { init(); }
+
+        MultiResult(const MultiResult &aThat) : FWResult(aThat)
         {
             /* We need this copy constructor only for GCC that wants to have
@@ -1415,11 +1415,11 @@
         ~MultiResult();
 
-        MultiResult &operator= (HRESULT aRC)
+        MultiResult &operator=(HRESULT aRC)
         {
-            com::FWResult::operator= (aRC);
+            com::FWResult::operator=(aRC);
             return *this;
         }
 
-        MultiResult &operator= (const MultiResult &aThat)
+        MultiResult &operator=(const MultiResult &aThat)
         {
             /* We need this copy constructor only for GCC that wants to have
@@ -1428,5 +1428,5 @@
              * temporary and call the other constructor directly instead. */
             AssertFailed();
-            com::FWResult::operator= (aThat);
+            com::FWResult::operator=(aThat);
             return *this;
         }
@@ -1434,5 +1434,5 @@
     private:
 
-        DECLARE_CLS_NEW_DELETE_NOOP (MultiResult)
+        DECLARE_CLS_NEW_DELETE_NOOP(MultiResult)
 
         void init();
@@ -1443,37 +1443,37 @@
     };
 
-    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
-                             const Bstr &aComponent,
-                             const Bstr &aText,
-                             bool aLogIt = true)
-    {
-        return setErrorInternal (aResultCode, aIID, aComponent, aText,
-                                 false /* aWarning */, aLogIt);
-    }
-
-    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
-                               const Bstr &aComponent,
-                               const Bstr &aText)
-    {
-        return setErrorInternal (aResultCode, aIID, aComponent, aText,
-                                 true /* aWarning */, true /* aLogIt */);
-    }
-
-    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
-                             const Bstr &aComponent,
-                             const char *aText, va_list aArgs, bool aLogIt = true)
-    {
-        return setErrorInternal (aResultCode, aIID, aComponent,
-                                 Utf8StrFmtVA (aText, aArgs),
-                                 false /* aWarning */, aLogIt);
-    }
-
-    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
-                               const Bstr &aComponent,
-                               const char *aText, va_list aArgs)
-    {
-        return setErrorInternal (aResultCode, aIID, aComponent,
-                                 Utf8StrFmtVA (aText, aArgs),
-                                 true /* aWarning */, true /* aLogIt */);
+    static HRESULT setError(HRESULT aResultCode, const GUID &aIID,
+                            const Bstr &aComponent,
+                            const Bstr &aText,
+                            bool aLogIt = true)
+    {
+        return setErrorInternal(aResultCode, aIID, aComponent, aText,
+                                false /* aWarning */, aLogIt);
+    }
+
+    static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID,
+                              const Bstr &aComponent,
+                              const Bstr &aText)
+    {
+        return setErrorInternal(aResultCode, aIID, aComponent, aText,
+                                true /* aWarning */, true /* aLogIt */);
+    }
+
+    static HRESULT setError(HRESULT aResultCode, const GUID &aIID,
+                            const Bstr &aComponent,
+                            const char *aText, va_list aArgs, bool aLogIt = true)
+    {
+        return setErrorInternal(aResultCode, aIID, aComponent,
+                                Utf8StrFmtVA (aText, aArgs),
+                                false /* aWarning */, aLogIt);
+    }
+
+    static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID,
+                              const Bstr &aComponent,
+                              const char *aText, va_list aArgs)
+    {
+        return setErrorInternal(aResultCode, aIID, aComponent,
+                                Utf8StrFmtVA (aText, aArgs),
+                                true /* aWarning */, true /* aLogIt */);
     }
 };
@@ -1503,5 +1503,5 @@
  */
 /// @todo switch to com::SupportErrorInfo* and remove
-template <class C, class I>
+template<class C, class I>
 class ATL_NO_VTABLE VirtualBoxSupportErrorInfoImpl
     : protected VirtualBoxSupportErrorInfoImplBase
@@ -1514,8 +1514,8 @@
 
 #if !defined (VBOX_WITH_XPCOM)
-    STDMETHOD(InterfaceSupportsErrorInfo) (REFIID riid)
+    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid)
     {
         const _ATL_INTMAP_ENTRY* pEntries = C::_GetEntries();
-        Assert (pEntries);
+        Assert(pEntries);
         if (!pEntries)
             return S_FALSE;
@@ -1530,15 +1530,15 @@
                 // skip the com map entries until ISupportErrorInfo is found
                 bISupportErrorInfoFound =
-                    InlineIsEqualGUID (*(pEntries->piid), IID_ISupportErrorInfo);
+                    InlineIsEqualGUID(*(pEntries->piid), IID_ISupportErrorInfo);
             }
             else
             {
                 // look for the requested interface in the rest of the com map
-                bSupports = InlineIsEqualGUID (*(pEntries->piid), riid);
+                bSupports = InlineIsEqualGUID(*(pEntries->piid), riid);
             }
             pEntries++;
         }
 
-        Assert (bISupportErrorInfoFound);
+        Assert(bISupportErrorInfoFound);
 
         return bSupports ? S_OK : S_FALSE;
@@ -1588,13 +1588,13 @@
      *      error argument.
      */
-    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
-                             const wchar_t *aComponent,
-                             const char *aText, ...)
+    static HRESULT setError(HRESULT aResultCode, const GUID &aIID,
+                            const wchar_t *aComponent,
+                            const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, aIID, aComponent, aText, args, true /* aLogIt */);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, aIID, aComponent, aText, args, true /* aLogIt */);
+        va_end(args);
         return rc;
     }
@@ -1609,13 +1609,13 @@
      *  behavior may be non-standard on some COM platforms.
      */
-    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
-                               const wchar_t *aComponent,
-                               const char *aText, ...)
+    static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID,
+                              const wchar_t *aComponent,
+                              const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
-            (aResultCode, aIID, aComponent, aText, args);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(
+            aResultCode, aIID, aComponent, aText, args);
+        va_end(args);
         return rc;
     }
@@ -1644,11 +1644,11 @@
      *  </code>
      */
-    static HRESULT setError (HRESULT aResultCode, const char *aText, ...)
+    static HRESULT setError(HRESULT aResultCode, const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, true /* aLogIt */);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, true /* aLogIt */);
+        va_end(args);
         return rc;
     }
@@ -1663,11 +1663,11 @@
      *  behavior may be non-standard on some COM platforms.
      */
-    static HRESULT setWarning (HRESULT aResultCode, const char *aText, ...)
+    static HRESULT setWarning(HRESULT aResultCode, const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args);
+        va_end(args);
         return rc;
     }
@@ -1682,9 +1682,9 @@
      *  and #setError (HRESULT, const char *, ...)  for details.
      */
-    static HRESULT setErrorV (HRESULT aResultCode, const char *aText,
-                              va_list aArgs)
-    {
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs, true /* aLogIt */);
+    static HRESULT setErrorV(HRESULT aResultCode, const char *aText,
+                             va_list aArgs)
+    {
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs, true /* aLogIt */);
         return rc;
     }
@@ -1699,9 +1699,9 @@
      *  behavior may be non-standard on some COM platforms.
      */
-    static HRESULT setWarningV (HRESULT aResultCode, const char *aText,
-                                va_list aArgs)
-    {
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs);
+    static HRESULT setWarningV(HRESULT aResultCode, const char *aText,
+                               va_list aArgs)
+    {
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, aArgs);
         return rc;
     }
@@ -1719,8 +1719,8 @@
      *  and #setError (HRESULT, const char *, ...)  for details.
      */
-    static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
-    {
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, true /* aLogIt */);
+    static HRESULT setErrorBstr(HRESULT aResultCode, const Bstr &aText)
+    {
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, true /* aLogIt */);
         return rc;
     }
@@ -1735,8 +1735,8 @@
      *  behavior may be non-standard on some COM platforms.
      */
-    static HRESULT setWarningBstr (HRESULT aResultCode, const Bstr &aText)
-    {
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText);
+    static HRESULT setWarningBstr(HRESULT aResultCode, const Bstr &aText)
+    {
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText);
         return rc;
     }
@@ -1751,12 +1751,12 @@
      *  for details.
      */
-    static HRESULT setError (HRESULT aResultCode, const GUID &aIID,
-                             const char *aText, ...)
+    static HRESULT setError(HRESULT aResultCode, const GUID &aIID,
+                            const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, aIID, C::getComponentName(), aText, args, true /* aLogIt */);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, aIID, C::getComponentName(), aText, args, true /* aLogIt */);
+        va_end(args);
         return rc;
     }
@@ -1771,12 +1771,12 @@
      *  behavior may be non-standard on some COM platforms.
      */
-    static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID,
-                               const char *aText, ...)
+    static HRESULT setWarning(HRESULT aResultCode, const GUID &aIID,
+                              const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning
-            (aResultCode, aIID, C::getComponentName(), aText, args);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setWarning(
+            aResultCode, aIID, C::getComponentName(), aText, args);
+        va_end(args);
         return rc;
     }
@@ -1789,11 +1789,11 @@
      *  It is otherwise identical to #setError (HRESULT, const char *text, ...).
      */
-    static HRESULT setErrorNoLog (HRESULT aResultCode, const char *aText, ...)
+    static HRESULT setErrorNoLog(HRESULT aResultCode, const char *aText, ...)
     {
         va_list args;
-        va_start (args, aText);
-        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError
-            (aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, false /* aLogIt */);
-        va_end (args);
+        va_start(args, aText);
+        HRESULT rc = VirtualBoxSupportErrorInfoImplBase::setError(
+            aResultCode, COM_IIDOF(I), C::getComponentName(), aText, args, false /* aLogIt */);
+        va_end(args);
         return rc;
     }
@@ -1901,9 +1901,9 @@
      * @note Locks #childrenLock() for writing.
      */
-    template <class C>
-    void addDependentChild (C *aChild)
-    {
-        AssertReturnVoid (aChild != NULL);
-        doAddDependentChild (ComPtr<IUnknown> (aChild), aChild);
+    template<class C>
+    void addDependentChild(C *aChild)
+    {
+        AssertReturnVoid(aChild != NULL);
+        doAddDependentChild(ComPtr<IUnknown>(aChild), aChild);
     }
 
@@ -1912,9 +1912,9 @@
      * but takes a ComObjPtr<C> argument.
      */
-    template <class C>
-    void addDependentChild (const ComObjPtr<C> &aChild)
-    {
-        AssertReturnVoid (!aChild.isNull());
-        doAddDependentChild (ComPtr<IUnknown> (static_cast <C *> (aChild)), aChild);
+    template<class C>
+    void addDependentChild(const ComObjPtr<C> &aChild)
+    {
+        AssertReturnVoid(!aChild.isNull());
+        doAddDependentChild(ComPtr<IUnknown>(static_cast<C *>(aChild)), aChild);
     }
 
@@ -1946,9 +1946,9 @@
      * @note Locks #childrenLock() for writing.
      */
-    template <class C>
-    void removeDependentChild (C *aChild)
-    {
-        AssertReturnVoid (aChild != NULL);
-        doRemoveDependentChild (ComPtr<IUnknown> (aChild));
+    template<class C>
+    void removeDependentChild(C *aChild)
+    {
+        AssertReturnVoid(aChild != NULL);
+        doRemoveDependentChild(ComPtr<IUnknown>(aChild));
     }
 
@@ -1957,9 +1957,9 @@
      * but takes a ComObjPtr<C> argument.
      */
-    template <class C>
-    void removeDependentChild (const ComObjPtr<C> &aChild)
-    {
-        AssertReturnVoid (!aChild.isNull());
-        doRemoveDependentChild (ComPtr<IUnknown> (static_cast <C *> (aChild)));
+    template<class C>
+    void removeDependentChild(const ComObjPtr<C> &aChild)
+    {
+        AssertReturnVoid(!aChild.isNull());
+        doRemoveDependentChild(ComPtr<IUnknown>(static_cast<C *>(aChild)));
     }
 
@@ -1972,5 +1972,5 @@
 private:
     void doAddDependentChild(IUnknown *aUnk, VirtualBoxBase *aChild);
-    void doRemoveDependentChild (IUnknown *aUnk);
+    void doRemoveDependentChild(IUnknown *aUnk);
 
     typedef std::map<IUnknown*, VirtualBoxBase*> DependentChildren;
@@ -2007,10 +2007,10 @@
  *       has gone.
  */
-template <class C>
+template<class C>
 class VirtualBoxBaseWithTypedChildren : public VirtualBoxBase
 {
 public:
 
-    typedef std::list <ComObjPtr<C> > DependentChildren;
+    typedef std::list<ComObjPtr<C> > DependentChildren;
 
     VirtualBoxBaseWithTypedChildren()
@@ -2050,17 +2050,17 @@
      * @note Locks #childrenLock() for writing.
      */
-    void addDependentChild (C *aChild)
-    {
-        AssertReturnVoid (aChild != NULL);
-
-        AutoCaller autoCaller (this);
+    void addDependentChild(C *aChild)
+    {
+        AssertReturnVoid(aChild != NULL);
+
+        AutoCaller autoCaller(this);
 
         /* sanity */
-        AssertReturnVoid (autoCaller.state() == InInit ||
-                          autoCaller.state() == Ready ||
-                          autoCaller.state() == Limited);
-
-        AutoWriteLock chLock (childrenLock());
-        mDependentChildren.push_back (aChild);
+        AssertReturnVoid(autoCaller.state() == InInit ||
+                         autoCaller.state() == Ready ||
+                         autoCaller.state() == Limited);
+
+        AutoWriteLock chLock(childrenLock());
+        mDependentChildren.push_back(aChild);
     }
 
@@ -2090,15 +2090,15 @@
      * @note Locks #childrenLock() for writing.
      */
-    void removeDependentChild (C *aChild)
-    {
-        AssertReturnVoid (aChild);
-
-        AutoCaller autoCaller (this);
+    void removeDependentChild(C *aChild)
+    {
+        AssertReturnVoid(aChild);
+
+        AutoCaller autoCaller(this);
 
         /* sanity */
-        AssertReturnVoid (autoCaller.state() == InUninit ||
-                          autoCaller.state() == InInit ||
-                          autoCaller.state() == Ready ||
-                          autoCaller.state() == Limited);
+        AssertReturnVoid(autoCaller.state() == InUninit ||
+                         autoCaller.state() == InInit ||
+                         autoCaller.state() == Ready ||
+                         autoCaller.state() == Limited);
 
         /* return shortly; we are strongly referenced so the object won't get
@@ -2109,6 +2109,6 @@
             return;
 
-        AutoWriteLock chLock (childrenLock());
-        mDependentChildren.remove (aChild);
+        AutoWriteLock chLock(childrenLock());
+        mDependentChildren.remove(aChild);
     }
 
@@ -2141,5 +2141,5 @@
     void uninitDependentChildren()
     {
-        AutoCaller autoCaller (this);
+        AutoCaller autoCaller(this);
 
         /* We don't want to hold the childrenLock() write lock here (necessary
@@ -2160,6 +2160,6 @@
          * since no any object may access us by that time.
          */
-        AssertReturnVoid (autoCaller.state() == InUninit ||
-                          autoCaller.state() == InInit);
+        AssertReturnVoid(autoCaller.state() == InUninit ||
+                         autoCaller.state() == InInit);
 
         if (mDependentChildren.size())
@@ -2169,5 +2169,5 @@
             {
                 C *child = (*it);
-                Assert (child);
+                Assert(child);
 
                 /* Note that if child->uninit() happens to be called on another
@@ -2196,5 +2196,5 @@
     void removeDependentChildren()
     {
-        AutoWriteLock chLock (childrenLock());
+        AutoWriteLock chLock(childrenLock());
         mDependentChildren.clear();
     }
@@ -2219,8 +2219,8 @@
 public:
 
-    Shareable() : mData (NULL), mIsShared (FALSE) {}
+    Shareable() : mData (NULL), mIsShared(FALSE) {}
     ~Shareable() { free(); }
 
-    void allocate() { attach (new D); }
+    void allocate() { attach(new D); }
 
     virtual void free() {
@@ -2233,6 +2233,6 @@
     }
 
-    void attach (D *data) {
-        AssertMsg (data, ("new data must not be NULL"));
+    void attach(D *data) {
+        AssertMsg(data, ("new data must not be NULL"));
         if (data && mData != data) {
             if (mData && !mIsShared)
@@ -2243,6 +2243,6 @@
     }
 
-    void attach (Shareable &data) {
-        AssertMsg (
+    void attach(Shareable &data) {
+        AssertMsg(
             data.mData == mData || !data.mIsShared,
             ("new data must not be shared")
@@ -2254,6 +2254,6 @@
     }
 
-    void share (D *data) {
-        AssertMsg (data, ("new data must not be NULL"));
+    void share(D *data) {
+        AssertMsg(data, ("new data must not be NULL"));
         if (mData != data) {
             if (mData && !mIsShared)
@@ -2264,14 +2264,14 @@
     }
 
-    void share (const Shareable &data) { share (data.mData); }
-
-    void attachCopy (const D *data) {
-        AssertMsg (data, ("data to copy must not be NULL"));
+    void share(const Shareable &data) { share (data.mData); }
+
+    void attachCopy(const D *data) {
+        AssertMsg(data, ("data to copy must not be NULL"));
         if (data)
-            attach (new D (*data));
-    }
-
-    void attachCopy (const Shareable &data) {
-        attachCopy (data.mData);
+            attach(new D (*data));
+    }
+
+    void attachCopy(const Shareable &data) {
+        attachCopy(data.mData);
     }
 
@@ -2288,5 +2288,5 @@
 
     D *operator->() const {
-        AssertMsg (mData, ("data must not be NULL"));
+        AssertMsg(mData, ("data must not be NULL"));
         return mData;
     }
@@ -2309,30 +2309,30 @@
  *  structure).
  */
-template <class D>
-class Backupable : public Shareable <D>
+template<class D>
+class Backupable : public Shareable<D>
 {
 public:
 
-    Backupable() : Shareable <D> (), mBackupData (NULL) {}
+    Backupable() : Shareable<D> (), mBackupData(NULL) {}
 
     void free()
     {
-        AssertMsg (this->mData || !mBackupData, ("backup must be NULL if data is NULL"));
+        AssertMsg(this->mData || !mBackupData, ("backup must be NULL if data is NULL"));
         rollback();
-        Shareable <D>::free();
+        Shareable<D>::free();
     }
 
     D *detach()
     {
-        AssertMsg (this->mData || !mBackupData, ("backup must be NULL if data is NULL"));
+        AssertMsg(this->mData || !mBackupData, ("backup must be NULL if data is NULL"));
         rollback();
-        return Shareable <D>::detach();
-    }
-
-    void share (const Backupable &data)
-    {
-        AssertMsg (!data.isBackedUp(), ("data to share must not be backed up"));
+        return Shareable<D>::detach();
+    }
+
+    void share(const Backupable &data)
+    {
+        AssertMsg(!data.isBackedUp(), ("data to share must not be backed up"));
         if (!data.isBackedUp())
-            Shareable <D>::share (data.mData);
+            Shareable<D>::share(data.mData);
     }
 
@@ -2343,9 +2343,9 @@
     void backup()
     {
-        AssertMsg (this->mData, ("data must not be NULL"));
+        AssertMsg(this->mData, ("data must not be NULL"));
         if (this->mData && !mBackupData)
         {
             mBackupData = this->mData;
-            this->mData = new D (*mBackupData);
+            this->mData = new D(*mBackupData);
         }
     }
@@ -2409,8 +2409,8 @@
     }
 
-    void assignCopy (const D *data)
-    {
-        AssertMsg (this->mData, ("data must not be NULL"));
-        AssertMsg (data, ("data to copy must not be NULL"));
+    void assignCopy(const D *data)
+    {
+        AssertMsg(this->mData, ("data must not be NULL"));
+        AssertMsg(data, ("data to copy must not be NULL"));
         if (this->mData && data)
         {
@@ -2425,7 +2425,7 @@
     }
 
-    void assignCopy (const Backupable &data)
-    {
-        assignCopy (data.mData);
+    void assignCopy(const Backupable &data)
+    {
+        assignCopy(data.mData);
     }
 
@@ -2437,5 +2437,5 @@
     bool hasActualChanges() const
     {
-        AssertMsg (this->mData, ("data must not be NULL"));
+        AssertMsg(this->mData, ("data must not be NULL"));
         return this->mData != NULL && mBackupData != NULL &&
                !(*this->mData == *mBackupData);
@@ -2452,4 +2452,4 @@
 };
 
-#endif // ____H_VIRTUALBOXBASEIMPL
-
+#endif // !____H_VIRTUALBOXBASEIMPL
+
