VirtualBox

Changeset 93308 in vbox


Ignore:
Timestamp:
Jan 18, 2022 11:31:19 AM (3 years ago)
Author:
vboxsync
Message:

VMM: VC++ 19.2 update 11 build adjustments (lossy floating point conversions). bugref:8489

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp

    r93115 r93308  
    19071907    /* estimate the speed */
    19081908    uint64_t cNsElapsed = RTTimeNanoTS() - pVM->pgm.s.LiveSave.uSaveStartNS;
    1909     uint32_t cPagesPerSecond = (uint32_t)(   pVM->pgm.s.LiveSave.cSavedPages
     1909    uint32_t cPagesPerSecond = (uint32_t)(  (long double)pVM->pgm.s.LiveSave.cSavedPages
    19101910                                          / ((long double)cNsElapsed / 1000000000.0) );
    19111911    pVM->pgm.s.LiveSave.cPagesPerSecond = cPagesPerSecond;
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r93115 r93308  
    40594059{
    40604060    if (cchWidth != 100)
    4061         uPct = (uPct + 0.5) * (cchWidth / 100.0);
     4061        uPct = (size_t)(((double)uPct + 0.5) * ((double)cchWidth / 100.0));
    40624062    return uPct;
    40634063}
  • trunk/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp

    r93115 r93308  
    101101    uint32_t u32Crc = RTCrc32(pabSrc, cbSrc);
    102102    NanoTS = RTTimeNanoTS() - NanoTS;
    103     unsigned uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     103    unsigned uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    104104    RTPrintf("CRC-32    %'9u KB/s  %'15llu ns - %08x\n", uSpeed, NanoTS, u32Crc);
    105105
     
    108108    uint64_t u64Crc = RTCrc64(pabSrc, cbSrc);
    109109    NanoTS = RTTimeNanoTS() - NanoTS;
    110     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     110    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    111111    RTPrintf("CRC-64    %'9u KB/s  %'15llu ns - %016llx\n", uSpeed, NanoTS, u64Crc);
    112112
     
    114114    u32Crc = RTCrcAdler32(pabSrc, cbSrc);
    115115    NanoTS = RTTimeNanoTS() - NanoTS;
    116     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     116    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    117117    RTPrintf("Adler-32  %'9u KB/s  %'15llu ns - %08x\n", uSpeed, NanoTS, u32Crc);
    118118
     
    121121    RTMd5(pabSrc, cbSrc, abMd5Hash);
    122122    NanoTS = RTTimeNanoTS() - NanoTS;
    123     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     123    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    124124    char szDigest[257];
    125125    RTMd5ToString(abMd5Hash, szDigest, sizeof(szDigest));
     
    130130    RTSha1(pabSrc, cbSrc, abSha1Hash);
    131131    NanoTS = RTTimeNanoTS() - NanoTS;
    132     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     132    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    133133    RTSha1ToString(abSha1Hash, szDigest, sizeof(szDigest));
    134134    RTPrintf("SHA-1     %'9u KB/s  %'15llu ns - %s\n", uSpeed, NanoTS, szDigest);
     
    138138    RTSha256(pabSrc, cbSrc, abSha256Hash);
    139139    NanoTS = RTTimeNanoTS() - NanoTS;
    140     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     140    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    141141    RTSha256ToString(abSha256Hash, szDigest, sizeof(szDigest));
    142142    RTPrintf("SHA-256   %'9u KB/s  %'15llu ns - %s\n", uSpeed, NanoTS, szDigest);
     
    146146    RTSha512(pabSrc, cbSrc, abSha512Hash);
    147147    NanoTS = RTTimeNanoTS() - NanoTS;
    148     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     148    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    149149    RTSha512ToString(abSha512Hash, szDigest, sizeof(szDigest));
    150150    RTPrintf("SHA-512   %'9u KB/s  %'15llu ns - %s\n", uSpeed, NanoTS, szDigest);
     
    169169        RTCrc32(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE);
    170170    NanoTS = RTTimeNanoTS() - NanoTS;
    171     unsigned uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     171    unsigned uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    172172    RTPrintf("CRC-32    %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    173173
     
    177177        RTCrc64(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE);
    178178    NanoTS = RTTimeNanoTS() - NanoTS;
    179     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     179    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    180180    RTPrintf("CRC-64    %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    181181
     
    184184        RTCrcAdler32(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE);
    185185    NanoTS = RTTimeNanoTS() - NanoTS;
    186     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     186    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    187187    RTPrintf("Adler-32  %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    188188
     
    192192        RTMd5(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE, abMd5Hash);
    193193    NanoTS = RTTimeNanoTS() - NanoTS;
    194     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     194    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    195195    RTPrintf("MD5       %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    196196
     
    200200        RTSha1(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE, abSha1Hash);
    201201    NanoTS = RTTimeNanoTS() - NanoTS;
    202     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     202    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    203203    RTPrintf("SHA-1     %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    204204
     
    208208        RTSha256(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE, abSha256Hash);
    209209    NanoTS = RTTimeNanoTS() - NanoTS;
    210     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     210    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    211211    RTPrintf("SHA-256   %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    212212
     
    216216        RTSha512(&pabSrc[iPage * PAGE_SIZE], PAGE_SIZE, abSha512Hash);
    217217    NanoTS = RTTimeNanoTS() - NanoTS;
    218     uSpeed = (unsigned)(cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
     218    uSpeed = (unsigned)((long double)cbSrc / (long double)NanoTS * 1000000000.0 / 1024);
    219219    RTPrintf("SHA-512   %'9u KB/s  %'15llu ns\n", uSpeed, NanoTS);
    220220}
     
    573573        if (RT_SUCCESS(aTests[j].rc))
    574574        {
    575             unsigned uComprSpeedIn    = (unsigned)(cbTotalKB         / (long double)aTests[j].cNanoCompr   * 1000000000.0);
    576             unsigned uComprSpeedOut   = (unsigned)(aTests[j].cbCompr / (long double)aTests[j].cNanoCompr   * 1000000000.0 / 1024);
     575            unsigned uComprSpeedIn    = (unsigned)((long double)cbTotalKB         / (long double)aTests[j].cNanoCompr   * 1000000000.0);
     576            unsigned uComprSpeedOut   = (unsigned)((long double)aTests[j].cbCompr / (long double)aTests[j].cNanoCompr   * 1000000000.0 / 1024);
     577            unsigned uDecomprSpeedIn  = (unsigned)((long double)aTests[j].cbCompr / (long double)aTests[j].cNanoDecompr * 1000000000.0 / 1024);
     578            unsigned uDecomprSpeedOut = (unsigned)((long double)cbTotalKB         / (long double)aTests[j].cNanoDecompr * 1000000000.0);
    577579            unsigned uRatio           = (unsigned)(aTests[j].cbCompr / cIterations * 100 / g_cbPages);
    578             unsigned uDecomprSpeedIn  = (unsigned)(aTests[j].cbCompr / (long double)aTests[j].cNanoDecompr * 1000000000.0 / 1024);
    579             unsigned uDecomprSpeedOut = (unsigned)(cbTotalKB         / (long double)aTests[j].cNanoDecompr * 1000000000.0);
    580580            RTPrintf("%-20s %'9u KB/s  %'9u KB/s  %3u%%  %'11llu bytes   %'9u KB/s  %'9u KB/s",
    581581                     aTests[j].pszName,
  • trunk/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp

    r93115 r93308  
    374374         * The minimum chance is 33 percent.
    375375         */
    376         iWriteChance = 100 - (int)(((float)100.0 / pTestFile->cbFileMax) * (float)pTestFile->cbFileCurr);
     376        iWriteChance = 100 - (int)((100.0 / (double)pTestFile->cbFileMax) * (double)pTestFile->cbFileCurr);
    377377        iWriteChance = RT_MAX(33, iWriteChance);
    378378
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