VirtualBox

Changeset 32884 in vbox for trunk/src


Ignore:
Timestamp:
Oct 4, 2010 12:29:41 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66365
Message:

Storage/VMDK: build fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r32883 r32884  
    12001200static int vmdkAllocGrainDirectory(PVMDKIMAGE pImage, PVMDKEXTENT pExtent)
    12011201{
     1202    int rc = VINF_SUCCESS;
    12021203    size_t cbGD = pExtent->cGDEntries * sizeof(uint32_t);
    12031204    uint32_t *pGD = NULL, *pRGD = NULL;
     
    12621263
    12631264    rc = vmdkAllocGrainDirectory(pImage, pExtent);
    1264     if (RT_FAILED(rc))
     1265    if (RT_FAILURE(rc))
    12651266        goto out;
    12661267
     
    12691270    rc = vmdkFileReadSync(pImage, pExtent->pFile,
    12701271                          VMDK_SECTOR2BYTE(pExtent->uSectorGD),
    1271                           pGD, cbGD, NULL);
     1272                          pExtent->pGD, cbGD, NULL);
    12721273    AssertRC(rc);
    12731274    if (RT_FAILURE(rc))
     
    12761277        goto out;
    12771278    }
    1278     for (i = 0, pGDTmp = pGD; i < pExtent->cGDEntries; i++, pGDTmp++)
     1279    for (i = 0, pGDTmp = pExtent->pGD; i < pExtent->cGDEntries; i++, pGDTmp++)
    12791280        *pGDTmp = RT_LE2H_U32(*pGDTmp);
    12801281
    12811282    if (pExtent->uSectorRGD)
    12821283    {
    1283         pExtent->pRGD = pRGD;
    12841284        /* The VMDK 1.1 spec seems to talk about compressed grain directories,
    12851285         * but in reality they are not compressed. */
    12861286        rc = vmdkFileReadSync(pImage, pExtent->pFile,
    12871287                              VMDK_SECTOR2BYTE(pExtent->uSectorRGD),
    1288                               pRGD, cbGD, NULL);
     1288                              pExtent->pRGD, cbGD, NULL);
    12891289        AssertRC(rc);
    12901290        if (RT_FAILURE(rc))
     
    12931293            goto out;
    12941294        }
    1295         for (i = 0, pRGDTmp = pRGD; i < pExtent->cGDEntries; i++, pRGDTmp++)
     1295        for (i = 0, pRGDTmp = pExtent->pRGD; i < pExtent->cGDEntries; i++, pRGDTmp++)
    12961296            *pRGDTmp = RT_LE2H_U32(*pRGDTmp);
    12971297
     
    13121312        }
    13131313
    1314         for (i = 0, pGDTmp = pGD, pRGDTmp = pRGD;
     1314        for (i = 0, pGDTmp = pExtent->pGD, pRGDTmp = pExtent->pRGD;
    13151315             i < pExtent->cGDEntries;
    13161316             i++, pGDTmp++, pRGDTmp++)
     
    13791379            goto out;
    13801380        }
    1381         for (i = 0, pGDTmp = pGD; i < pExtent->cGDEntries; i++, pGDTmp++)
     1381        for (i = 0, pGDTmp = pExtent->pGD; i < pExtent->cGDEntries; i++, pGDTmp++)
    13821382        {
    13831383            /* If no grain table is allocated skip the entry. */
     
    14981498
    14991499    rc = vmdkAllocGrainDirectory(pImage, pExtent);
    1500     if (RT_FAILED(rc))
     1500    if (RT_FAILURE(rc))
    15011501        goto out;
    15021502
     
    15061506        uint64_t uOffsetSectors;
    15071507
    1508         if (pRGD)
     1508        if (pExtent->pRGD)
    15091509        {
    15101510            uOffsetSectors = pExtent->uSectorRGD + VMDK_BYTE2SECTOR(cbGDRounded);
    15111511            for (i = 0; i < pExtent->cGDEntries; i++)
    15121512            {
    1513                 pRGD[i] = uOffsetSectors;
     1513                pExtent->pRGD[i] = uOffsetSectors;
    15141514                uGTSectorLE = RT_H2LE_U64(uOffsetSectors);
    15151515                /* Write the redundant grain directory entry to disk. */
     
    15291529        for (i = 0; i < pExtent->cGDEntries; i++)
    15301530        {
    1531             pGD[i] = uOffsetSectors;
     1531            pExtent->pGD[i] = uOffsetSectors;
    15321532            uGTSectorLE = RT_H2LE_U64(uOffsetSectors);
    15331533            /* Write the grain directory entry to disk. */
Note: See TracChangeset for help on using the changeset viewer.

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