Index: trunk/src/VBox/Devices/Storage/VBoxHDD.cpp
===================================================================
--- trunk/src/VBox/Devices/Storage/VBoxHDD.cpp	(revision 149)
+++ trunk/src/VBox/Devices/Storage/VBoxHDD.cpp	(revision 150)
@@ -35,6 +35,5 @@
 #include <iprt/uuid.h>
 #include <iprt/file.h>
-
-#include <string.h>
+#include <iprt/string.h>
 
 #include "Builtins.h"
@@ -743,5 +742,5 @@
     /* Check common header parameters. */
 
-    bool failure = false;
+    bool fFailed = false;
 
     if (    getImageType(pHeader) < VDI_IMAGE_TYPE_FIRST
@@ -749,5 +748,5 @@
     {
         LogRel(("VDI: bad image type %d\n", getImageType(pHeader)));
-        failure = true;
+        fFailed = true;
     }
 
@@ -755,5 +754,5 @@
     {
         LogRel(("VDI: bad image flags %08x\n", getImageFlags(pHeader)));
-        failure = true;
+        fFailed = true;
     }
 
@@ -762,5 +761,5 @@
         LogRel(("VDI: wrong sector size (%d != %d)\n",
                (getImageGeometry(pHeader))->cbSector, VDI_GEOMETRY_SECTOR_SIZE));
-        failure = true;
+        fFailed = true;
     }
 
@@ -773,5 +772,5 @@
               getImageDiskSize(pHeader), getImageBlockSize(pHeader),
               getImageBlocks(pHeader), getPowerOfTwo(getImageBlockSize(pHeader))));
-        failure = true;
+        fFailed = true;
     }
 
@@ -782,5 +781,5 @@
               getImageBlocksAllocated(pHeader), getImageBlocks(pHeader),
               getImageBlockSize(pHeader), getImageDiskSize(pHeader)));
-        failure = true;
+        fFailed = true;
     }
 
@@ -790,5 +789,5 @@
         LogRel(("VDI: wrong extra size (%d, %d)\n",
                getImageExtraBlockSize(pHeader), getPowerOfTwo(getImageExtraBlockSize(pHeader))));
-        failure = true;
+        fFailed = true;
     }
 
@@ -797,5 +796,5 @@
         LogRel(("VDI: wrong disk size (%d, %d, %lld)\n",
                getImageBlockSize(pHeader), getImageBlocks(pHeader), getImageDiskSize(pHeader)));
-        failure = true;
+        fFailed = true;
     }
 
@@ -803,5 +802,5 @@
     {
         LogRel(("VDI: uuid of creator is 0\n"));
-        failure = true;
+        fFailed = true;
     }
 
@@ -809,8 +808,8 @@
     {
         LogRel(("VDI: uuid of modificator is 0\n"));
-        failure = true;
-    }
-
-    return failure ? VERR_VDI_INVALID_HEADER : VINF_SUCCESS;
+        fFailed = true;
+    }
+
+    return fFailed ? VERR_VDI_INVALID_HEADER : VINF_SUCCESS;
 }
 
@@ -1928,8 +1927,7 @@
 
 /**
- * @note    Only used by tstVDI.
- *
  * internal: commit last image(s) to selected previous image.
  * note: all images accessed across this call must be opened in R/W mode.
+ * @remark    Only used by tstVDI.
  */
 static int vdiCommitToImage(PVDIDISK pDisk, PVDIIMAGEDESC pDstImage,
@@ -2480,5 +2478,4 @@
 /**
  * Shrinks growing image file by removing zeroed data blocks.
- * @note    Only used by vditool
  *
  * @returns VBox status code.
@@ -2486,4 +2483,5 @@
  * @param   pfnProgress     Progress callback. Optional.
  * @param   pvUser          User argument for the progress callback.
+ * @remark  Only used by vditool
  */
 IDER3DECL(int) VDIShrinkImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser)
@@ -2533,6 +2531,5 @@
     unsigned cBlocksAllocated2 = (unsigned)(cbData >> pImage->uShiftIndex2Offset);
     if (cbData != (uint64_t)cBlocksAllocated << pImage->uShiftIndex2Offset)
