Go to the documentation of this file.
30 #define htonll(x) ((1==htonl(1)) ? (x) : \
31 ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
35 #define ntohll(x) ((1==ntohl(1)) ? (x) : \
36 ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
49 static inline unsigned int
62 static inline unsigned int
135 const int d1 = x - y;
136 const int d2 = (x > y ? -mod : mod) + d1;
137 ASSERT(0 <= x && x < mod && 0 <= y && y < mod);
138 return abs(d1) > abs(d2) ? d2 : d1;
151 ASSERT(0 <= x && x < mod && -mod <= y && y <= mod);
184 if (index < 0 || index >= size)
186 msg(
M_FATAL,
"Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d",
201 return (num / multiple) * multiple;
static unsigned int min_uint(unsigned int x, unsigned int y)
static int modulo_add(int x, int y, int mod)
static int clamp_size_to_int(size_t size)
static size_t round_down_size(size_t num, size_t multiple)
Rounds down num to the nearest multiple of multiple.
static size_t adjust_power_of_2(size_t u)
static int max_int(int x, int y)
static int min_int(int x, int y)
static int constrain_int(int x, int min, int max)
static unsigned int max_uint(unsigned int x, unsigned int y)
static int index_verify(int index, int size, const char *file, int line)
static int modulo_subtract(int x, int y, int mod)