#define N_ELEMENTS(arr) \
(sizeof(arr) / sizeof((arr)[0]))
-#define BITS_IN_UINT (CHAR_BIT * sizeof(unsigned int))
-
#define MEM_ALIGN(size) \
(((size) + MEM_ALIGN_SIZE-1) & ~((unsigned int) MEM_ALIGN_SIZE-1))
#define I_MIN(a, b) (((a) < (b)) ? (a) : (b))
#define I_MAX(a, b) (((a) > (b)) ? (a) : (b))
-#undef CLAMP
-#define CLAMP(x, low, high) \
- (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
-
/* make it easier to cast from/to pointers. assumes that
sizeof(size_t) == sizeof(void *) and they're both the largest datatypes
that are allowed to be used. so, long long isn't safe with these. */