- Timestamp:
- Oct 3, 2013 8:02:34 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 89520
- Location:
- trunk/src/VBox/Storage
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Storage/ISCSI.cpp
r48743 r48851 2683 2683 paReqBHS[3] = RT_H2N_U32(pImage->LUN & 0xffffffff); 2684 2684 paReqBHS[4] = pIScsiCmd->Itt; 2685 paReqBHS[5] = RT_H2N_U32( cbData);2685 paReqBHS[5] = RT_H2N_U32((uint32_t)cbData); Assert((uint32_t)cbData == cbData); 2686 2686 paReqBHS[6] = RT_H2N_U32(pImage->CmdSN); 2687 2687 paReqBHS[7] = RT_H2N_U32(pImage->ExpStatSN); -
trunk/src/VBox/Storage/QCOW.cpp
r48743 r48851 2438 2438 Assert((offData & UINT32_MAX) == offData); 2439 2439 pImage->offBackingFilename = (uint32_t)offData; 2440 pImage->cbBackingFilename = strlen(pszParentFilename);2440 pImage->cbBackingFilename = (uint32_t)strlen(pszParentFilename); 2441 2441 rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, 2442 2442 offData + pImage->cbCluster); -
trunk/src/VBox/Storage/QED.cpp
r48743 r48851 2526 2526 Assert((offData & UINT32_MAX) == offData); 2527 2527 pImage->offBackingFilename = (uint32_t)offData; 2528 pImage->cbBackingFilename = strlen(pszParentFilename);2528 pImage->cbBackingFilename = (uint32_t)strlen(pszParentFilename); 2529 2529 rc = vdIfIoIntFileSetSize(pImage->pIfIo, pImage->pStorage, 2530 2530 offData + pImage->cbCluster); -
trunk/src/VBox/Storage/VDI.cpp
r48743 r48851 1240 1240 static void *vdiAllocationBitmapCreate(void *pvData, size_t cbData) 1241 1241 { 1242 unsigned cSectors = cbData / 512; 1243 unsigned uSectorCur = 0; 1242 Assert(cbData <= UINT32_MAX / 8); 1243 uint32_t cSectors = (uint32_t)(cbData / 512); 1244 uint32_t uSectorCur = 0; 1244 1245 void *pbmAllocationBitmap = NULL; 1245 1246 … … 1253 1254 while (uSectorCur < cSectors) 1254 1255 { 1255 int idxSet = ASMBitFirstSet((uint8_t *)pvData + uSectorCur * 512, cbData * 8);1256 int idxSet = ASMBitFirstSet((uint8_t *)pvData + uSectorCur * 512, (uint32_t)cbData * 8); 1256 1257 1257 1258 if (idxSet != -1) -
trunk/src/VBox/Storage/VHD.cpp
r48743 r48851 3086 3086 3087 3087 if ( paBat[i] != UINT32_C(0xffffffff) 3088 && ASMBitTestAndSet(pu32BlockBitmap, ( paBat[i] - idxMinBlock) / (cbBlock / VHD_SECTOR_SIZE)))3088 && ASMBitTestAndSet(pu32BlockBitmap, (uint32_t)((paBat[i] - idxMinBlock) / (cbBlock / VHD_SECTOR_SIZE)))) 3089 3089 { 3090 3090 vdIfErrorMessage(pIfError, "Entry %u points to an already referenced data block, clearing\n", -
trunk/src/VBox/Storage/VHDX.cpp
r48743 r48851 511 511 { 512 512 /** Image name. */ 513 const char 513 const char *pszFilename; 514 514 /** Storage handle. */ 515 PVDIOSTORAGE 515 PVDIOSTORAGE pStorage; 516 516 517 517 /** Pointer to the per-disk VD interface list. */ 518 PVDINTERFACE 518 PVDINTERFACE pVDIfsDisk; 519 519 /** Pointer to the per-image VD interface list. */ 520 PVDINTERFACE 520 PVDINTERFACE pVDIfsImage; 521 521 /** Error interface. */ 522 PVDINTERFACEERROR 522 PVDINTERFACEERROR pIfError; 523 523 /** I/O interface. */ 524 PVDINTERFACEIOINT 524 PVDINTERFACEIOINT pIfIo; 525 525 526 526 /** Open flags passed by VBoxHD layer. */ 527 unsigned 527 unsigned uOpenFlags; 528 528 /** Image flags defined during creation or determined during open. */ 529 unsigned 529 unsigned uImageFlags; 530 530 /** Version of the VHDX image format. */ 531 unsigned 531 unsigned uVersion; 532 532 /** Total size of the image. */ 533 uint64_t 533 uint64_t cbSize; 534 534 /** Logical sector size of the image. */ 535 size_tcbLogicalSector;535 uint32_t cbLogicalSector; 536 536 /** Block size of the image. */ 537 size_t 537 size_t cbBlock; 538 538 /** Physical geometry of this image. */ 539 VDGEOMETRY 539 VDGEOMETRY PCHSGeometry; 540 540 /** Logical geometry of this image. */ 541 VDGEOMETRY 541 VDGEOMETRY LCHSGeometry; 542 542 543 543 /** The BAT. */ 544 PVhdxBatEntry 544 PVhdxBatEntry paBat; 545 545 /** Chunk ratio. */ 546 uint32_t 546 uint32_t uChunkRatio; 547 547 548 548 } VHDXIMAGE, *PVHDXIMAGE; … … 1144 1144 1145 1145 /* Calculate required values first. */ 1146 uChunkRatio = (RT_BIT_64(23) * pImage->cbLogicalSector) / pImage->cbBlock; 1147 cDataBlocks = pImage->cbSize / pImage->cbBlock; 1146 uint64_t uChunkRatio64 = (RT_BIT_64(23) * pImage->cbLogicalSector) / pImage->cbBlock; 1147 uChunkRatio = (uint32_t)uChunkRatio64; Assert(uChunkRatio == uChunkRatio64); 1148 uint64_t cDataBlocks64 = pImage->cbSize / pImage->cbBlock; 1149 cDataBlocks = (uint32_t)cDataBlocks64; Assert(cDataBlocks == cDataBlocks64); 1150 1148 1151 if (pImage->cbSize % pImage->cbBlock) 1149 1152 cDataBlocks++; … … 1895 1898 else 1896 1899 { 1897 uint32_t idxBat = uOffset / pImage->cbBlock;1900 uint32_t idxBat = (uint32_t)(uOffset / pImage->cbBlock); Assert(idxBat == uOffset / pImage->cbBlock); 1898 1901 uint32_t offRead = uOffset % pImage->cbBlock; 1899 1902 uint64_t uBatEntry; … … 2419 2422 if (pImage) 2420 2423 { 2421 vdIfErrorMessage(pImage->pIfError, "Header: Geometry PCHS=%u/%u/%u LCHS=%u/%u/%u cbSector=% zu\n",2424 vdIfErrorMessage(pImage->pIfError, "Header: Geometry PCHS=%u/%u/%u LCHS=%u/%u/%u cbSector=%u\n", 2422 2425 pImage->PCHSGeometry.cCylinders, pImage->PCHSGeometry.cHeads, pImage->PCHSGeometry.cSectors, 2423 2426 pImage->LCHSGeometry.cCylinders, pImage->LCHSGeometry.cHeads, pImage->LCHSGeometry.cSectors, -
trunk/src/VBox/Storage/VMDK.cpp
r48743 r48851 1035 1035 { 1036 1036 int rc = VINF_SUCCESS; 1037 unsignedi;1037 size_t i; 1038 1038 uint32_t *pGDTmp, *pRGDTmp; 1039 1039 size_t cbGD = pExtent->cGDEntries * sizeof(uint32_t); … … 2351 2351 size_t cbDescriptor = cbLimit ? cbLimit : 4 * _1K; 2352 2352 char *pszDescriptor = (char *)RTMemAllocZ(cbDescriptor); 2353 unsignedoffDescriptor = 0;2353 size_t offDescriptor = 0; 2354 2354 2355 2355 if (!pszDescriptor)
Note:
See TracChangeset
for help on using the changeset viewer.