VirtualBox

Changeset 34378 in vbox


Ignore:
Timestamp:
Nov 25, 2010 3:48:43 PM (14 years ago)
Author:
vboxsync
Message:

iprt/cdefs.h: Added RT_IS_POWER_OF_TWO.

File:
1 edited

Legend:

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

    r33692 r34378  
    11731173 */
    11741174#define RT_ELEMENTS(aArray)                     ( sizeof(aArray) / sizeof((aArray)[0]) )
     1175
     1176/**
     1177 * Checks if the value is a power of two.
     1178 *
     1179 * @returns true if power of two, false if not.
     1180 * @param   uVal                The value to test.
     1181 * @remarks 0 is a power of two.
     1182 * @see     VERR_NOT_POWER_OF_TWO
     1183 */
     1184#define RT_IS_POWER_OF_TWO(uVal)                ( ((uVal) & ((uVal) - 1)) == 0)
    11751185
    11761186#ifdef RT_OS_OS2
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