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
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.
-rw-r--r--source/blender/blenkernel/intern/bpath.c1
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c1
-rw-r--r--source/blender/blenkernel/intern/editmesh_tangent.c8
-rw-r--r--source/blender/blenkernel/intern/lib_id.c1
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c2
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c1
-rw-r--r--source/blender/blenkernel/intern/unit.c4
-rw-r--r--source/blender/blenkernel/intern/volume.cc2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c2
-rw-r--r--source/blender/blenlib/intern/buffer.c4
-rw-r--r--source/blender/blenlib/intern/math_color.c2
-rw-r--r--source/blender/blenlib/intern/math_matrix.c1
-rw-r--r--source/blender/blenlib/intern/math_rotation.c1
-rw-r--r--source/blender/blenlib/intern/path_util.c1
-rw-r--r--source/blender/bmesh/bmesh.h1
-rw-r--r--source/blender/bmesh/bmesh_class.h14
-rw-r--r--source/blender/editors/armature/armature_edit.c4
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
-rw-r--r--source/blender/editors/interface/interface_layout.c3
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c1
-rw-r--r--source/blender/editors/interface/interface_region_menu_pie.c1
-rw-r--r--source/blender/editors/interface/interface_region_menu_popup.c1
-rw-r--r--source/blender/editors/interface/interface_region_popup.c1
-rw-r--r--source/blender/editors/interface/interface_region_search.c1
-rw-r--r--source/blender/editors/interface/interface_region_tooltip.c1
-rw-r--r--source/blender/editors/interface/interface_utils.c1
-rw-r--r--source/blender/editors/interface/interface_widgets.c3
-rw-r--r--source/blender/editors/object/object_vgroup.c1
-rw-r--r--source/blender/editors/physics/particle_edit.c1
-rw-r--r--source/blender/editors/physics/particle_edit_undo.c1
-rw-r--r--source/blender/editors/sculpt_paint/paint_hide.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c1
-rw-r--r--source/blender/makesdna/intern/makesdna.c1
-rw-r--r--source/blender/makesrna/intern/rna_brush.c1
-rw-r--r--source/blender/makesrna/intern/rna_ui.c4
-rw-r--r--source/blender/makesrna/intern/rna_wm.c12
-rw-r--r--source/blender/makesrna/intern/rna_wm_gizmo.c8
-rw-r--r--source/blender/modifiers/intern/MOD_remesh.c1
-rw-r--r--source/blender/nodes/texture/node_texture_util.c1
-rw-r--r--source/blender/python/mathutils/mathutils.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c1
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c1
42 files changed, 30 insertions, 74 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index 4ab8ea5a647..4ea9a26f0f8 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -27,7 +27,6 @@
#include <sys/stat.h>
-#include <assert.h>
#include <string.h>
/* path/file handling stuff */
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 7440cc1f735..fd5cb33f02d 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -21,7 +21,6 @@
* \ingroup bke
*/
-#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
diff --git a/source/blender/blenkernel/intern/editmesh_tangent.c b/source/blender/blenkernel/intern/editmesh_tangent.c
index 897fc7e692b..b3f6b543daf 100644
--- a/source/blender/blenkernel/intern/editmesh_tangent.c
+++ b/source/blender/blenkernel/intern/editmesh_tangent.c
@@ -104,7 +104,7 @@ static void emdm_ts_GetPosition(const SMikkTSpaceContext *pContext,
const int face_num,
const int vert_index)
{
- // assert(vert_index >= 0 && vert_index < 4);
+ // BLI_assert(vert_index >= 0 && vert_index < 4);
SGLSLEditMeshToTangent *pMesh = pContext->m_pUserData;
const BMLoop **lt;
const BMLoop *l;
@@ -138,7 +138,7 @@ static void emdm_ts_GetTextureCoordinate(const SMikkTSpaceContext *pContext,
const int face_num,
const int vert_index)
{
- // assert(vert_index >= 0 && vert_index < 4);
+ // BLI_assert(vert_index >= 0 && vert_index < 4);
SGLSLEditMeshToTangent *pMesh = pContext->m_pUserData;
const BMLoop **lt;
const BMLoop *l;
@@ -176,7 +176,7 @@ static void emdm_ts_GetNormal(const SMikkTSpaceContext *pContext,
const int face_num,
const int vert_index)
{
- // assert(vert_index >= 0 && vert_index < 4);
+ // BLI_assert(vert_index >= 0 && vert_index < 4);
SGLSLEditMeshToTangent *pMesh = pContext->m_pUserData;
const BMLoop **lt;
const BMLoop *l;
@@ -221,7 +221,7 @@ static void emdm_ts_SetTSpace(const SMikkTSpaceContext *pContext,
const int face_num,
const int vert_index)
{
- // assert(vert_index >= 0 && vert_index < 4);
+ // BLI_assert(vert_index >= 0 && vert_index < 4);
SGLSLEditMeshToTangent *pMesh = pContext->m_pUserData;
const BMLoop **lt;
const BMLoop *l;
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index f8f171bd9d7..675e3956102 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -24,7 +24,6 @@
* allocate and free of all library data
*/
-#include <assert.h>
#include <ctype.h>
#include <stddef.h>
#include <stdio.h>
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index a04fa1506d0..d31b0d54784 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -36,8 +36,6 @@
#include "bmesh.h"
#include "pbvh_intern.h"
-#include <assert.h>
-
/* Avoid skinny faces */
#define USE_EDGEQUEUE_EVEN_SUBDIV
#ifdef USE_EDGEQUEUE_EVEN_SUBDIV
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 0ff5bdda9e9..9240851c07a 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -21,7 +21,6 @@
* \ingroup bke
*/
-#include <assert.h>
#include <float.h>
#include <math.h>
#include <memory.h>
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index bfa031f0d64..a5418b8b8c5 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -18,7 +18,6 @@
* \ingroup bke
*/
-#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -395,7 +394,8 @@ static const struct bUnitCollection *bUnitSystems[][B_UNIT_TYPE_TOT] = {
static const bUnitCollection *unit_get_system(int system, int type)
{
- assert((system > -1) && (system < UNIT_SYSTEM_TOT) && (type > -1) && (type < B_UNIT_TYPE_TOT));
+ BLI_assert((system > -1) && (system < UNIT_SYSTEM_TOT) && (type > -1) &&
+ (type < B_UNIT_TYPE_TOT));
return bUnitSystems[system][type]; /* Select system to use: metric/imperial/other? */
}
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 6394cfe39a6..79ed3d3d08d 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -154,7 +154,7 @@ static struct VolumeFileCache {
~VolumeFileCache()
{
- assert(cache.empty());
+ BLI_assert(cache.empty());
}
Entry *add_metadata_user(const Entry &template_entry)
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index 73f8c2717b0..f126c5a977b 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -38,8 +38,6 @@
* #BLI_bvhtree_range_query
*/
-#include <assert.h>
-
#include "MEM_guardedalloc.h"
#include "BLI_alloca.h"
diff --git a/source/blender/blenlib/intern/buffer.c b/source/blender/blenlib/intern/buffer.c
index fb4350501cd..bac4786a2e9 100644
--- a/source/blender/blenlib/intern/buffer.c
+++ b/source/blender/blenlib/intern/buffer.c
@@ -30,8 +30,8 @@
* BLI_buffer_declare_static(int, my_int_array, BLI_BUFFER_NOP, 32);
*
* BLI_buffer_append(my_int_array, int, 42);
- * assert(my_int_array.count == 1);
- * assert(BLI_buffer_at(my_int_array, int, 0) == 42);
+ * BLI_assert(my_int_array.count == 1);
+ * BLI_assert(BLI_buffer_at(my_int_array, int, 0) == 42);
*
* BLI_buffer_free(&my_int_array);
* \endcode
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 4b62d6b9b5b..132aeb3ace2 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -24,8 +24,6 @@
* \ingroup bli
*/
-#include <assert.h>
-
#include "BLI_math.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c
index 19bb6a2efba..656f37c9f18 100644
--- a/source/blender/blenlib/intern/math_matrix.c
+++ b/source/blender/blenlib/intern/math_matrix.c
@@ -24,7 +24,6 @@
*/
#include "BLI_math.h"
-#include <assert.h>
#include "BLI_strict_flags.h"
diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c
index 7c4ac934695..c7cd1901164 100644
--- a/source/blender/blenlib/intern/math_rotation.c
+++ b/source/blender/blenlib/intern/math_rotation.c
@@ -24,7 +24,6 @@
*/
#include "BLI_math.h"
-#include <assert.h>
#include "BLI_strict_flags.h"
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 6328c887063..d4f0467b31b 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -22,7 +22,6 @@
* \ingroup bli
*/
-#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
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*/
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index dc7bad7acf6..b20d2738bda 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -22,8 +22,6 @@
* \ingroup edarmature
*/
-#include <assert.h>
-
#include "DNA_armature_types.h"
#include "DNA_constraint_types.h"
#include "DNA_object_types.h"
@@ -415,7 +413,7 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op)
copy_v3_v3(vec, mat[2]);
}
else { /* Axis */
- assert(type <= 5);
+ BLI_assert(type <= 5);
if (type < 3) {
vec[type] = 1.0f;
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index f2d9f90f354..def6e0d480d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -21,7 +21,6 @@
* \ingroup edinterface
*/
-#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <limits.h>
@@ -6213,7 +6212,7 @@ static void ui_ndofedit_but_HSVCUBE(uiButHSVCube *hsv_but,
CLAMP(hsv[2], hsv_but->but.softmin, hsv_but->but.softmax);
break;
default:
- assert(!"invalid hsv type");
+ BLI_assert(!"invalid hsv type");
break;
}
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8854ab4235b..4315981afb7 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -18,7 +18,6 @@
* \ingroup edinterface
*/
-#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
@@ -1192,7 +1191,7 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
but = uiDefButO_ptr(block, UI_BTYPE_BUT, ot, context, name, 0, 0, w, UI_UNIT_Y, NULL);
}
- assert(but->optype != NULL);
+ BLI_assert(but->optype != NULL);
if (flag & UI_ITEM_R_NO_BG) {
layout->emboss = prev_emboss;
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index de80d6270bf..61349672f1c 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -23,7 +23,6 @@
* Color Picker Region & Color Utils
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c
index 631f395390f..d047d5421d7 100644
--- a/source/blender/editors/interface/interface_region_menu_pie.c
+++ b/source/blender/editors/interface/interface_region_menu_pie.c
@@ -23,7 +23,6 @@
* Pie Menu Region
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index fe0fde50ae6..1789af2d2ce 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -23,7 +23,6 @@
* PopUp Menu Region
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 5445b098e5b..f941474ba25 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -23,7 +23,6 @@
* PopUp Region (Generic)
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 0711d953ebd..7a665909c76 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -23,7 +23,6 @@
* Search Box Region & Interaction
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c
index 0edc755902a..2dc4d33f07e 100644
--- a/source/blender/editors/interface/interface_region_tooltip.c
+++ b/source/blender/editors/interface/interface_region_tooltip.c
@@ -32,7 +32,6 @@
* For now it's not a priority, so leave as-is.
*/
-#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 30538cc7050..6bc644ce5b5 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -21,7 +21,6 @@
* \ingroup edinterface
*/
-#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index f2081199672..becfab3cb07 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -21,7 +21,6 @@
* \ingroup edinterface
*/
-#include <assert.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
@@ -3046,7 +3045,7 @@ void ui_draw_gradient(const rcti *rect,
copy_v3_v3(col1[3], col1[2]);
break;
default:
- assert(!"invalid 'type' argument");
+ BLI_assert(!"invalid 'type' argument");
hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]);
copy_v3_v3(col1[0], col1[2]);
copy_v3_v3(col1[1], col1[2]);
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 423426d7d0a..26863fd0848 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -21,7 +21,6 @@
* \ingroup edobj
*/
-#include <assert.h>
#include <math.h>
#include <stddef.h>
#include <string.h>
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index ef5af694aa7..1d1859d8170 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -21,7 +21,6 @@
* \ingroup edphys
*/
-#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/physics/particle_edit_undo.c b/source/blender/editors/physics/particle_edit_undo.c
index 8db6c4c853e..a4fcfa93a60 100644
--- a/source/blender/editors/physics/particle_edit_undo.c
+++ b/source/blender/editors/physics/particle_edit_undo.c
@@ -21,7 +21,6 @@
* \ingroup edphys
*/
-#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c
index 339921fe601..e5d682c27d9 100644
--- a/source/blender/editors/sculpt_paint/paint_hide.c
+++ b/source/blender/editors/sculpt_paint/paint_hide.c
@@ -59,8 +59,6 @@
/* For undo push. */
#include "sculpt_intern.h"
-#include <assert.h>
-
/* Return true if the element should be hidden/shown. */
static bool is_effected(PartialVisArea area,
float planes[4][4],
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index a5ea8244a1f..fc71648acfb 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -21,7 +21,6 @@
* \ingroup spview3d
*/
-#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 3782f265913..f0c7d2549ca 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -43,7 +43,6 @@
#define DNA_DEPRECATED_ALLOW
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 82db67e0612..35f5c4c37bc 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -18,7 +18,6 @@
* \ingroup RNA
*/
-#include <assert.h>
#include <stdlib.h>
#include "DNA_brush_types.h"
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 8ce6ab957b8..d637e011777 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -65,8 +65,6 @@ const EnumPropertyItem rna_enum_uilist_layout_type_items[] = {
#ifdef RNA_RUNTIME
-# include <assert.h>
-
# include "MEM_guardedalloc.h"
# include "RNA_access.h"
@@ -993,7 +991,7 @@ static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_description on a non-builtin menu");
+ BLI_assert(!"setting the bl_description on a non-builtin menu");
}
}
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index c31e49fce97..f3438aaa835 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -512,8 +512,6 @@ const EnumPropertyItem rna_enum_wm_report_items[] = {
#ifdef RNA_RUNTIME
-# include <assert.h>
-
# include "BLI_string_utils.h"
# include "WM_api.h"
@@ -1747,7 +1745,7 @@ static void rna_Operator_bl_idname_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, OP_MAX_TYPENAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_idname on a non-builtin operator");
+ BLI_assert(!"setting the bl_idname on a non-builtin operator");
}
}
@@ -1759,7 +1757,7 @@ static void rna_Operator_bl_label_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, OP_MAX_TYPENAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_label on a non-builtin operator");
+ BLI_assert(!"setting the bl_label on a non-builtin operator");
}
}
@@ -1771,7 +1769,7 @@ static void rna_Operator_bl_translation_context_set(PointerRNA *ptr, const char
BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_translation_context on a non-builtin operator");
+ BLI_assert(!"setting the bl_translation_context on a non-builtin operator");
}
}
@@ -1783,7 +1781,7 @@ static void rna_Operator_bl_description_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, RNA_DYN_DESCR_MAX); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_description on a non-builtin operator");
+ BLI_assert(!"setting the bl_description on a non-builtin operator");
}
}
@@ -1795,7 +1793,7 @@ static void rna_Operator_bl_undo_group_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, OP_MAX_TYPENAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_undo_group on a non-builtin operator");
+ BLI_assert(!"setting the bl_undo_group on a non-builtin operator");
}
}
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c
index c19998b4803..971991869e2 100644
--- a/source/blender/makesrna/intern/rna_wm_gizmo.c
+++ b/source/blender/makesrna/intern/rna_wm_gizmo.c
@@ -45,8 +45,6 @@
#ifdef RNA_RUNTIME
-# include <assert.h>
-
# include "BLI_string_utils.h"
# include "WM_api.h"
@@ -240,7 +238,7 @@ static void rna_Gizmo_bl_idname_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_idname on a non-builtin operator");
+ BLI_assert(!"setting the bl_idname on a non-builtin operator");
}
}
@@ -632,7 +630,7 @@ static void rna_GizmoGroup_bl_idname_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_idname on a non-builtin operator");
+ BLI_assert(!"setting the bl_idname on a non-builtin operator");
}
}
@@ -644,7 +642,7 @@ static void rna_GizmoGroup_bl_label_set(PointerRNA *ptr, const char *value)
BLI_strncpy(str, value, MAX_NAME); /* utf8 already ensured */
}
else {
- assert(!"setting the bl_label on a non-builtin operator");
+ BLI_assert(!"setting the bl_label on a non-builtin operator");
}
}
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index a77ceae01cb..f8fc4ad658e 100644
--- a/source/blender/modifiers/intern/MOD_remesh.c
+++ b/source/blender/modifiers/intern/MOD_remesh.c
@@ -50,7 +50,6 @@
#include "MOD_modifiertypes.h"
#include "MOD_ui_common.h"
-#include <assert.h>
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c
index 981fc4e308a..96a0be6babc 100644
--- a/source/blender/nodes/texture/node_texture_util.c
+++ b/source/blender/nodes/texture/node_texture_util.c
@@ -38,7 +38,6 @@
*/
#include "node_texture_util.h"
-#include <assert.h>
bool tex_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree)
{
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index ca38d7008f6..afdf890943e 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -546,7 +546,7 @@ int EXPP_FloatsAreEqual(float af, float bf, int maxDiff)
const int test = SIGNMASK(ai ^ bi);
int diff, v1, v2;
- assert((0 == test) || (0xFFFFFFFF == test));
+ BLI_assert((0 == test) || (0xFFFFFFFF == test));
diff = (ai ^ (test & 0x7fffffff)) - bi;
v1 = maxDiff + diff;
v2 = maxDiff - diff;
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index d640040482f..860c1d40dd9 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -23,7 +23,6 @@
* Functions for dealing with append/link operators and helpers.
*/
-#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index e6142f85342..fda3cc49234 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -24,7 +24,6 @@
* as well as some generic operators and shared operator properties.
*/
-#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>