|
Blender
V2.93
|
#include "BLI_compiler_compat.h"#include "BLI_sys_types.h"#include "BLI_utildefines_variadic.h"#include "BLI_assert.h"#include "BLI_compiler_typecheck.h"Go to the source code of this file.
Macros | |
Min/Max Macros | |
| #define | MIN2(a, b) ((a) < (b) ? (a) : (b)) |
| #define | MAX2(a, b) ((a) > (b) ? (a) : (b)) |
| #define | MIN3(a, b, c) (MIN2(MIN2((a), (b)), (c))) |
| #define | MIN4(a, b, c, d) (MIN2(MIN2((a), (b)), MIN2((c), (d)))) |
| #define | MAX3(a, b, c) (MAX2(MAX2((a), (b)), (c))) |
| #define | MAX4(a, b, c, d) (MAX2(MAX2((a), (b)), MAX2((c), (d)))) |
| #define | MAX3_PAIR(cmp_a, cmp_b, cmp_c, ret_a, ret_b, ret_c) ((cmp_a > cmp_b) ? ((cmp_a > cmp_c) ? ret_a : ret_c) : ((cmp_b > cmp_c) ? ret_b : ret_c)) |
| #define | MIN3_PAIR(cmp_a, cmp_b, cmp_c, ret_a, ret_b, ret_c) ((cmp_a < cmp_b) ? ((cmp_a < cmp_c) ? ret_a : ret_c) : ((cmp_b < cmp_c) ? ret_b : ret_c)) |
| #define | INIT_MINMAX(min, max) |
| #define | INIT_MINMAX2(min, max) |
| #define | DO_MIN(vec, min) |
| #define | DO_MAX(vec, max) |
| #define | DO_MINMAX(vec, min, max) |
| #define | DO_MINMAX2(vec, min, max) |
Swap/Shift Macros | |
| #define | SWAP(type, a, b) |
| #define | SWAP_TVAL(tval, a, b) |
| #define | SHIFT3(type, a, b, c) |
| #define | SHIFT4(type, a, b, c, d) |
Equal to Any Element (ELEM) Macro | |
| #define | _VA_ELEM2(v, a) ((v) == (a)) |
| #define | _VA_ELEM3(v, a, b) (_VA_ELEM2(v, a) || _VA_ELEM2(v, b)) |
| #define | _VA_ELEM4(v, a, b, c) (_VA_ELEM3(v, a, b) || _VA_ELEM2(v, c)) |
| #define | _VA_ELEM5(v, a, b, c, d) (_VA_ELEM4(v, a, b, c) || _VA_ELEM2(v, d)) |
| #define | _VA_ELEM6(v, a, b, c, d, e) (_VA_ELEM5(v, a, b, c, d) || _VA_ELEM2(v, e)) |
| #define | _VA_ELEM7(v, a, b, c, d, e, f) (_VA_ELEM6(v, a, b, c, d, e) || _VA_ELEM2(v, f)) |
| #define | _VA_ELEM8(v, a, b, c, d, e, f, g) (_VA_ELEM7(v, a, b, c, d, e, f) || _VA_ELEM2(v, g)) |
| #define | _VA_ELEM9(v, a, b, c, d, e, f, g, h) (_VA_ELEM8(v, a, b, c, d, e, f, g) || _VA_ELEM2(v, h)) |
| #define | _VA_ELEM10(v, a, b, c, d, e, f, g, h, i) (_VA_ELEM9(v, a, b, c, d, e, f, g, h) || _VA_ELEM2(v, i)) |
| #define | _VA_ELEM11(v, a, b, c, d, e, f, g, h, i, j) (_VA_ELEM10(v, a, b, c, d, e, f, g, h, i) || _VA_ELEM2(v, j)) |
| #define | _VA_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) (_VA_ELEM11(v, a, b, c, d, e, f, g, h, i, j) || _VA_ELEM2(v, k)) |
| #define | _VA_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) (_VA_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) || _VA_ELEM2(v, l)) |
| #define | _VA_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) (_VA_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) || _VA_ELEM2(v, m)) |
| #define | _VA_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) (_VA_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) || _VA_ELEM2(v, n)) |
| #define | _VA_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) (_VA_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) || _VA_ELEM2(v, o)) |
| #define | _VA_ELEM17(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) (_VA_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) || _VA_ELEM2(v, p)) |
| #define | ELEM(...) VA_NARGS_CALL_OVERLOAD(_VA_ELEM, __VA_ARGS__) |
Simple Math Macros | |
| #define | IS_EQ(a, b) |
| #define | IS_EQF(a, b) |
| #define | IS_EQT(a, b, c) (((a) > (b)) ? ((((a) - (b)) <= (c))) : (((((b) - (a)) <= (c))))) |
| #define | IN_RANGE(a, b, c) (((b) < (c)) ? (((b) < (a) && (a) < (c))) : (((c) < (a) && (a) < (b)))) |
| #define | IN_RANGE_INCL(a, b, c) (((b) < (c)) ? (((b) <= (a) && (a) <= (c))) : (((c) <= (a) && (a) <= (b)))) |
| #define | DECIMAL_DIGITS_BOUND(t) (241 * sizeof(t) / 100 + 1) |
Clamp Macros | |
| #define | CLAMPIS(a, b, c) ((a) < (b) ? (b) : (a) > (c) ? (c) : (a)) |
| #define | CLAMP(a, b, c) |
| #define | CLAMP_MAX(a, c) |
| #define | CLAMP_MIN(a, b) |
| #define | CLAMP2(vec, b, c) |
| #define | CLAMP2_MIN(vec, b) |
| #define | CLAMP2_MAX(vec, b) |
| #define | CLAMP3(vec, b, c) |
| #define | CLAMP3_MIN(vec, b) |
| #define | CLAMP3_MAX(vec, b) |
| #define | CLAMP4(vec, b, c) |
| #define | CLAMP4_MIN(vec, b) |
| #define | CLAMP4_MAX(vec, b) |
Array Unpacking Macros | |
| #define | UNPACK2(a) ((a)[0]), ((a)[1]) |
| #define | UNPACK3(a) UNPACK2(a), ((a)[2]) |
| #define | UNPACK4(a) UNPACK3(a), ((a)[3]) |
| #define | UNPACK2_EX(pre, a, post) (pre((a)[0]) post), (pre((a)[1]) post) |
| #define | UNPACK3_EX(pre, a, post) UNPACK2_EX(pre, a, post), (pre((a)[2]) post) |
| #define | UNPACK4_EX(pre, a, post) UNPACK3_EX(pre, a, post), (pre((a)[3]) post) |
Array Macros | |
| #define | ARRAY_LAST_ITEM(arr_start, arr_dtype, arr_len) (arr_dtype *)((char *)(arr_start) + (sizeof(*((arr_dtype *)NULL)) * (size_t)(arr_len - 1))) |
| #define | ARRAY_HAS_ITEM(arr_item, arr_start, arr_len) |
| #define | ARRAY_DELETE(arr, index, delete_len, arr_len) |
| #define | ARRAY_DELETE_REORDER_LAST(arr, index, delete_len, arr_len) |
| #define | ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*(arr))) |
| #define | _VA_ARRAY_SET_ITEMS2(v, a) ((v)[0] = (a)) |
| #define | _VA_ARRAY_SET_ITEMS3(v, a, b) |
| #define | _VA_ARRAY_SET_ITEMS4(v, a, b, c) |
| #define | _VA_ARRAY_SET_ITEMS5(v, a, b, c, d) |
| #define | _VA_ARRAY_SET_ITEMS6(v, a, b, c, d, e) |
| #define | _VA_ARRAY_SET_ITEMS7(v, a, b, c, d, e, f) |
| #define | _VA_ARRAY_SET_ITEMS8(v, a, b, c, d, e, f, g) |
| #define | _VA_ARRAY_SET_ITEMS9(v, a, b, c, d, e, f, g, h) |
| #define | _VA_ARRAY_SET_ITEMS10(v, a, b, c, d, e, f, g, h, i) |
| #define | _VA_ARRAY_SET_ITEMS11(v, a, b, c, d, e, f, g, h, i, j) |
| #define | _VA_ARRAY_SET_ITEMS12(v, a, b, c, d, e, f, g, h, i, j, k) |
| #define | _VA_ARRAY_SET_ITEMS13(v, a, b, c, d, e, f, g, h, i, j, k, l) |
| #define | _VA_ARRAY_SET_ITEMS14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) |
| #define | _VA_ARRAY_SET_ITEMS15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) |
| #define | _VA_ARRAY_SET_ITEMS16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) |
| #define | _VA_ARRAY_SET_ITEMS17(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) |
| #define | ARRAY_SET_ITEMS(...) |
Pointer Macros | |
| #define | POINTER_OFFSET(v, ofs) ((void *)((char *)(v) + (ofs))) |
| #define | POINTER_FROM_INT(i) ((void *)(intptr_t)(i)) |
| #define | POINTER_AS_INT(i) ((void)0, ((int)(intptr_t)(i))) |
| #define | POINTER_FROM_UINT(i) ((void *)(uintptr_t)(i)) |
| #define | POINTER_AS_UINT(i) ((void)0, ((unsigned int)(uintptr_t)(i))) |
String Macros | |
| #define | STRINGIFY_ARG(x) "" #x |
| #define | STRINGIFY_APPEND(a, b) "" a #b |
| #define | STRINGIFY(x) STRINGIFY_APPEND("", x) |
| #define | STREQ(a, b) (strcmp(a, b) == 0) |
| #define | STRCASEEQ(a, b) (strcasecmp(a, b) == 0) |
| #define | STREQLEN(a, b, n) (strncmp(a, b, n) == 0) |
| #define | STRCASEEQLEN(a, b, n) (strncasecmp(a, b, n) == 0) |
| #define | STRPREFIX(a, b) (strncmp((a), (b), strlen(b)) == 0) |
Unused Function/Argument Macros | |
| #define | UNUSED(x) UNUSED_##x |
| #define | UNUSED_FUNCTION(x) UNUSED_##x |
| #define | _VA_UNUSED_VARS_1(a0) ((void)(a0)) |
| #define | _VA_UNUSED_VARS_2(a0, b0) ((void)(a0), _VA_UNUSED_VARS_1(b0)) |
| #define | _VA_UNUSED_VARS_3(a0, b0, c0) ((void)(a0), _VA_UNUSED_VARS_2(b0, c0)) |
| #define | _VA_UNUSED_VARS_4(a0, b0, c0, d0) ((void)(a0), _VA_UNUSED_VARS_3(b0, c0, d0)) |
| #define | _VA_UNUSED_VARS_5(a0, b0, c0, d0, e0) ((void)(a0), _VA_UNUSED_VARS_4(b0, c0, d0, e0)) |
| #define | _VA_UNUSED_VARS_6(a0, b0, c0, d0, e0, f0) ((void)(a0), _VA_UNUSED_VARS_5(b0, c0, d0, e0, f0)) |
| #define | _VA_UNUSED_VARS_7(a0, b0, c0, d0, e0, f0, g0) ((void)(a0), _VA_UNUSED_VARS_6(b0, c0, d0, e0, f0, g0)) |
| #define | _VA_UNUSED_VARS_8(a0, b0, c0, d0, e0, f0, g0, h0) ((void)(a0), _VA_UNUSED_VARS_7(b0, c0, d0, e0, f0, g0, h0)) |
| #define | _VA_UNUSED_VARS_9(a0, b0, c0, d0, e0, f0, g0, h0, i0) ((void)(a0), _VA_UNUSED_VARS_8(b0, c0, d0, e0, f0, g0, h0, i0)) |
| #define | _VA_UNUSED_VARS_10(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0) ((void)(a0), _VA_UNUSED_VARS_9(b0, c0, d0, e0, f0, g0, h0, i0, j0)) |
| #define | _VA_UNUSED_VARS_11(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0) ((void)(a0), _VA_UNUSED_VARS_10(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0)) |
| #define | _VA_UNUSED_VARS_12(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0) ((void)(a0), _VA_UNUSED_VARS_11(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0)) |
| #define | _VA_UNUSED_VARS_13(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0) ((void)(a0), _VA_UNUSED_VARS_12(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0)) |
| #define | _VA_UNUSED_VARS_14(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0) ((void)(a0), _VA_UNUSED_VARS_13(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0)) |
| #define | _VA_UNUSED_VARS_15(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0) ((void)(a0), _VA_UNUSED_VARS_14(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0)) |
| #define | _VA_UNUSED_VARS_16(a0, b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0) ((void)(a0), _VA_UNUSED_VARS_15(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0)) |
| #define | UNUSED_VARS(...) VA_NARGS_CALL_OVERLOAD(_VA_UNUSED_VARS_, __VA_ARGS__) |
| #define | UNUSED_VARS_NDEBUG(...) |
Branch Prediction Macros | |
| #define | LIKELY(x) (x) |
| #define | UNLIKELY(x) (x) |
Flag Macros | |
| #define | SET_FLAG_FROM_TEST(value, test, flag) |
C++ Macros | |
| #define | ENUM_OPERATORS(_type, _max) |
Misc Macros | |
| #define | AT __FILE__ ":" STRINGIFY(__LINE__) |
| #define | EXPR_NOP(expr) (void)(0 ? ((void)(expr), 1) : 0) |
Struct After Macros | |
Typically used to copy/clear polymorphic structs which have a generic member at the start which needs to be left as-is. | |
| #define | OFFSETOF_STRUCT_AFTER(_struct, _member) |
| #define | MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member) |
| #define | MEMSET_STRUCT_AFTER(struct_var, value, member) |
| #define | MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member) |
| bool | BLI_memory_is_zero (const void *arr, const size_t arr_size) |
Definition at line 544 of file BLI_utildefines.h.
Definition at line 547 of file BLI_utildefines.h.
Definition at line 550 of file BLI_utildefines.h.
Definition at line 553 of file BLI_utildefines.h.
Definition at line 556 of file BLI_utildefines.h.
Definition at line 559 of file BLI_utildefines.h.
Definition at line 562 of file BLI_utildefines.h.
Definition at line 565 of file BLI_utildefines.h.
Definition at line 522 of file BLI_utildefines.h.
| #define _VA_ARRAY_SET_ITEMS3 | ( | v, | |
| a, | |||
| b | |||
| ) |
Definition at line 523 of file BLI_utildefines.h.
| #define _VA_ARRAY_SET_ITEMS4 | ( | v, | |
| a, | |||
| b, | |||
| c | |||
| ) |
Definition at line 526 of file BLI_utildefines.h.
| #define _VA_ARRAY_SET_ITEMS5 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d | |||
| ) |
Definition at line 529 of file BLI_utildefines.h.
Definition at line 532 of file BLI_utildefines.h.
Definition at line 535 of file BLI_utildefines.h.
Definition at line 538 of file BLI_utildefines.h.
Definition at line 541 of file BLI_utildefines.h.
| #define _VA_ELEM10 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i | |||
| ) | (_VA_ELEM9(v, a, b, c, d, e, f, g, h) || _VA_ELEM2(v, i)) |
Definition at line 286 of file BLI_utildefines.h.
| #define _VA_ELEM11 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j | |||
| ) | (_VA_ELEM10(v, a, b, c, d, e, f, g, h, i) || _VA_ELEM2(v, j)) |
Definition at line 288 of file BLI_utildefines.h.
| #define _VA_ELEM12 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k | |||
| ) | (_VA_ELEM11(v, a, b, c, d, e, f, g, h, i, j) || _VA_ELEM2(v, k)) |
Definition at line 290 of file BLI_utildefines.h.
| #define _VA_ELEM13 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k, | |||
| l | |||
| ) | (_VA_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) || _VA_ELEM2(v, l)) |
Definition at line 292 of file BLI_utildefines.h.
| #define _VA_ELEM14 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k, | |||
| l, | |||
| m | |||
| ) | (_VA_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) || _VA_ELEM2(v, m)) |
Definition at line 294 of file BLI_utildefines.h.
| #define _VA_ELEM15 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k, | |||
| l, | |||
| m, | |||
| n | |||
| ) | (_VA_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) || _VA_ELEM2(v, n)) |
Definition at line 296 of file BLI_utildefines.h.
| #define _VA_ELEM16 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k, | |||
| l, | |||
| m, | |||
| n, | |||
| o | |||
| ) | (_VA_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) || _VA_ELEM2(v, o)) |
Definition at line 298 of file BLI_utildefines.h.
| #define _VA_ELEM17 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h, | |||
| i, | |||
| j, | |||
| k, | |||
| l, | |||
| m, | |||
| n, | |||
| o, | |||
| p | |||
| ) | (_VA_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) || _VA_ELEM2(v, p)) |
Definition at line 300 of file BLI_utildefines.h.
Definition at line 271 of file BLI_utildefines.h.
Definition at line 272 of file BLI_utildefines.h.
Definition at line 274 of file BLI_utildefines.h.
Definition at line 276 of file BLI_utildefines.h.
Definition at line 278 of file BLI_utildefines.h.
Definition at line 280 of file BLI_utildefines.h.
Definition at line 282 of file BLI_utildefines.h.
| #define _VA_ELEM9 | ( | v, | |
| a, | |||
| b, | |||
| c, | |||
| d, | |||
| e, | |||
| f, | |||
| g, | |||
| h | |||
| ) | (_VA_ELEM8(v, a, b, c, d, e, f, g) || _VA_ELEM2(v, h)) |
Definition at line 284 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_1 | ( | a0 | ) | ((void)(a0)) |
UNUSED_VARS#(a, ...): quiet unused warnings
Definition at line 705 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_10 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_9(b0, c0, d0, e0, f0, g0, h0, i0, j0)) |
Definition at line 718 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_11 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_10(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0)) |
Definition at line 720 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_12 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0, | |||
| l0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_11(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0)) |
Definition at line 722 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_13 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0, | |||
| l0, | |||
| m0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_12(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0)) |
Definition at line 724 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_14 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0, | |||
| l0, | |||
| m0, | |||
| n0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_13(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0)) |
Definition at line 726 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_15 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0, | |||
| l0, | |||
| m0, | |||
| n0, | |||
| o0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_14(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0)) |
Definition at line 728 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_16 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0, | |||
| j0, | |||
| k0, | |||
| l0, | |||
| m0, | |||
| n0, | |||
| o0, | |||
| p0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_15(b0, c0, d0, e0, f0, g0, h0, i0, j0, k0, l0, m0, n0, o0, p0)) |
Definition at line 730 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_2 | ( | a0, | |
| b0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_1(b0)) |
Definition at line 706 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_3 | ( | a0, | |
| b0, | |||
| c0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_2(b0, c0)) |
Definition at line 707 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_4 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_3(b0, c0, d0)) |
Definition at line 708 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_5 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_4(b0, c0, d0, e0)) |
Definition at line 709 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_6 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_5(b0, c0, d0, e0, f0)) |
Definition at line 710 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_7 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_6(b0, c0, d0, e0, f0, g0)) |
Definition at line 712 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_8 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_7(b0, c0, d0, e0, f0, g0, h0)) |
Definition at line 714 of file BLI_utildefines.h.
| #define _VA_UNUSED_VARS_9 | ( | a0, | |
| b0, | |||
| c0, | |||
| d0, | |||
| e0, | |||
| f0, | |||
| g0, | |||
| h0, | |||
| i0 | |||
| ) | ((void)(a0), _VA_UNUSED_VARS_8(b0, c0, d0, e0, f0, g0, h0, i0)) |
Definition at line 716 of file BLI_utildefines.h.
| #define ARRAY_DELETE | ( | arr, | |
| index, | |||
| delete_len, | |||
| arr_len | |||
| ) |
Definition at line 479 of file BLI_utildefines.h.
| #define ARRAY_DELETE_REORDER_LAST | ( | arr, | |
| index, | |||
| delete_len, | |||
| arr_len | |||
| ) |
Re-ordering array removal.
When removing single items this compiles down to: if (index + 1 != arr_len) { arr[index] = arr[arr_len - 1]; } (typical reordering removal), with removing multiple items, overlap is detected to avoid memcpy errors.
Definition at line 495 of file BLI_utildefines.h.
| #define ARRAY_HAS_ITEM | ( | arr_item, | |
| arr_start, | |||
| arr_len | |||
| ) |
Definition at line 472 of file BLI_utildefines.h.
| #define ARRAY_LAST_ITEM | ( | arr_start, | |
| arr_dtype, | |||
| arr_len | |||
| ) | (arr_dtype *)((char *)(arr_start) + (sizeof(*((arr_dtype *)NULL)) * (size_t)(arr_len - 1))) |
Definition at line 469 of file BLI_utildefines.h.
| #define ARRAY_SET_ITEMS | ( | ... | ) |
Definition at line 570 of file BLI_utildefines.h.
| #define ARRAY_SIZE | ( | arr | ) | (sizeof(arr) / sizeof(*(arr))) |
Definition at line 517 of file BLI_utildefines.h.
| #define AT __FILE__ ":" STRINGIFY(__LINE__) |
Useful for debugging.
Definition at line 821 of file BLI_utildefines.h.
| #define CLAMP | ( | a, | |
| b, | |||
| c | |||
| ) |
| #define CLAMP2 | ( | vec, | |
| b, | |||
| c | |||
| ) |
Definition at line 375 of file BLI_utildefines.h.
| #define CLAMP2_MAX | ( | vec, | |
| b | |||
| ) |
Definition at line 389 of file BLI_utildefines.h.
| #define CLAMP2_MIN | ( | vec, | |
| b | |||
| ) |
Definition at line 382 of file BLI_utildefines.h.
| #define CLAMP3 | ( | vec, | |
| b, | |||
| c | |||
| ) |
Definition at line 396 of file BLI_utildefines.h.
| #define CLAMP3_MAX | ( | vec, | |
| b | |||
| ) |
Definition at line 412 of file BLI_utildefines.h.
| #define CLAMP3_MIN | ( | vec, | |
| b | |||
| ) |
Definition at line 404 of file BLI_utildefines.h.
| #define CLAMP4 | ( | vec, | |
| b, | |||
| c | |||
| ) |
| #define CLAMP4_MAX | ( | vec, | |
| b | |||
| ) |
Definition at line 438 of file BLI_utildefines.h.
| #define CLAMP4_MIN | ( | vec, | |
| b | |||
| ) |
Definition at line 429 of file BLI_utildefines.h.
| #define CLAMP_MAX | ( | a, | |
| c | |||
| ) |
| #define CLAMP_MIN | ( | a, | |
| b | |||
| ) |
Definition at line 367 of file BLI_utildefines.h.
| #define CLAMPIS | ( | a, | |
| b, | |||
| c | |||
| ) | ((a) < (b) ? (b) : (a) > (c) ? (c) : (a)) |
Definition at line 346 of file BLI_utildefines.h.
Expands to an integer constant expression evaluating to a close upper bound on the number the number of decimal digits in a value expressible in the integer type given by the argument (if it is a type name) or the integer type of the argument (if it is an expression). The meaning of the resulting expression is unspecified for other arguments. i.e: DECIMAL_DIGITS_BOUND(uchar) is equal to 3.
Definition at line 338 of file BLI_utildefines.h.
| #define DO_MAX | ( | vec, | |
| max | |||
| ) |
| #define DO_MIN | ( | vec, | |
| min | |||
| ) |
Definition at line 164 of file BLI_utildefines.h.
| #define ELEM | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_VA_ELEM, __VA_ARGS__) |
Definition at line 305 of file BLI_utildefines.h.
| #define ENUM_OPERATORS | ( | _type, | |
| _max | |||
| ) |
Definition at line 811 of file BLI_utildefines.h.
| #define EXPR_NOP | ( | expr | ) | (void)(0 ? ((void)(expr), 1) : 0) |
No-op for expressions we don't want to instantiate, but must remain valid.
Definition at line 824 of file BLI_utildefines.h.
| #define IN_RANGE | ( | a, | |
| b, | |||
| c | |||
| ) | (((b) < (c)) ? (((b) < (a) && (a) < (c))) : (((c) < (a) && (a) < (b)))) |
Definition at line 326 of file BLI_utildefines.h.
| #define IN_RANGE_INCL | ( | a, | |
| b, | |||
| c | |||
| ) | (((b) < (c)) ? (((b) <= (a) && (a) <= (c))) : (((c) <= (a) && (a) <= (b)))) |
Definition at line 327 of file BLI_utildefines.h.
| #define IS_EQ | ( | a, | |
| b | |||
| ) |
Definition at line 315 of file BLI_utildefines.h.
| #define IS_EQF | ( | a, | |
| b | |||
| ) |
Definition at line 320 of file BLI_utildefines.h.
| #define IS_EQT | ( | a, | |
| b, | |||
| c | |||
| ) | (((a) > (b)) ? ((((a) - (b)) <= (c))) : (((((b) - (a)) <= (c))))) |
Definition at line 325 of file BLI_utildefines.h.
Definition at line 754 of file BLI_utildefines.h.
| #define MAX2 | ( | a, | |
| b | |||
| ) | ((a) > (b) ? (a) : (b)) |
Definition at line 110 of file BLI_utildefines.h.
Definition at line 115 of file BLI_utildefines.h.
| #define MAX3_PAIR | ( | cmp_a, | |
| cmp_b, | |||
| cmp_c, | |||
| ret_a, | |||
| ret_b, | |||
| ret_c | |||
| ) | ((cmp_a > cmp_b) ? ((cmp_a > cmp_c) ? ret_a : ret_c) : ((cmp_b > cmp_c) ? ret_b : ret_c)) |
Definition at line 120 of file BLI_utildefines.h.
Definition at line 116 of file BLI_utildefines.h.
| #define MEMCMP_STRUCT_AFTER_IS_ZERO | ( | struct_var, | |
| member | |||
| ) |
Definition at line 641 of file BLI_utildefines.h.
| #define MEMCPY_STRUCT_AFTER | ( | struct_dst, | |
| struct_src, | |||
| member | |||
| ) |
memcpy helper, skipping the first part of a struct, ensures 'struct_dst' isn't const and the offset can be computed at compile time. This isn't inclusive, the value of member isn't copied.
Definition at line 616 of file BLI_utildefines.h.
| #define MEMSET_STRUCT_AFTER | ( | struct_var, | |
| value, | |||
| member | |||
| ) |
Definition at line 626 of file BLI_utildefines.h.
| #define MIN2 | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (a) : (b)) |
Definition at line 109 of file BLI_utildefines.h.
Definition at line 112 of file BLI_utildefines.h.
| #define MIN3_PAIR | ( | cmp_a, | |
| cmp_b, | |||
| cmp_c, | |||
| ret_a, | |||
| ret_b, | |||
| ret_c | |||
| ) | ((cmp_a < cmp_b) ? ((cmp_a < cmp_c) ? ret_a : ret_c) : ((cmp_b < cmp_c) ? ret_b : ret_c)) |
Definition at line 123 of file BLI_utildefines.h.
Definition at line 113 of file BLI_utildefines.h.
| #define OFFSETOF_STRUCT_AFTER | ( | _struct, | |
| _member | |||
| ) |
Performs offsetof(typeof(data), member) + sizeof((data)->member) for non-gcc compilers.
Definition at line 607 of file BLI_utildefines.h.
| #define POINTER_AS_INT | ( | i | ) | ((void)0, ((int)(intptr_t)(i))) |
Definition at line 591 of file BLI_utildefines.h.
| #define POINTER_AS_UINT | ( | i | ) | ((void)0, ((unsigned int)(uintptr_t)(i))) |
Definition at line 594 of file BLI_utildefines.h.
| #define POINTER_FROM_INT | ( | i | ) | ((void *)(intptr_t)(i)) |
Definition at line 590 of file BLI_utildefines.h.
| #define POINTER_FROM_UINT | ( | i | ) | ((void *)(uintptr_t)(i)) |
Definition at line 593 of file BLI_utildefines.h.
Definition at line 585 of file BLI_utildefines.h.
| #define SET_FLAG_FROM_TEST | ( | value, | |
| test, | |||
| flag | |||
| ) |
Definition at line 765 of file BLI_utildefines.h.
| #define SHIFT3 | ( | type, | |
| a, | |||
| b, | |||
| c | |||
| ) |
Definition at line 232 of file BLI_utildefines.h.
| #define SHIFT4 | ( | type, | |
| a, | |||
| b, | |||
| c, | |||
| d | |||
| ) |
| #define STRCASEEQ | ( | a, | |
| b | |||
| ) | (strcasecmp(a, b) == 0) |
Definition at line 667 of file BLI_utildefines.h.
| #define STRCASEEQLEN | ( | a, | |
| b, | |||
| n | |||
| ) | (strncasecmp(a, b, n) == 0) |
Definition at line 669 of file BLI_utildefines.h.
| #define STREQ | ( | a, | |
| b | |||
| ) | (strcmp(a, b) == 0) |
Definition at line 666 of file BLI_utildefines.h.
| #define STREQLEN | ( | a, | |
| b, | |||
| n | |||
| ) | (strncmp(a, b, n) == 0) |
Definition at line 668 of file BLI_utildefines.h.
| #define STRINGIFY | ( | x | ) | STRINGIFY_APPEND("", x) |
Definition at line 658 of file BLI_utildefines.h.
| #define STRINGIFY_APPEND | ( | a, | |
| b | |||
| ) | "" a #b |
Definition at line 657 of file BLI_utildefines.h.
Definition at line 656 of file BLI_utildefines.h.
| #define STRPREFIX | ( | a, | |
| b | |||
| ) | (strncmp((a), (b), strlen(b)) == 0) |
Definition at line 671 of file BLI_utildefines.h.
| #define SWAP | ( | type, | |
| a, | |||
| b | |||
| ) |
| #define SWAP_TVAL | ( | tval, | |
| a, | |||
| b | |||
| ) |
Definition at line 221 of file BLI_utildefines.h.
Definition at line 755 of file BLI_utildefines.h.
| #define UNPACK2 | ( | a | ) | ((a)[0]), ((a)[1]) |
Definition at line 454 of file BLI_utildefines.h.
| #define UNPACK2_EX | ( | pre, | |
| a, | |||
| post | |||
| ) | (pre((a)[0]) post), (pre((a)[1]) post) |
Definition at line 458 of file BLI_utildefines.h.
| #define UNPACK3 | ( | a | ) | UNPACK2(a), ((a)[2]) |
Definition at line 455 of file BLI_utildefines.h.
| #define UNPACK3_EX | ( | pre, | |
| a, | |||
| post | |||
| ) | UNPACK2_EX(pre, a, post), (pre((a)[2]) post) |
Definition at line 459 of file BLI_utildefines.h.
| #define UNPACK4 | ( | a | ) | UNPACK3(a), ((a)[3]) |
Definition at line 456 of file BLI_utildefines.h.
| #define UNPACK4_EX | ( | pre, | |
| a, | |||
| post | |||
| ) | UNPACK3_EX(pre, a, post), (pre((a)[3]) post) |
Definition at line 460 of file BLI_utildefines.h.
Definition at line 683 of file BLI_utildefines.h.
Definition at line 689 of file BLI_utildefines.h.
| #define UNUSED_VARS | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_VA_UNUSED_VARS_, __VA_ARGS__) |
Definition at line 734 of file BLI_utildefines.h.
| #define UNUSED_VARS_NDEBUG | ( | ... | ) |
Definition at line 738 of file BLI_utildefines.h.
| bool BLI_memory_is_zero | ( | const void * | arr, |
| const size_t | arr_size | ||
| ) |
Check if memory is zero'd, as with memset(arr, 0, arr_size)
Definition at line 36 of file memory_utils.c.