diff options
author | Julian Eisel <julian@blender.org> | 2020-10-03 17:01:59 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-10-03 17:10:15 +0300 |
commit | 0bae2662f455c2866ce769fdc73b3068f8239bd0 (patch) | |
tree | 49fc275077b4cc7ebb77086cbbcb661fd9b7227f /source/blender/bmesh/bmesh_class.h | |
parent | e839179b014a2dac2b5cab6425bf7c382b9b0d1c (diff) |
Cleanup: Remove/replace C standard library assert() and header usages
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).
In many places we'd include the C library header without ever accessing it.
Diffstat (limited to 'source/blender/bmesh/bmesh_class.h')
-rw-r--r-- | source/blender/bmesh/bmesh_class.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index edb355993c1..0783bb445a2 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -395,17 +395,17 @@ typedef bool (*BMLoopFilterFunc)(const BMLoop *, void *user_data); #define BM_ELEM_CD_SET_INT(ele, offset, f) \ { \ CHECK_TYPE_NONCONST(ele); \ - assert(offset != -1); \ + BLI_assert(offset != -1); \ *((int *)((char *)(ele)->head.data + (offset))) = (f); \ } \ (void)0 #define BM_ELEM_CD_GET_INT(ele, offset) \ - (assert(offset != -1), *((int *)((char *)(ele)->head.data + (offset)))) + (BLI_assert(offset != -1), *((int *)((char *)(ele)->head.data + (offset)))) #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) # define BM_ELEM_CD_GET_VOID_P(ele, offset) \ - (assert(offset != -1), \ + (BLI_assert(offset != -1), \ _Generic(ele, \ GENERIC_TYPE_ANY(POINTER_OFFSET((ele)->head.data, offset), \ _BM_GENERIC_TYPE_ELEM_NONCONST), \ @@ -413,22 +413,22 @@ typedef bool (*BMLoopFilterFunc)(const BMLoop *, void *user_data); _BM_GENERIC_TYPE_ELEM_CONST))) #else # define BM_ELEM_CD_GET_VOID_P(ele, offset) \ - (assert(offset != -1), (void *)((char *)(ele)->head.data + (offset))) + (BLI_assert(offset != -1), (void *)((char *)(ele)->head.data + (offset))) #endif #define BM_ELEM_CD_SET_FLOAT(ele, offset, f) \ { \ CHECK_TYPE_NONCONST(ele); \ - assert(offset != -1); \ + BLI_assert(offset != -1); \ *((float *)((char *)(ele)->head.data + (offset))) = (f); \ } \ (void)0 #define BM_ELEM_CD_GET_FLOAT(ele, offset) \ - (assert(offset != -1), *((float *)((char *)(ele)->head.data + (offset)))) + (BLI_assert(offset != -1), *((float *)((char *)(ele)->head.data + (offset)))) #define BM_ELEM_CD_GET_FLOAT_AS_UCHAR(ele, offset) \ - (assert(offset != -1), (uchar)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f)) + (BLI_assert(offset != -1), (uchar)(BM_ELEM_CD_GET_FLOAT(ele, offset) * 255.0f)) /*forward declarations*/ |