VirtualBox

Changeset 93307 in vbox for trunk


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

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

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioTest.cpp

    r93115 r93307  
    296296                while (cFrames-- > 0)
    297297                {
    298                     *piSample = (int8_t)(126 /*Amplitude*/ * sin(rdFixed * iSrcFrame));
     298                    *piSample = (int8_t)(126 /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame));
    299299                    iSrcFrame++;
    300300                    piSample += cbFrame;
     
    307307                while (cFrames-- > 0)
    308308                {
    309                     *pbSample = (uint8_t)(126 /*Amplitude*/ * sin(rdFixed * iSrcFrame) + 0x80);
     309                    *pbSample = (uint8_t)(126 /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame) + 0x80);
    310310                    iSrcFrame++;
    311311                    pbSample += cbFrame;
     
    320320                while (cFrames-- > 0)
    321321                {
    322                     *piSample = (int16_t)(32760 /*Amplitude*/ * sin(rdFixed * iSrcFrame));
     322                    *piSample = (int16_t)(32760 /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame));
    323323                    iSrcFrame++;
    324324                    piSample = (int16_t *)((uint8_t *)piSample + cbFrame);
     
    331331                while (cFrames-- > 0)
    332332                {
    333                     *puSample = (uint16_t)(32760 /*Amplitude*/ * sin(rdFixed * iSrcFrame) + 0x8000);
     333                    *puSample = (uint16_t)(32760 /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame) + 0x8000);
    334334                    iSrcFrame++;
    335335                    puSample = (uint16_t *)((uint8_t *)puSample + cbFrame);
     
    345345                while (cFrames-- > 0)
    346346                {
    347                     *piSample = (int32_t)((32760 << 16) /*Amplitude*/ * sin(rdFixed * iSrcFrame));
     347                    *piSample = (int32_t)((32760 << 16) /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame));
    348348                    iSrcFrame++;
    349349                    piSample = (int32_t *)((uint8_t *)piSample + cbFrame);
     
    355355                while (cFrames-- > 0)
    356356                {
    357                     *puSample = (uint32_t)((32760 << 16) /*Amplitude*/ * sin(rdFixed * iSrcFrame) + UINT32_C(0x80000000));
     357                    *puSample = (uint32_t)((32760 << 16) /*Amplitude*/ * sin(rdFixed * (double)iSrcFrame) + UINT32_C(0x80000000));
    358358                    iSrcFrame++;
    359359                    puSample = (uint32_t *)((uint8_t *)puSample + cbFrame);
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.h

    r93115 r93307  
    7575 * Format arguments for a float value, corresponding to FLOAT_FMT_STR.
    7676 * @param   r       The floating point value to format.  */
    77 #define FLOAT_FMT_ARGS(r)              (r) >= 0.0f ? "" : "-", (unsigned)RT_ABS(r), (unsigned)(RT_ABS((r) - (unsigned)(r)) * 1000000.0f)
     77#define FLOAT_FMT_ARGS(r)              (r) >= 0.0f ? "" : "-", (unsigned)RT_ABS(r) \
     78                                       , (unsigned)(RT_ABS((r) - (float)(unsigned)(r)) * 1000000.0f)
    7879
    7980/* Deprecated commands. They are not included in the VMSVGA headers anymore. */
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win-d3d9.cpp

    r93115 r93307  
    926926     */
    927927    float const xLeft   = -0.5f;
    928     float const xRight  = (cWidth - 1) - 0.5f;
     928    float const xRight  = (float)(cWidth - 1) - 0.5f;
    929929    float const yTop    = -0.5f;
    930     float const yBottom = (cHeight - 1) - 0.5f;
     930    float const yBottom = (float)(cHeight - 1) - 0.5f;
    931931
    932932    Vertex const aVertices[] =
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r93115 r93307  
    325325                             "  iFrame=%u  cb=%'u  c=%'u  %'uKB/s  %'ufps  cLost=%'u \n",
    326326                             &pArgs->Mac, iFrame, cbReceived, iFrame - cLostFrames,
    327                              (unsigned)(cbReceived * 1000000000.0 / 1024 / (pArgs->u64End - pArgs->u64Start)),
    328                              (unsigned)((iFrame - cLostFrames) * 1000000000.0 / (pArgs->u64End - pArgs->u64Start)),
     327                             (unsigned)((double)cbReceived * 1000000000.0 / 1024 / (double)(pArgs->u64End - pArgs->u64Start)),
     328                             (unsigned)((double)(iFrame - cLostFrames) * 1000000000.0 / (double)(pArgs->u64End - pArgs->u64Start)),
    329329                             cLostFrames);
    330330                return VINF_SUCCESS;
     
    514514
    515515        uint64_t u64Elapsed = RT_MAX(Args0.u64End, Args1.u64End) - RT_MIN(Args0.u64Start, Args1.u64Start);
    516         uint64_t u64Speed = (uint64_t)((2 * g_cbTransfer / 1024) / (u64Elapsed / 1000000000.0));
     516        uint64_t u64Speed = (uint64_t)((double)(2 * g_cbTransfer / 1024) / ((double)u64Elapsed / 1000000000.0));
    517517        RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS,
    518518                     "transferred %u bytes in %'RU64 ns (%'RU64 KB/s)\n",
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