Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-10-03 17:01:59 +0300
committerJulian Eisel <julian@blender.org>2020-10-03 17:10:15 +0300
commit0bae2662f455c2866ce769fdc73b3068f8239bd0 (patch)
tree49fc275077b4cc7ebb77086cbbcb661fd9b7227f /source/blender/bmesh
parente839179b014a2dac2b5cab6425bf7c382b9b0d1c (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')
-rw-r--r--source/blender/bmesh/bmesh.h1
-rw-r--r--source/blender/bmesh/bmesh_class.h14
2 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/bmesh/bmesh.h b/source/blender/bmesh/bmesh.h
index 9199801d1a1..22f7d50c144 100644
--- a/source/blender/bmesh/bmesh.h
+++ b/source/blender/bmesh/bmesh.h
@@ -190,7 +190,6 @@
#include "DNA_customdata_types.h" /* BMesh struct in bmesh_class.h uses */
#include "DNA_listBase.h" /* selection history uses */
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
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*/