VirtualBox

Changeset 77119 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Feb 1, 2019 2:49:48 PM (6 years ago)
Author:
vboxsync
Message:

cdefs.h: Explicitly cast the result of RT_BYTE[1..7]() to uint8_t to fix a compile error with recent clang

File:
1 edited

Legend:

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

    r76585 r77119  
    26872687/** @def RT_BYTE1
    26882688 * Gets the first byte of something. */
    2689 #define RT_BYTE1(a)                             ( (a)         & 0xff )
     2689#define RT_BYTE1(a)                             ( (uint8_t)((a)         & 0xff) )
    26902690/** @def RT_BYTE2
    26912691 * Gets the second byte of something. */
    2692 #define RT_BYTE2(a)                             ( ((a) >>  8) & 0xff )
     2692#define RT_BYTE2(a)                             ( (uint8_t)(((a) >>  8) & 0xff) )
    26932693/** @def RT_BYTE3
    26942694 * Gets the second byte of something. */
    2695 #define RT_BYTE3(a)                             ( ((a) >> 16) & 0xff )
     2695#define RT_BYTE3(a)                             ( (uint8_t)(((a) >> 16) & 0xff) )
    26962696/** @def RT_BYTE4
    26972697 * Gets the fourth byte of something. */
    2698 #define RT_BYTE4(a)                             ( ((a) >> 24) & 0xff )
     2698#define RT_BYTE4(a)                             ( (uint8_t)(((a) >> 24) & 0xff) )
    26992699/** @def RT_BYTE5
    27002700 * Gets the fifth byte of something. */
    2701 #define RT_BYTE5(a)                             ( ((a) >> 32) & 0xff )
     2701#define RT_BYTE5(a)                             ( (uint8_t)(((a) >> 32) & 0xff) )
    27022702/** @def RT_BYTE6
    27032703 * Gets the sixth byte of something. */
    2704 #define RT_BYTE6(a)                             ( ((a) >> 40) & 0xff )
     2704#define RT_BYTE6(a)                             ( (uint8_t)(((a) >> 40) & 0xff) )
    27052705/** @def RT_BYTE7
    27062706 * Gets the seventh byte of something. */
    2707 #define RT_BYTE7(a)                             ( ((a) >> 48) & 0xff )
     2707#define RT_BYTE7(a)                             ( (uint8_t)(((a) >> 48) & 0xff) )
    27082708/** @def RT_BYTE8
    27092709 * Gets the eight byte of something. */
    2710 #define RT_BYTE8(a)                             ( ((a) >> 56) & 0xff )
     2710#define RT_BYTE8(a)                             ( (uint8_t)(((a) >> 56) & 0xff) )
    27112711
    27122712
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