Index: trunk/src/VBox/Runtime/common/misc/circbuf.cpp
===================================================================
--- trunk/src/VBox/Runtime/common/misc/circbuf.cpp	(revision 37207)
+++ trunk/src/VBox/Runtime/common/misc/circbuf.cpp	(revision 37208)
@@ -26,7 +26,7 @@
 
 
-/******************************************************************************
- *   Header Files                                                             *
- ******************************************************************************/
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
 #include <iprt/circbuf.h>
 #include <iprt/mem.h>
@@ -35,7 +35,4 @@
 #include <iprt/err.h>
 
-/******************************************************************************
- *   Public Functions                                                         *
- ******************************************************************************/
 
 RTDECL(int) RTCircBufCreate(PRTCIRCBUF *ppBuf, size_t cbSize)
@@ -50,36 +47,27 @@
         return VERR_NO_MEMORY;
 
-    int rc = VINF_SUCCESS;
-    do
+    pTmpBuf->pvBuf = RTMemAlloc(cbSize);
+    if (pTmpBuf->pvBuf)
     {
-        pTmpBuf->pvBuf = RTMemAlloc(cbSize);
-        if (!pTmpBuf)
-        {
-            rc = VERR_NO_MEMORY;
-            break;
-        }
-
         pTmpBuf->cbBufSize = cbSize;
         *ppBuf = pTmpBuf;
-    }while (0);
-
-    if (RT_FAILURE(rc))
-        RTMemFree(pTmpBuf);
-
-    return rc;
-}
+        return VINF_SUCCESS;
+    }
+
+    RTMemFree(pTmpBuf);
+    return VERR_NO_MEMORY;
+}
+
 
 RTDECL(void) RTCircBufDestroy(PRTCIRCBUF pBuf)
 {
     /* Validate input. */
-    AssertPtrNull(pBuf);
-
-    if (pBuf)
-    {
-        if (pBuf->pvBuf)
-            RTMemFree(pBuf->pvBuf);
-        RTMemFree(pBuf);
-    }
-}
+    if (!pBuf)
+        return;
+    AssertPtr(pBuf);
+    RTMemFree(pBuf->pvBuf);
+    RTMemFree(pBuf);
+}
+
 
 RTDECL(void) RTCircBufReset(PRTCIRCBUF pBuf)
@@ -88,8 +76,9 @@
     AssertPtr(pBuf);
 
-    pBuf->uReadPos = 0;
+    pBuf->uReadPos  = 0;
     pBuf->uWritePos = 0;
     pBuf->cbBufUsed = 0;
 }
+
 
 RTDECL(size_t) RTCircBufFree(PRTCIRCBUF pBuf)
@@ -103,4 +92,5 @@
 }
 
+
 RTDECL(size_t) RTCircBufUsed(PRTCIRCBUF pBuf)
 {
@@ -113,4 +103,5 @@
 }
 
+
 RTDECL(size_t) RTCircBufSize(PRTCIRCBUF pBuf)
 {
@@ -120,4 +111,5 @@
     return pBuf->cbBufSize;
 }
+
 
 RTDECL(void) RTCircBufAcquireReadBlock(PRTCIRCBUF pBuf, size_t cbReqSize, void **ppvStart, size_t *pcbSize)
@@ -146,5 +138,5 @@
             /* Return the pointer address which point to the current read
              * position. */
-            *ppvStart = (char*)pBuf->pvBuf + pBuf->uReadPos;
+            *ppvStart = (char *)pBuf->pvBuf + pBuf->uReadPos;
             *pcbSize = uSize;
         }
@@ -152,4 +144,5 @@
 }
 
+
 RTDECL(void) RTCircBufReleaseReadBlock(PRTCIRCBUF pBuf, size_t cbSize)
 {
@@ -163,4 +156,5 @@
     ASMAtomicSubSize(&pBuf->cbBufUsed, cbSize, &cbOld);
 }
+
 
 RTDECL(void) RTCircBufAcquireWriteBlock(PRTCIRCBUF pBuf, size_t cbReqSize, void **ppvStart, size_t *pcbSize)
@@ -172,7 +166,4 @@
     AssertPtr(pcbSize);
 
-    size_t uFree;
-    size_t uSize;
-
     *ppvStart = 0;
     *pcbSize = 0;
@@ -181,10 +172,10 @@
     size_t cbSize = 0;
     ASMAtomicReadSize(&pBuf->cbBufUsed, &cbSize);
-    uFree = pBuf->cbBufSize - cbSize;
+    size_t uFree = pBuf->cbBufSize - cbSize;
     if (uFree > 0)
     {
         /* Get the size out of the requested size, the write block till the end
          * of the buffer & the currently free size. */
-        uSize = RT_MIN(cbReqSize, RT_MIN(pBuf->cbBufSize - pBuf->uWritePos, uFree));
+        size_t uSize = RT_MIN(cbReqSize, RT_MIN(pBuf->cbBufSize - pBuf->uWritePos, uFree));
         if (uSize > 0)
         {
@@ -197,4 +188,5 @@
 }
 
+
 RTDECL(void) RTCircBufReleaseWriteBlock(PRTCIRCBUF pBuf, size_t cbSize)
 {
@@ -205,6 +197,6 @@
     pBuf->uWritePos = (pBuf->uWritePos + cbSize) % pBuf->cbBufSize;
 
-    size_t cbOld = 0;
-    ASMAtomicAddSize(&pBuf->cbBufUsed, cbSize, &cbOld);
-}
-
+    size_t cbOldIgnored = 0;
+    ASMAtomicAddSize(&pBuf->cbBufUsed, cbSize, &cbOldIgnored);
+}
+
