VirtualBox

Changeset 62426 in vbox


Ignore:
Timestamp:
Jul 22, 2016 11:29:41 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108977
Message:

iprt/cdefs.h: RT_LO_U8,U16,U32: workaround for level 4 MSC warnings when used with constants.

File:
1 edited

Legend:

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

    r62362 r62426  
    22792279#ifdef __GNUC__
    22802280# define RT_LO_U8(a)    __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint16_t)); (uint8_t)(a); })
     2281#elif defined(_MSC_VER) /* shut up cast truncates constant value warnings */
     2282# define RT_LO_U8(a)                            ( (uint8_t)(UINT8_MAX & (a)) )
    22812283#else
    22822284# define RT_LO_U8(a)                            ( (uint8_t)(a) )
     
    22942296#ifdef __GNUC__
    22952297# define RT_LO_U16(a)   __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint32_t)); (uint16_t)(a); })
     2298#elif defined(_MSC_VER) /* shut up cast truncates constant value warnings */
     2299# define RT_LO_U16(a)                           ( (uint16_t)(UINT16_MAX & (a)) )
    22962300#else
    22972301# define RT_LO_U16(a)                           ( (uint16_t)(a) )
     
    23092313#ifdef __GNUC__
    23102314# define RT_LO_U32(a)   __extension__ ({ AssertCompile(sizeof((a)) == sizeof(uint64_t)); (uint32_t)(a); })
     2315#elif defined(_MSC_VER) /* shut up cast truncates constant value warnings */
     2316# define RT_LO_U32(a)                           ( (uint32_t)(UINT32_MAX & (a)) )
    23112317#else
    23122318# define RT_LO_U32(a)                           ( (uint32_t)(a) )
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