VirtualBox

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

ValKit: VC++ 19.2 update 11 build adjustments (uint64_t -> double conversions). bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp

    r93115 r93302  
    146146                        uint64_t cNsInterval = nsNow - nsStat;
    147147                        uint64_t cbInterval  = cbWritten - cbStatWritten;
    148                         uint64_t cbIntervalPerSec = cbInterval ? (uint64_t)(cbInterval / (cNsInterval / (double)RT_NS_1SEC)) : 0;
     148                        uint64_t cbIntervalPerSec = !cbInterval ? 0
     149                                                  : (uint64_t)((double)cbInterval / ((double)cNsInterval / (double)RT_NS_1SEC));
    149150
    150151                        RTPrintf("%s: %'9RTfoff MiB out of %'9RTfoff are free after writing %'9RU64 MiB (%'5RU64 MiB/s)\n",
     
    173174            /* Issue a summary statements. */
    174175            uint64_t cNsElapsed = RTTimeNanoTS() - nsStart;
    175             uint64_t cbPerSec   = cbWritten ? (uint64_t)(cbWritten / (cNsElapsed / (double)RT_NS_1SEC)) : 0;
     176            uint64_t cbPerSec   = cbWritten ? (uint64_t)((double)cbWritten / ((double)cNsElapsed / (double)RT_NS_1SEC)) : 0;
    176177            RTPrintf("%s: Wrote %'RU64 MiB in %'RU64 s, avg %'RU64 MiB/s.\n",
    177178                     pszFilename, cbWritten / _1M, cNsElapsed / RT_NS_1SEC, cbPerSec / _1M);
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