VirtualBox

Changeset 65485 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jan 27, 2017 2:22:36 PM (8 years ago)
Author:
vboxsync
Message:

DrvDiskIntegrity,DrvRamDisk: Build fixes after enabling them

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

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

    r65480 r65485  
    309309                pSeg->cbSeg         = cbRange;
    310310                pSeg->pbSeg         = (uint8_t *)RTMemAllocZ(cbRange);
    311                 pSeg->cIoLogEntries = cbRange / 512;
     311                pSeg->cIoLogEntries = (uint32_t)cbRange / 512;
    312312                if (!pSeg->pbSeg)
    313313                    RTMemFree(pSeg);
     
    447447            {
    448448                /* 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;
    450450                AssertMsg(cSector < pSeg->cIoLogEntries, ("Internal bug!\n"));
    451451
     
    538538                    LogFlowFunc(("Realloc segment pSeg=%#p\n", pSeg));
    539539                    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++)
    541541                        drvdiskintIoLogEntryRelease(pSeg->apIoLog[idx]);
    542542                    pSeg = (PDRVDISKSEGMENT)RTMemRealloc(pSeg, RT_OFFSETOF(DRVDISKSEGMENT, apIoLog[cbPreLeft / 512]));
    543543                    pSeg->Core.KeyLast = pSeg->Core.Key + cbPreLeft - 1;
    544544                    pSeg->cbSeg = cbPreLeft;
    545                     pSeg->cIoLogEntries = cbPreLeft / 512;
     545                    pSeg->cIoLogEntries = (uint32_t)(cbPreLeft / 512);
    546546                    bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core);
    547547                    Assert(fInserted); RT_NOREF(fInserted);
     
    560560                    pSeg->Core.Key += cbRange;
    561561                    pSeg->cbSeg = cbPostLeft;
    562                     pSeg->cIoLogEntries = cbPostLeft / 512;
     562                    pSeg->cIoLogEntries = (uint32_t)(cbPostLeft / 512);
    563563                    bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core);
    564564                    Assert(fInserted); RT_NOREF(fInserted);
     
    575575                        pSegPost->cbSeg         = cbPostLeft;
    576576                        pSegPost->pbSeg         = (uint8_t *)RTMemAllocZ(cbPostLeft);
    577                         pSegPost->cIoLogEntries = cbPostLeft / 512;
     577                        pSegPost->cIoLogEntries = (uint32_t)(cbPostLeft / 512);
    578578                        if (!pSegPost->pbSeg)
    579579                            RTMemFree(pSegPost);
     
    581581                        {
    582582                            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++)
    584584                                pSegPost->apIoLog[idx] = pSeg->apIoLog[((cbPreLeft + cbRange) / 512) + idx];
    585585
     
    591591                    /* Shrink the current segment. */
    592592                    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++)
    594594                        drvdiskintIoLogEntryRelease(pSeg->apIoLog[idx]);
    595595                    pSeg = (PDRVDISKSEGMENT)RTMemRealloc(pSeg, RT_OFFSETOF(DRVDISKSEGMENT, apIoLog[cbPreLeft / 512]));
    596596                    pSeg->Core.KeyLast = pSeg->Core.Key + cbPreLeft - 1;
    597597                    pSeg->cbSeg = cbPreLeft;
    598                     pSeg->cIoLogEntries = cbPreLeft / 512;
     598                    pSeg->cIoLogEntries = (uint32_t)(cbPreLeft / 512);
    599599                    bool fInserted = RTAvlrFileOffsetInsert(pThis->pTreeSegments, &pSeg->Core);
    600600                    Assert(fInserted); RT_NOREF(fInserted);
  • trunk/src/VBox/Devices/Storage/DrvRamDisk.cpp

    r64728 r65485  
    703703    if (fToIoBuf)
    704704        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),
    706706                                                       &pIoReq->ReadWrite.IoBuf.SgBuf,
    707707                                                       RT_MIN(pIoReq->ReadWrite.cbIoBuf, pIoReq->ReadWrite.cbReqLeft));
    708708    else
    709709        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),
    711711                                                         &pIoReq->ReadWrite.IoBuf.SgBuf,
    712712                                                         RT_MIN(pIoReq->ReadWrite.cbIoBuf, pIoReq->ReadWrite.cbReqLeft));
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