Go to the source code of this file.
|
| #define | NULL ((void *) 0) |
| |
| #define | offsetof(type, field) ((size_t) (&((type *) 0)->field)) |
| |
| #define | container_of(ptr, type, member) |
| |
| #define | likely(expr) (!!(expr)) |
| |
| #define | unlikely(expr) (!!(expr)) |
| |
| #define | min(a, b) |
| |
| #define | max(a, b) |
| |
| #define | clamp(v, a, b) min(max(a, v), b) |
| |
| #define | ifloor(x) ((x) > 0 ? (int) (x) : (int) ((x) -0.9999999999)) |
| |
| #define | iround(x) ((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) -0.5)) |
| |
| #define | iceil(x) ((x) > 0 ? (int) ((x) + 0.9999999999) : (int) (x)) |
| |
| #define | idiv255(x) ((((int) (x) + 1) * 257) >> 16) |
| |
| #define | X(...) ("" #__VA_ARGS__ "") |
| |
◆ clamp
| #define clamp |
( |
|
v, |
|
|
|
a, |
|
|
|
b |
|
) |
| min(max(a, v), b) |
◆ container_of
| #define container_of |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value: ({ \
const typeof(((type *) 0)->member) *__mptr = (ptr); \
(type *) ((
char *) __mptr -
offsetof(type, member)); \
})
#define offsetof(type, field)
Definition stddef.h:13
◆ iceil
| #define iceil |
( |
|
x | ) |
((x) > 0 ? (int) ((x) + 0.9999999999) : (int) (x)) |
◆ idiv255
| #define idiv255 |
( |
|
x | ) |
((((int) (x) + 1) * 257) >> 16) |
◆ ifloor
| #define ifloor |
( |
|
x | ) |
((x) > 0 ? (int) (x) : (int) ((x) -0.9999999999)) |
◆ iround
| #define iround |
( |
|
x | ) |
((x) > 0 ? (int) ((x) + 0.5) : (int) ((x) -0.5)) |
◆ likely
| #define likely |
( |
|
expr | ) |
(!!(expr)) |
◆ max
Value: ({ \
typeof(a) _amax = (a); \
typeof(b) _bmax = (b); \
(void) (&_amax == &_bmax); \
_amax > _bmax ? _amax : _bmax; \
})
◆ min
Value: ({ \
typeof(a) _amin = (a); \
typeof(b) _bmin = (b); \
(void) (&_amin == &_bmin); \
_amin < _bmin ? _amin : _bmin; \
})
◆ NULL
| #define NULL ((void *) 0) |
◆ offsetof
| #define offsetof |
( |
|
type, |
|
|
|
field |
|
) |
| ((size_t) (&((type *) 0)->field)) |
◆ unlikely
| #define unlikely |
( |
|
expr | ) |
(!!(expr)) |
| #define X |
( |
|
... | ) |
("" #__VA_ARGS__ "") |
◆ anonymous enum