Changeset 65485 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jan 27, 2017 2:22:36 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
r65480 r65485 309 309 pSeg->cbSeg = cbRange; 310 310 pSeg->pbSeg = (uint8_t *)RTMemAllocZ(cbRange); 311 pSeg->cIoLogEntries = cbRange / 512;311 pSeg->cIoLogEntries = (uint32_t)cbRange / 512; 312 312 if (!pSeg->pbSeg) 313 313 RTMemFree(pSeg); … … 447 447 { 448 448 /* Corrupted disk, print I/O log entry of the last write which accessed this range. */ 449 uint32_t cSector = (offSeg + cbOff) / 512;449 uint32_t cSector = (offSeg + (uint32_t)cbOff) / 512; 450 450 AssertMsg(cSector < pSeg->cIoLogEntries, ("Internal bug!\n")); 451 451 … … 538 538 LogFlowFunc(("Realloc segment pSeg=%#p\n", pSeg)); 539 539 pSeg->pbSeg = (uint8_t *)RTMemRealloc(pSeg->pbSeg, cbPreLeft); 540 for (unsigned idx = cbPreLeft / 512; idx < pSeg->cIoLogEntries; idx++)540 for (unsigned idx = (uint32_t)(cbPreLeft / 512); idx < pSeg->cIoLogEntries; idx++) 541 541 drvdiskintIoLogEntryRelease(pSeg->apIoLog[idx]); 542 542 pSeg = (PDRVDISKSEGMENT)RTMemRealloc(pSeg, RT_OFFSETOF(DRVDISKSEGMENT, apIoLog[cbPreLeft / 512])); 543 543 pSeg->Core.KeyLast = pSeg->Core.Key + cbPreLeft - 1; 544 544 pSeg->cbSeg = cbPreLeft; 545 pSeg->cIoLogEntries = cbPreLeft / 512;545 pSeg->cIoLogEntries = (uint32_t)(cbPreLeft / 512); 546 546 bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core); 547 547 Assert(fInserted); RT_NOREF(fInserted); … … 560 560 pSeg->Core.Key += cbRange; 561 561 pSeg->cbSeg = cbPostLeft; 562 pSeg->cIoLogEntries = cbPostLeft / 512;562 pSeg->cIoLogEntries = (uint32_t)(cbPostLeft / 512); 563 563 bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core); 564 564 Assert(fInserted); RT_NOREF(fInserted); … … 575 575 pSegPost->cbSeg = cbPostLeft; 576 576 pSegPost->pbSeg = (uint8_t *)RTMemAllocZ(cbPostLeft); 577 pSegPost->cIoLogEntries = cbPostLeft / 512;577 pSegPost->cIoLogEntries = (uint32_t)(cbPostLeft / 512); 578 578 if (!pSegPost->pbSeg) 579 579 RTMemFree(pSegPost); … … 581 581 { 582 582 memcpy(pSegPost->pbSeg, pSeg->pbSeg + cbPreLeft + cbRange, cbPostLeft); 583 for (unsigned idx = 0; idx < cbPostLeft / 512; idx++)583 for (unsigned idx = 0; idx < (uint32_t)(cbPostLeft / 512); idx++) 584 584 pSegPost->apIoLog[idx] = pSeg->apIoLog[((cbPreLeft + cbRange) / 512) + idx]; 585 585 … … 591 591 /* Shrink the current segment. */ 592 592 pSeg->pbSeg = (uint8_t *)RTMemRealloc(pSeg->pbSeg, cbPreLeft); 593 for (unsigned idx = cbPreLeft / 512; idx < (cbPreLeft + cbRange) / 512; idx++)593 for (unsigned idx = (uint32_t)(cbPreLeft / 512); idx < (uint32_t)((cbPreLeft + cbRange) / 512); idx++) 594 594 drvdiskintIoLogEntryRelease(pSeg->apIoLog[idx]); 595 595 pSeg = (PDRVDISKSEGMENT)RTMemRealloc(pSeg, RT_OFFSETOF(DRVDISKSEGMENT, apIoLog[cbPreLeft / 512])); 596 596 pSeg->Core.KeyLast = pSeg->Core.Key + cbPreLeft - 1; 597 597 pSeg->cbSeg = cbPreLeft; 598 pSeg->cIoLogEntries = cbPreLeft / 512;598 pSeg->cIoLogEntries = (uint32_t)(cbPreLeft / 512); 599 599 bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core); 600 600 Assert(fInserted); RT_NOREF(fInserted); -
trunk/src/VBox/Devices/Storage/DrvRamDisk.cpp
r64728 r65485 703 703 if (fToIoBuf) 704 704 rc = pThis->pDrvMediaExPort->pfnIoReqCopyToBuf(pThis->pDrvMediaExPort, pIoReq, &pIoReq->abAlloc[0], 705 pIoReq->ReadWrite.cbReq - pIoReq->ReadWrite.cbReqLeft,705 (uint32_t)(pIoReq->ReadWrite.cbReq - pIoReq->ReadWrite.cbReqLeft), 706 706 &pIoReq->ReadWrite.IoBuf.SgBuf, 707 707 RT_MIN(pIoReq->ReadWrite.cbIoBuf, pIoReq->ReadWrite.cbReqLeft)); 708 708 else 709 709 rc = pThis->pDrvMediaExPort->pfnIoReqCopyFromBuf(pThis->pDrvMediaExPort, pIoReq, &pIoReq->abAlloc[0], 710 pIoReq->ReadWrite.cbReq - pIoReq->ReadWrite.cbReqLeft,710 (uint32_t)(pIoReq->ReadWrite.cbReq - pIoReq->ReadWrite.cbReqLeft), 711 711 &pIoReq->ReadWrite.IoBuf.SgBuf, 712 712 RT_MIN(pIoReq->ReadWrite.cbIoBuf, pIoReq->ReadWrite.cbReqLeft));
Note:
See TracChangeset
for help on using the changeset viewer.