VirtualBox

Changeset 101222 in vbox for trunk


Ignore:
Timestamp:
Sep 21, 2023 2:41:09 PM (19 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159200
Message:

iprt/cdefs.h,DevSmc.cpp: Added RT_MAKE_U32_FROM_MSB_U8 to deal with the 'OSK0'/'OSK1' compiler warnings. Also added RT_MAKE_U64_FROM_MSB_U8 and RT_MAKE_U64_FROM_MSW_U16 completeness.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cdefs.h

    r100106 r101222  
    32343234
    32353235/** @def RT_MAKE_U64_FROM_U16
    3236  * Constructs a uint64_t value from four uint16_t values.
     3236 * Constructs a uint64_t value from four uint16_t values, with parameters in
     3237 * least significant word first order.
     3238 * @see RT_MAKE_U64_FROM_MSW_U16
    32373239 */
    32383240#define RT_MAKE_U64_FROM_U16(w0, w1, w2, w3) \
     
    32423244                |            (uint16_t)(w0) ))
    32433245
     3246/** @def RT_MAKE_U64_FROM_U16
     3247 * Constructs a uint64_t value from four uint16_t values, with parameters in
     3248 * most significant word first order.
     3249 * @see RT_MAKE_U64_FROM_U16
     3250 */
     3251#define RT_MAKE_U64_FROM_MSW_U16(w3, w2, w1, w0) RT_MAKE_U64_FROM_U16(w0, w1, w2, w3)
     3252
    32443253/** @def RT_MAKE_U64_FROM_U8
    3245  * Constructs a uint64_t value from eight uint8_t values.
     3254 * Constructs a uint64_t value from eight uint8_t values, with parameters in
     3255 * least significant byte first order.
     3256 * @see RT_MAKE_U64_FROM_MSB_U8
    32463257 */
    32473258#define RT_MAKE_U64_FROM_U8(b0, b1, b2, b3, b4, b5, b6, b7) \
     
    32553266                | (uint64_t) (uint8_t)(b0) ))
    32563267
     3268/** @def RT_MAKE_U64_FROM_MSB_U8
     3269 * Constructs a uint64_t value from eight uint8_t values, with parameters in
     3270 * most significant byte first order.
     3271 * @see RT_MAKE_U64_FROM_U8
     3272 */
     3273#define RT_MAKE_U64_FROM_MSB_U8(b7, b6, b5, b4, b3, b2, b1, b0) RT_MAKE_U64_FROM_U8(b0, b1, b2, b3, b4, b5, b6, b7)
     3274
    32573275/** @def RT_MAKE_U32
    32583276 * Constructs a uint32_t value from two uint16_t values.
     
    32633281
    32643282/** @def RT_MAKE_U32_FROM_U8
    3265  * Constructs a uint32_t value from four uint8_t values.
     3283 * Constructs a uint32_t value from four uint8_t values, with parameters in
     3284 * least significant byte first order.
     3285 * @see RT_MAKE_U32_FROM_MSB_U8
    32663286 */
    32673287#define RT_MAKE_U32_FROM_U8(b0, b1, b2, b3) \
     
    32703290                | (uint32_t)((uint8_t)(b1)) << 8 \
    32713291                |            (uint8_t)(b0) ))
     3292
     3293/** @def RT_MAKE_U32_FROM_MSB_U8
     3294 * Constructs a uint32_t value from four uint8_t values, with parameters in most
     3295 * significant byte first order.
     3296 * @see RT_MAKE_U32_FROM_8
     3297 */
     3298#define RT_MAKE_U32_FROM_MSB_U8(b3, b2, b1, b0) RT_MAKE_U32_FROM_U8(b0, b1, b2, b3)
    32723299
    32733300/** @def RT_MAKE_U16
  • trunk/src/VBox/Devices/EFI/DevSmc.cpp

    r100108 r101222  
    563563    for (int i = 0; i < 2; i++)
    564564    {
    565         inputStruct.key = (uint32_t)(i == 0 ? 'OSK0' : 'OSK1');
     565        inputStruct.key = i == 0 ? RT_MAKE_U32_FROM_MSB_U8('O','S','K','0') : RT_MAKE_U32_FROM_MSB_U8('O','S','K','1');
    566566        kr = IOConnectCallStructMethod((mach_port_t)port,
    567567                                       (uint32_t)2,
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