Go to the source code of this file.
|
#define | GPR_MIN(a, b) ((a) < (b) ? (a) : (b)) |
|
#define | GPR_MAX(a, b) ((a) > (b) ? (a) : (b)) |
|
#define | GPR_CLAMP(a, min, max) ((a) < (min) ? (min) : (a) > (max) ? (max) : (a)) |
|
#define | GPR_ROTL(x, n) (((x) << (n)) | ((x) >> (sizeof(x) * 8 - (n)))) |
|
#define | GPR_ROTR(x, n) (((x) >> (n)) | ((x) << (sizeof(x) * 8 - (n)))) |
|
#define | GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) |
|
#define | GPR_SWAP(type, a, b) |
|
#define | GPR_BITSET(i, n) ((*(i)) |= (1u << (n))) |
| Set the n-th bit of i (a mutable pointer). More...
|
|
#define | GPR_BITCLEAR(i, n) ((*(i)) &= ~(1u << (n))) |
| Clear the n-th bit of i (a mutable pointer). More...
|
|
#define | GPR_BITGET(i, n) (((i) & (1u << (n))) != 0) |
| Get the n-th bit of i. More...
|
|
#define | GPR_INTERNAL_HEXDIGIT_BITCOUNT(x) |
|
#define | GPR_BITCOUNT(i) |
| Returns number of bits set in bitset i. More...
|
|
#define GPR_ARRAY_SIZE |
( |
|
array | ) |
(sizeof(array) / sizeof(*(array))) |
#define GPR_BITCLEAR |
( |
|
i, |
|
|
|
n |
|
) |
| ((*(i)) &= ~(1u << (n))) |
Clear the n-th bit of i (a mutable pointer).
#define GPR_BITCOUNT |
( |
|
i | ) |
|
Value:
0x0f0f0f0f) % \
255)
#define GPR_INTERNAL_HEXDIGIT_BITCOUNT(x)
Definition: useful.h:64
Returns number of bits set in bitset i.
#define GPR_BITGET |
( |
|
i, |
|
|
|
n |
|
) |
| (((i) & (1u << (n))) != 0) |
#define GPR_BITSET |
( |
|
i, |
|
|
|
n |
|
) |
| ((*(i)) |= (1u << (n))) |
Set the n-th bit of i (a mutable pointer).
#define GPR_CLAMP |
( |
|
a, |
|
|
|
min, |
|
|
|
max |
|
) |
| ((a) < (min) ? (min) : (a) > (max) ? (max) : (a)) |
#define GPR_INTERNAL_HEXDIGIT_BITCOUNT |
( |
|
x | ) |
|
Value:((x) - (((x) >> 1) & 0x77777777) - (((x) >> 2) & 0x33333333) - \
(((x) >> 3) & 0x11111111))
#define GPR_MAX |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) > (b) ? (a) : (b)) |
#define GPR_MIN |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) < (b) ? (a) : (b)) |
#define GPR_ROTL |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) << (n)) | ((x) >> (sizeof(x) * 8 - (n)))) |
#define GPR_ROTR |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) >> (n)) | ((x) << (sizeof(x) * 8 - (n)))) |
#define GPR_SWAP |
( |
|
type, |
|
|
|
a, |
|
|
|
b |
|
) |
| |
Value:do { \
type x = a; \
a = b; \
b = x; \
} while (0)