-        Log(("VDIShrinkImage: invalid image file length, cbBlock=%u cBlocks=%u "
-             "cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
+        Log(("VDIShrinkImage: invalid image file length, cbBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
              cbBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
 
@@ -2542,6 +2539,5 @@
     if (!paBlocks2)
     {
-        Log(("VDIShrinkImage: failed to allocate paBlocks2 buffer (%u bytes)\n",
-             sizeof(VDIIMAGEBLOCKPOINTER) * cBlocks));
+        Log(("VDIShrinkImage: failed to allocate paBlocks2 buffer (%u bytes)\n", sizeof(VDIIMAGEBLOCKPOINTER) * cBlocks));
         vdiCloseImage(pImage);
         return VERR_NO_MEMORY;
@@ -2571,6 +2567,5 @@
             else
             {
-                Log(("VDIShrinkImage: block n=%u -> uBlock=%u is out of blocks range! (cbBlock=%u "
-                     "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu)\n",
+                Log(("VDIShrinkImage: block n=%u -> uBlock=%u is out of blocks range! (cbBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu)\n",
                      n, uBlock, cbBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
                 /* free link to invalid block. */
@@ -2596,8 +2591,6 @@
                 if (VBOX_FAILURE(rc))
                 {
-                    Log(("VDIShrinkImage: seek rc=%Vrc filename=\"%s\" uBlock=%u cBlocks=%u "
-                         "cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
-                         rc, pImage->szFilename, uBlock, cBlocks, cBlocksAllocated,
-                         cBlocksAllocated2, cbData));
+                    Log(("VDIShrinkImage: seek rc=%Vrc filename=\"%s\" uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
+                         rc, pImage->szFilename, uBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
                     break;
                 }
@@ -2605,8 +2598,6 @@
                 if (VBOX_FAILURE(rc))
                 {
-                    Log(("VDIShrinkImage: read rc=%Vrc filename=\"%s\" cbBlock=%u uBlock=%u "
-                         "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
-                         rc, pImage->szFilename, cbBlock, uBlock, cBlocks, cBlocksAllocated,
-                         cBlocksAllocated2, cbData));
+                    Log(("VDIShrinkImage: read rc=%Vrc filename=\"%s\" cbBlock=%u uBlock=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
+                         rc, pImage->szFilename, cbBlock, uBlock, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
                     break;
                 }
@@ -2633,8 +2624,6 @@
                         if (VBOX_FAILURE(rc))
                         {
-                            Log(("VDIShrinkImage: seek(2) rc=%Vrc filename=\"%s\" uBlockWrite=%u "
-                                 "cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
-                                 rc, pImage->szFilename, uBlockWrite, cBlocks, cBlocksAllocated,
-                                 cBlocksAllocated2, cbData));
+                            Log(("VDIShrinkImage: seek(2) rc=%Vrc filename=\"%s\" uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
+                                 rc, pImage->szFilename, uBlockWrite, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
                             break;
                         }
@@ -2642,9 +2631,6 @@
                         if (VBOX_FAILURE(rc))
                         {
-                            Log(("VDIShrinkImage: write rc=%Vrc filename=\"%s\" cbBlock=%u "
-                                 "uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u "
-                                 "cBlocksAllocated2=%u cbData=%llu\n",
-                                 rc, pImage->szFilename, cbBlock, uBlockWrite, cBlocks,
-                                 cBlocksAllocated, cBlocksAllocated2, cbData));
+                            Log(("VDIShrinkImage: write rc=%Vrc filename=\"%s\" cbBlock=%u uBlockWrite=%u cBlocks=%u cBlocksAllocated=%u cBlocksAllocated2=%u cbData=%llu\n",
+                                 rc, pImage->szFilename, cbBlock, uBlockWrite, cBlocks, cBlocksAllocated, cBlocksAllocated2, cbData));
                             break;
                         }
@@ -2718,5 +2704,4 @@
 /**
  * Converts image file from older VDI formats to current one.
- * @note    Only used by vditool
  *
  * @returns VBox status code.
@@ -2724,4 +2709,5 @@
  * @param   pfnProgress     Progress callback. Optional.
  * @param   pvUser          User argument for the progress callback.
+ * @remark  Only used by vditool
  */
 IDER3DECL(int) VDIConvertImage(const char *pszFilename, PFNVMPROGRESS pfnProgress, void *pvUser)
@@ -4003,10 +3989,9 @@
  * Note that in case of unrecoverable error all images of HDD container will be closed.
  *
- * @note    Only used by tstVDI.
- *
  * @returns VBox status code.
  * @param   pDisk           Pointer to VDI HDD container.
  * @param   pfnProgress     Progress callback. Optional.
  * @param   pvUser          User argument for the progress callback.
+ * @remark  Only used by tstVDI.
  */
 IDER3DECL(int) VDIDiskCommitLastDiff(PVDIDISK pDisk, PFNVMPROGRESS pfnProgress, void *pvUser)
@@ -4067,6 +4052,4 @@
 
 /**
- * @note    Only used by tstVDI.
- *
  * Creates and opens a new differencing image file in HDD container.
  * See comments for VDIDiskOpenImage function about differencing images.
@@ -4078,4 +4061,5 @@
  * @param   pfnProgress     Progress callback. Optional.
  * @param   pvUser          User argument for the progress callback.
+ * @remark  Only used by tstVDI.
  */
 IDER3DECL(int) VDIDiskCreateOpenDifferenceImage(PVDIDISK pDisk, const char *pszFilename,
@@ -4116,7 +4100,7 @@
 
 /**
- * @note    Only used by tstVDI.
- *
  * internal: debug image dump.
+ * 
+ * @remark  Only used by tstVDI.
  */
 static void vdiDumpImage(PVDIIMAGEDESC pImage)
@@ -4181,7 +4165,7 @@
 /**
  * Debug helper - dumps all opened images of HDD container into the log file.
- * @note    Only used by tstVDI and vditool
  *
  * @param   pDisk           Pointer to VDI HDD container.
+ * @remark  Only used by tstVDI and vditool
  */
 IDER3DECL(void) VDIDiskDumpImages(PVDIDISK pDisk)
@@ -4269,6 +4253,5 @@
         if (VBOX_FAILURE(rc))
             return PDMDRV_SET_ERROR(pDrvIns, rc,
-                                    N_("VHDD: Configuration error: Querying \"Path\" as "
-                                       "string failed"));
+                                    N_("VHDD: Configuration error: Querying \"Path\" as string failed"));
 
         bool fReadOnly;
@@ -4280,6 +4263,5 @@
             MMR3HeapFree(pszName);
             return PDMDRV_SET_ERROR(pDrvIns, rc,
-                                    N_("VHDD: Configuration error: Querying \"ReadOnly\" as "
-                                       "boolean failed"));
+                                    N_("VHDD: Configuration error: Querying \"ReadOnly\" as boolean failed"));
         }
 
@@ -4311,6 +4293,5 @@
     if (VBOX_FAILURE(rc))
         return PDMDRV_SET_ERROR(pDrvIns, rc,
-                                N_("VHDD: Configuration error: Querying \"Path\" as "
-                                   "string failed"));
+                                N_("VHDD: Configuration error: Querying \"Path\" as string failed"));
 
     /** True if the media is readonly. */
@@ -4323,7 +4304,5 @@
         MMR3HeapFree(pszName);
         return PDMDRV_SET_ERROR(pDrvIns, rc,
-                                N_("VHDD: Configuration error: Querying \"ReadOnly\" as "
-                                   "boolean failed"));
-        return rc;
+                                N_("VHDD: Configuration error: Querying \"ReadOnly\" as boolean failed"));
     }
 
@@ -4334,6 +4313,5 @@
                                                     : VDI_OPEN_FLAGS_NORMAL);
     if (VBOX_SUCCESS(rc))
-        Log(("vdiConstruct: Opened '%s' in %s mode\n",
-              pszName, VDIDiskIsReadOnly(pData) ? "read-only" : "read-write"));
+        Log(("vdiConstruct: Opened '%s' in %s mode\n", pszName, VDIDiskIsReadOnly(pData) ? "read-only" : "read-write"));
     else
         AssertMsgFailed(("Failed to open image '%s' rc=%Vrc\n", pszName, rc));
