VirtualBox

Changeset 107672 in vbox for trunk/src/VBox/Storage/VMDK.cpp


Ignore:
Timestamp:
Jan 10, 2025 3:41:35 PM (6 weeks ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166764
Message:

Storage/VMDK.cpp: Fix unused variable parfait warnings + small cleanup, bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VMDK.cpp

    r107671 r107672  
    31983198    else
    31993199    {
    3200         uint64_t cSectorsPerGDE, cSectorsPerGD;
    32013200        pExtent->enmType = VMDKETYPE_HOSTED_SPARSE;
    32023201        pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbSize, _64K));
    32033202        pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K);
    32043203        pExtent->cGTEntries = 512;
    3205         cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
     3204
     3205        uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
    32063206        pExtent->cSectorsPerGDE = cSectorsPerGDE;
    32073207        pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE;
    3208         cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));
    32093208    }
    32103209
     
    55925591        if (!(uImageFlags & VD_IMAGE_FLAGS_FIXED))
    55935592        {
    5594             uint64_t cSectorsPerGDE, cSectorsPerGD;
    55955593            pExtent->enmType = VMDKETYPE_HOSTED_SPARSE;
    55965594            pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbExtent, _64K));
    55975595            pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K);
    55985596            pExtent->cGTEntries = 512;
    5599             cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
     5597
     5598            uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
    56005599            pExtent->cSectorsPerGDE = cSectorsPerGDE;
    56015600            pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE;
    5602             cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));
    56035601            if (pImage->uImageFlags & VD_VMDK_IMAGE_FLAGS_STREAM_OPTIMIZED)
    56045602            {
     
    57325730    pImage->pDescData = NULL;
    57335731
    5734     uint64_t cSectorsPerGDE, cSectorsPerGD;
    57355732    pExtent->enmType = VMDKETYPE_HOSTED_SPARSE;
    57365733    pExtent->cSectors = VMDK_BYTE2SECTOR(RT_ALIGN_64(cbSize, _64K));
    57375734    pExtent->cSectorsPerGrain = VMDK_BYTE2SECTOR(_64K);
    57385735    pExtent->cGTEntries = 512;
    5739     cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
     5736
     5737    uint64_t const cSectorsPerGDE = pExtent->cGTEntries * pExtent->cSectorsPerGrain;
    57405738    pExtent->cSectorsPerGDE = cSectorsPerGDE;
    57415739    pExtent->cGDEntries = (pExtent->cSectors + cSectorsPerGDE - 1) / cSectorsPerGDE;
    5742     cSectorsPerGD = (pExtent->cGDEntries + (512 / sizeof(uint32_t) - 1)) / (512 / sizeof(uint32_t));
    57435740
    57445741    /* The spec says version is 1 for all VMDKs, but the vast
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