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/editors
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/editors')
-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
16 files changed, 4 insertions, 22 deletions
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>