From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:36 +0000 (-0700) Subject: Change to shared header file unrelated to open-vm-tools. X-Git-Tag: stable-10.2.0~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e0b9513236e4494f089cdaee641af5e80adc5c8;p=thirdparty%2Fopen-vm-tools.git Change to shared header file unrelated to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/vm_basic_math.h b/open-vm-tools/lib/include/vm_basic_math.h index 6828ae0ce..0f7b55929 100644 --- a/open-vm-tools/lib/include/vm_basic_math.h +++ b/open-vm-tools/lib/include/vm_basic_math.h @@ -71,6 +71,7 @@ ExponentialAvg(uint32 avg, uint32 value, uint32 gainNumer, uint32 gainDenom) *----------------------------------------------------------------------------- * * IsZeroOrPowerOfTwo -- + * IsZeroOrPowerOfTwo64 -- * * Results: * TRUE iff the value is 0 or a power of two. @@ -81,6 +82,13 @@ ExponentialAvg(uint32 avg, uint32 value, uint32 gainNumer, uint32 gainDenom) *----------------------------------------------------------------------------- */ +static INLINE Bool +IsZeroOrPowerOfTwo64(uint64 x) +{ + return !(x & (x - 1)); +} + + static INLINE Bool IsZeroOrPowerOfTwo(uint32 x) // IN {