VirtualBox

Changeset 75816 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 29, 2018 2:58:30 PM (6 years ago)
Author:
vboxsync
Message:

Clean-up tmp debugging-related pragmas, and include of stdio, whitespace styling, and misc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ImageMounter/vboxraw/vboxraw.cpp

    r75815 r75816  
    2020*   Header Files                                                                                                                 *
    2121*********************************************************************************************************************************/
    22 
    23 /*** PKK TEMPORARY FOR DEBUGGING DON'T PUT INTO PRODUCTION CODE */
    24 #include <stdio.h>
    25 /*** END OF ADMONITION */
    26 
    2722
    2823#define LOG_GROUP LOG_GROUP_DEFAULT /** @todo log group */
     
    8378#include "SelfSizingTable.h"
    8479
    85 /*
    86  * PKK: REMOVE AFTER DEBUGGING
    87  */
    88 #pragma GCC diagnostic ignored "-Wunused-variable"
    89 #pragma GCC diagnostic ignored "-Wunused-parameter"
    90 #pragma GCC diagnostic ignored "-Wunused-function"
    91 
    9280using namespace com;
    9381
     
    10896const uint64_t TB = GB * KB;
    10997const uint64_t PB = TB * KB;
    110 
    111 
    11298
    11399enum { PARTITION_TABLE_MBR = 1, PARTITION_TABLE_GPT = 2 };
     
    136122
    137123#define SAFENULL(strPtr)   (strPtr ? strPtr : "")
    138 
    139124#define CSTR(arg)     Utf8Str(arg).c_str()          /* Converts XPCOM string type to C string type */
    140 
    141125
    142126static struct fuse_operations g_vboxrawOps;         /** FUSE structure that defines allowed ops for this FS */
     
    165149    int            idxPartition;            /** partition number */
    166150    char           *pszName;
    167     off_t          offPartition;        /** partition offset from start of disk, in bytes */
    168     uint64_t       cbPartition;           /** partition size in bytes */
     151    off_t          offPartition;            /** partition offset from start of disk, in bytes */
     152    uint64_t       cbPartition;             /** partition size in bytes */
    169153    uint8_t        fBootable;               /** partition bootable */
    170154    union
     
    173157        uint128_t  gptGuidTypeSpecifier;    /** partition type GPT */
    174158    } partitionType;                        /** uint8_t for MBR/EBR (legacy) and GUID for GPT */
    175 
    176159    union
    177160    {
    178         MBRPARTITIONENTRY mbrEntry;          /** MBR (also EBR partition entry) */
    179         GPTPARTITIONENTRY gptEntry;          /** GPT partition entry */
     161        MBRPARTITIONENTRY mbrEntry;         /** MBR (also EBR partition entry) */
     162        GPTPARTITIONENTRY gptEntry;         /** GPT partition entry */
    180163    } partitionEntry;
    181164} PARTITIONINFO;
     
    268251    RTPrintf("It is the vhdd file that the user or a utility will subsequently mount on\n");
    269252    RTPrintf("the host OS to gain access to the virtual disk contents.\n\n");
    270     RTPrintf("If any of the partition, size or offset related options are used the\n");
    271     RTPrintf("The constraining start offset (in bytes) and size (in bytes) will be\n");
     253    RTPrintf("If any of the partition, size or offset related options are used, the\n");
     254    RTPrintf("constraining start offset (in bytes) and size (in bytes) will be\n");
    272255    RTPrintf("appended in brackets to the symbolic link basename to indicate\n");
    273     RTPrintf("what part of the image is exposed by the FUSE filesystem implementation.\n\n");
     256    RTPrintf("which part of the image is exposed by the FUSE filesystem implementation.\n\n");
    274257}
    275258
     
    956939     * Parse the four physical partition entires in the MBR (any one, and only one, can be an EBR)
    957940     */
    958     int ebridxPartitionInMbr = 0;
     941    int idxEbrPartitionInMbr = 0;
    959942    for (int idxPartition = 1;
    960943             idxPartition <= MBR_PARTITIONS_MAX;
     
    970953        if (PARTTYPE_IS_EXT(pMbrPartitionEntry->type))
    971954        {
    972             if (ebridxPartitionInMbr)
     955            if (idxEbrPartitionInMbr)
    973956                 return RTMsgErrorExitFailure("Multiple EBRs found found in MBR\n");
    974             ebridxPartitionInMbr = idxPartition;
     957            idxEbrPartitionInMbr = idxPartition;
    975958        }
    976959
     
    979962        ppi->idxPartition = idxPartition;
    980963        ppi->offPartition = (off_t) pMbrPartitionEntry->partitionLba * BLOCKSIZE;
    981         ppi->cbPartition = (off_t) pMbrPartitionEntry->partitionBlkCnt * BLOCKSIZE;
    982         ppi->fBootable = pMbrPartitionEntry->bootIndicator == 0x80;
    983         (ppi->partitionType).legacy = pMbrPartitionEntry->type;
     964        ppi->cbPartition  = (off_t) pMbrPartitionEntry->partitionBlkCnt * BLOCKSIZE;
     965        ppi->fBootable    = pMbrPartitionEntry->bootIndicator == 0x80;
     966        ppi->partitionType.legacy = pMbrPartitionEntry->type;
    984967
    985968        g_lastPartNbr = idxPartition;
     
    10451028            PARTITIONINFO *ppi = &g_aParsedPartitionInfo[g_lastPartNbr];
    10461029            memcpy(&(ppi->partitionEntry).gptEntry, pEntry, sizeof(GPTPARTITIONENTRY));
    1047             uint64_t firstLba = pEntry->firstLba;
    1048             uint64_t lastLba  = pEntry->lastLba;
    1049             if (!firstLba)
     1030            if (!pEntry->firstLba)
    10501031                break;
    1051             ppi->offPartition = firstLba * BLOCKSIZE;
    1052             ppi->cbPartition = (lastLba - firstLba) * BLOCKSIZE;
     1032            ppi->offPartition = pEntry->firstLba * BLOCKSIZE;
     1033            ppi->cbPartition = (pEntry->lastLba - pEntry->firstLba) * BLOCKSIZE;
    10531034            ppi->fBootable = pEntry->attrFlags & (1 << GPT_LEGACY_BIOS_BOOTABLE);
    10541035            ppi->partitionType.gptGuidTypeSpecifier = pEntry->partitionTypeGuid;
    10551036            size_t cwName = sizeof (pEntry->partitionName) / 2;
    1056             char *pszTmp = NULL, **pPszTmp = &pszTmp;
    10571037            RTUtf16LittleToUtf8Ex((PRTUTF16)pEntry->partitionName, RTSTR_MAX, &ppi->pszName, cwName, NULL);
    10581038            ppi->idxPartition = g_lastPartNbr++;
     
    10651045     * Starting with EBR located in MBR, walk EBR chain to parse the logical partition entries
    10661046     */
    1067     if (ebridxPartitionInMbr)
     1047    if (idxEbrPartitionInMbr)
    10681048    {
    10691049        uint32_t firstEbrLba
    1070             = g_aParsedPartitionInfo[ebridxPartitionInMbr].partitionEntry.mbrEntry.partitionLba;
     1050            = g_aParsedPartitionInfo[idxEbrPartitionInMbr].partitionEntry.mbrEntry.partitionLba;
    10711051        off_t    firstEbrOffset   = (off_t)firstEbrLba * BLOCKSIZE;
    10721052        off_t    chainedEbrOffset = 0;
     
    10991079            PARTITIONINFO *ppi = &g_aParsedPartitionInfo[idxPartition];
    11001080            ppi->idxPartition         = idxPartition;
    1101             ppi->offPartition    = currentEbrOffset + (off_t)pEbrPartitionEntry->partitionLba * BLOCKSIZE;
    1102             ppi->cbPartition        = (off_t)pEbrPartitionEntry->partitionBlkCnt * BLOCKSIZE;
     1081            ppi->offPartition         = currentEbrOffset + (off_t)pEbrPartitionEntry->partitionLba * BLOCKSIZE;
     1082            ppi->cbPartition          = (off_t)pEbrPartitionEntry->partitionBlkCnt * BLOCKSIZE;
    11031083            ppi->fBootable            = pEbrPartitionEntry->bootIndicator == 0x80;
    11041084            ppi->partitionType.legacy = pEbrPartitionEntry->type;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette