VirtualBox

Changeset 70938 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 9, 2018 5:32:07 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120779
Message:

DevVGA-SVGA3d: FLOAT_FMT_ARGS fix for negative values. Fixed formatting bug in vmsvga3dInfoContextWorkerOne.

Location:
trunk/src/VBox/Devices/Graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m

    r69500 r70938  
    4848/**@def FLOAT_FMT_STR
    4949 * Format string bits to go with FLOAT_FMT_ARGS. */
    50 #define FLOAT_FMT_STR                           "%d.%06d"
     50#define FLOAT_FMT_STR                           "%d.%06u"
    5151/** @def FLOAT_FMT_ARGS
    5252 * Format arguments for a float value, corresponding to FLOAT_FMT_STR.
    5353 * @param   r       The floating point value to format.  */
    54 #define FLOAT_FMT_ARGS(r)                       (int)(r), ((unsigned)((r) * 1000000) % 1000000U)
     54#define FLOAT_FMT_ARGS(r)                       (int)(r), ((unsigned)(RT_ABS(r) * 1000000) % 1000000U)
    5555
    5656
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp

    r69923 r70938  
    16941694                    pHlp->pfnPrintf(pHlp, "%s[%#x(%u)] = [" FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR ", " FLOAT_FMT_STR "] ctype=FLOAT\n",
    16951695                                    pszName, i, i,
    1696                                     FLOAT_FMT_ARGS(paConsts[i].value[0]), FLOAT_FMT_ARGS(paConsts[i].value[1]),
    1697                                     FLOAT_FMT_ARGS(paConsts[i].value[2]), FLOAT_FMT_ARGS(paConsts[i].value[3]));
     1696                                    FLOAT_FMT_ARGS(*(float *)&paConsts[i].value[0]), FLOAT_FMT_ARGS(*(float *)&paConsts[i].value[1]),
     1697                                    FLOAT_FMT_ARGS(*(float *)&paConsts[i].value[2]), FLOAT_FMT_ARGS(*(float *)&paConsts[i].value[3]));
    16981698                else
    16991699                    pHlp->pfnPrintf(pHlp, "%s[%#x(%u)] = [%#x, %#x, %#x, %#x] ctype=%s\n",
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h

    r69922 r70938  
    4242/**@def FLOAT_FMT_STR
    4343 * Format string bits to go with FLOAT_FMT_ARGS. */
    44 #define FLOAT_FMT_STR                           "%d.%06d"
     44#define FLOAT_FMT_STR                           "%d.%06u"
    4545/** @def FLOAT_FMT_ARGS
    4646 * Format arguments for a float value, corresponding to FLOAT_FMT_STR.
    4747 * @param   r       The floating point value to format.  */
    48 #define FLOAT_FMT_ARGS(r)                       (int)(r), ((unsigned)((r) * 1000000) % 1000000U)
     48#define FLOAT_FMT_ARGS(r)                       (int)(r), ((unsigned)(RT_ABS(r) * 1000000) % 1000000U)
    4949
    5050
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette