VirtualBox

Changeset 48847 in vbox


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

Addressing 64-bit windows warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/testcase/vbox-img.cpp

    r46721 r48847  
    434434    {
    435435        /* Repeat reading until buffer is full or EOF. */
    436         size_t cbSumRead = 0, cbRead;
    437         uint8_t *pTmp = (uint8_t *)&pFS->abBuffer[0];
     436        size_t cbRead;
     437        size_t cbSumRead = 0;
     438        uint8_t *pbTmp = (uint8_t *)&pFS->abBuffer[0];
    438439        size_t cbTmp = sizeof(pFS->abBuffer);
    439440        do
    440441        {
    441             rc = RTFileRead(pFS->file, pTmp, cbTmp, &cbRead);
     442            rc = RTFileRead(pFS->file, pbTmp, cbTmp, &cbRead);
    442443            if (RT_FAILURE(rc))
    443444                return rc;
    444             pTmp += cbRead;
     445            pbTmp += cbRead;
    445446            cbTmp -= cbRead;
    446447            cbSumRead += cbRead;
     
    448449
    449450        pFS->offBuffer = 0;
    450         pFS->cbBuffer = cbSumRead;
     451        pFS->cbBuffer = (uint32_t)cbSumRead;
    451452        if (!cbSumRead && !pcbRead) /* Caller can't handle partial reads. */
    452453            return VERR_EOF;
     
    468469
    469470            /* Repeat reading until buffer is full or EOF. */
    470             size_t cbSumRead = 0, cbRead;
    471             uint8_t *pTmp = (uint8_t *)&pFS->abBuffer[0];
     471            size_t cbRead;
     472            size_t cbSumRead = 0;
     473            uint8_t *pbTmp = (uint8_t *)&pFS->abBuffer[0];
    472474            size_t cbTmp = sizeof(pFS->abBuffer);
    473475            do
    474476            {
    475                 rc = RTFileRead(pFS->file, pTmp, cbTmp, &cbRead);
     477                rc = RTFileRead(pFS->file, pbTmp, cbTmp, &cbRead);
    476478                if (RT_FAILURE(rc))
    477479                    return rc;
    478                 pTmp += cbRead;
     480                pbTmp += cbRead;
    479481                cbTmp -= cbRead;
    480482                cbSumRead += cbRead;
     
    482484
    483485            pFS->offBuffer += pFS->cbBuffer;
    484             pFS->cbBuffer = cbSumRead;
    485         }
    486 
    487         uint32_t cbThisRead = RT_MIN(cbBuffer,
    488                                      pFS->cbBuffer - uOffset % sizeof(pFS->abBuffer));
     486            pFS->cbBuffer = (uint32_t)cbSumRead;
     487        }
     488
     489        uint32_t cbThisRead = (uint32_t)RT_MIN(cbBuffer,
     490                                               pFS->cbBuffer - uOffset % sizeof(pFS->abBuffer));
    489491        memcpy(pvBuffer, &pFS->abBuffer[uOffset % sizeof(pFS->abBuffer)],
    490492               cbThisRead);
     
    658660        }
    659661
    660         uint32_t cbThisWrite = RT_MIN(cbBuffer,
    661                                       sizeof(pFS->abBuffer) - uOffset % sizeof(pFS->abBuffer));
     662        uint32_t cbThisWrite = (uint32_t)RT_MIN(cbBuffer,
     663                                                sizeof(pFS->abBuffer) - uOffset % sizeof(pFS->abBuffer));
    662664        memcpy(&pFS->abBuffer[uOffset % sizeof(pFS->abBuffer)], pvBuffer,
    663665               cbThisWrite);
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