Add CountBits() to the server.
Function to count the number of bits set in the given array. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
committed by
Peter Hutterer
parent
eaf0b6a4d8
commit
fc48a8f9f5
@@ -60,6 +60,7 @@ SOFTWARE.
|
||||
#define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
|
||||
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
|
||||
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
|
||||
extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
|
||||
|
||||
#define SameClient(obj,client) \
|
||||
(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
|
||||
|
||||
Reference in New Issue
Block a user