VirtualBox

Changeset 48848 in vbox


Ignore:
Timestamp:
Oct 3, 2013 7:51:14 PM (11 years ago)
Author:
vboxsync
Message:

VD.cpp: Windows warnings.

File:
1 edited

Legend:

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

    r48743 r48848  
    827827    pIoCtx->pDisk                 = pDisk;
    828828    pIoCtx->enmTxDir              = enmTxDir;
    829     pIoCtx->Req.Io.cbTransferLeft = cbTransfer;
     829    pIoCtx->Req.Io.cbTransferLeft = (uint32_t)cbTransfer; Assert((uint32_t)cbTransfer == cbTransfer);
    830830    pIoCtx->Req.Io.uOffset        = uOffset;
    831831    pIoCtx->Req.Io.cbTransfer     = cbTransfer;
     
    984984        size_t cbLeft = pBlock->cbDiscard;
    985985        bool fAllocated = ASMBitTest(pBlock->pbmAllocated, idxStart);
    986         uint32_t cSectors = pBlock->cbDiscard / 512;
     986        uint32_t cSectors = (uint32_t)(pBlock->cbDiscard / 512);
    987987
    988988        while (cbLeft > 0)
     
    10991099
    11001100                idxStart = (uOffset - pBlock->Core.Key) / 512;
    1101                 idxEnd = idxStart + (cbThisRange / 512);
     1101                idxEnd = idxStart + (int32_t)(cbThisRange / 512);
    11021102                ASMBitSetRange(pBlock->pbmAllocated, idxStart, idxEnd);
    11031103            }
     
    12921292    RTSgBufReset(&pIoCtx->Req.Io.SgBuf);
    12931293    pIoCtx->Req.Io.uOffset        = pIoCtx->Type.Child.uOffsetSaved;
    1294     pIoCtx->Req.Io.cbTransferLeft = pIoCtx->Type.Child.cbTransferLeftSaved;
     1294    pIoCtx->Req.Io.cbTransferLeft = (uint32_t)pIoCtx->Type.Child.cbTransferLeftSaved;
     1295    Assert((uint32_t)pIoCtx->Type.Child.cbTransferLeftSaved == pIoCtx->Type.Child.cbTransferLeftSaved);
    12951296}
    12961297
     
    18291830        {
    18301831            /* No image in the chain contains the data for the block. */
    1831             ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbThisRead);
     1832            ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbThisRead); Assert(cbThisRead == (uint32_t)cbThisRead);
    18321833
    18331834            /* Fill the free space with 0 if we are told to do so
     
    24642465    /* Read the entire data of the block so that we can compare whether it will
    24652466     * be modified by the write or not. */
    2466     pIoCtx->Req.Io.cbTransferLeft = cbPreRead + cbThisWrite + cbPostRead - cbFill;
     2467    size_t cbTmp = cbPreRead + cbThisWrite + cbPostRead - cbFill; Assert(cbTmp == (uint32_t)cbTmp);
     2468    pIoCtx->Req.Io.cbTransferLeft = (uint32_t)cbTmp;
    24672469    pIoCtx->Req.Io.cbTransfer     = pIoCtx->Req.Io.cbTransferLeft;
    24682470    pIoCtx->Req.Io.uOffset       -= cbPreRead;
     
    25982600
    25992601        /* Read the data that goes before the write to fill the block. */
    2600         pIoCtx->Req.Io.cbTransferLeft = cbPreRead;
     2602        pIoCtx->Req.Io.cbTransferLeft = (uint32_t)cbPreRead; Assert(cbPreRead == (uint32_t)cbPreRead);
    26012603        pIoCtx->Req.Io.cbTransfer     = pIoCtx->Req.Io.cbTransferLeft;
    26022604        pIoCtx->Req.Io.uOffset       -= cbPreRead;
     
    27042706                    LogFlow(("Child write request completed\n"));
    27052707                    Assert(pIoCtx->Req.Io.cbTransferLeft >= cbThisWrite);
    2706                     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbThisWrite);
     2708                    Assert(cbThisWrite == (uint32_t)cbThisWrite);
     2709                    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbThisWrite);
    27072710                    vdIoCtxUnlockDisk(pDisk, pIoCtx, false /* fProcessDeferredReqs*/ );
    27082711                    vdIoCtxFree(pDisk, pIoCtxWrite);
     
    28742877        size_t cbLeft = pBlock->cbDiscard;
    28752878        bool fAllocated = ASMBitTest(pBlock->pbmAllocated, idxStart);
    2876         uint32_t cSectors = pBlock->cbDiscard / 512;
     2879        uint32_t cSectors = (uint32_t)(pBlock->cbDiscard / 512);
    28772880
    28782881        while (cbLeft > 0)
     
    30903093
    30913094            idxStart = (offStart - pBlock->Core.Key) / 512;
    3092             idxEnd = idxStart + (cbThisDiscard / 512);
     3095            idxEnd = idxStart + (int32_t)(cbThisDiscard / 512);
    30933096
    30943097            ASMBitClearRange(pBlock->pbmAllocated, idxStart, idxEnd);
     
    30983101
    30993102            /* Call the backend to discard the block if it is completely unallocated now. */
    3100             if (ASMBitFirstSet((volatile void *)pBlock->pbmAllocated, pBlock->cbDiscard / 512) == -1)
     3103            if (ASMBitFirstSet((volatile void *)pBlock->pbmAllocated, (uint32_t)(pBlock->cbDiscard / 512)) == -1)
    31013104            {
    31023105                pIoCtx->Req.Discard.pBlock   = pBlock;
     
    35563559                    /* Update the parent state. */
    35573560                    Assert(pIoCtxParent->Req.Io.cbTransferLeft >= pIoCtx->Type.Child.cbTransferParent);
    3558                     ASMAtomicSubU32(&pIoCtxParent->Req.Io.cbTransferLeft, pIoCtx->Type.Child.cbTransferParent);
     3561                    ASMAtomicSubU32(&pIoCtxParent->Req.Io.cbTransferLeft, (uint32_t)pIoCtx->Type.Child.cbTransferParent);
    35593562                }
    35603563                else
     
    36353638
    36363639    Assert(pIoCtx->Req.Io.cbTransferLeft >= cbTransfer);
    3637     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbTransfer);
     3640    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbTransfer); Assert(cbTransfer == (uint32_t)cbTransfer);
    36383641    ASMAtomicDecU32(&pIoCtx->cDataTransfersPending);
    36393642
     
    40474050                                              Seg.pvSeg, cbRead, NULL);
    40484051        if (RT_SUCCESS(rc))
    4049             ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbRead);
     4052        {
     4053            Assert(cbRead == (uint32_t)cbRead);
     4054            ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbRead);
     4055        }
    40504056    }
    40514057    else
     
    40564062            RTSGSEG  aSeg[VD_IO_TASK_SEGMENTS_MAX];
    40574063            unsigned cSegments  = VD_IO_TASK_SEGMENTS_MAX;
    4058             size_t   cbTaskRead = 0;
    4059 
    4060             cbTaskRead = RTSgBufSegArrayCreate(&pIoCtx->Req.Io.SgBuf, aSeg, &cSegments, cbRead);
     4064            size_t   cbTaskRead = RTSgBufSegArrayCreate(&pIoCtx->Req.Io.SgBuf, aSeg, &cSegments, cbRead);
    40614065
    40624066            Assert(cSegments > 0);
     
    40724076#endif
    40734077
    4074             PVDIOTASK pIoTask = vdIoTaskUserAlloc(pIoStorage, NULL, NULL, pIoCtx, cbTaskRead);
     4078            Assert(cbTaskRead == (uint32_t)cbTaskRead);
     4079            PVDIOTASK pIoTask = vdIoTaskUserAlloc(pIoStorage, NULL, NULL, pIoCtx, (uint32_t)cbTaskRead);
    40754080
    40764081            if (!pIoTask)
     
    40884093            {
    40894094                AssertMsg(cbTaskRead <= pIoCtx->Req.Io.cbTransferLeft, ("Impossible!\n"));
    4090                 ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbTaskRead);
     4095                ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbTaskRead);
    40914096                ASMAtomicDecU32(&pIoCtx->cDataTransfersPending);
    40924097                vdIoTaskFree(pDisk, pIoTask);
     
    41434148                                              Seg.pvSeg, cbWrite, NULL);
    41444149        if (RT_SUCCESS(rc))
    4145             ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbWrite);
     4150        {
     4151            Assert(pIoCtx->Req.Io.cbTransferLeft >= cbWrite);
     4152            ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbWrite);
     4153        }
    41464154    }
    41474155    else
     
    41684176#endif
    41694177
    4170             PVDIOTASK pIoTask = vdIoTaskUserAlloc(pIoStorage, pfnComplete, pvCompleteUser, pIoCtx, cbTaskWrite);
     4178            Assert(cbTaskWrite == (uint32_t)cbTaskWrite);
     4179            PVDIOTASK pIoTask = vdIoTaskUserAlloc(pIoStorage, pfnComplete, pvCompleteUser, pIoCtx, (uint32_t)cbTaskWrite);
    41714180
    41724181            if (!pIoTask)
     
    41844193            {
    41854194                AssertMsg(cbTaskWrite <= pIoCtx->Req.Io.cbTransferLeft, ("Impossible!\n"));
    4186                 ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbTaskWrite);
     4195                ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbTaskWrite);
    41874196                ASMAtomicDecU32(&pIoCtx->cDataTransfersPending);
    41884197                vdIoTaskFree(pDisk, pIoTask);
     
    45624571    Assert(cbCopied == cbBuf);
    45634572
    4564     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbCopied);
     4573    Assert(pIoCtx->Req.Io.cbTransferLeft >= cbCopied);
     4574    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbCopied);
    45654575
    45664576    return cbCopied;
     
    45814591    Assert(cbCopied == cbBuf);
    45824592
    4583     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbCopied);
     4593    Assert(pIoCtx->Req.Io.cbTransferLeft > cbCopied);
     4594    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbCopied);
    45844595
    45854596    return cbCopied;
     
    45994610    Assert(cbSet == cb);
    46004611
    4601     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbSet);
     4612    Assert(pIoCtx->Req.Io.cbTransferLeft >= cbSet);
     4613    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbSet);
    46024614
    46034615    return cbSet;
     
    46414653     */
    46424654    ASMAtomicCmpXchgS32(&pIoCtx->rcReq, rcReq, VINF_SUCCESS);
    4643     ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, cbCompleted);
     4655    Assert(pIoCtx->Req.Io.cbTransferLeft >= cbCompleted);
     4656    ASMAtomicSubU32(&pIoCtx->Req.Io.cbTransferLeft, (uint32_t)cbCompleted);
    46444657
    46454658    /* Set next transfer function if the current one finished.
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