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/makesrna
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/makesrna')
-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
4 files changed, 9 insertions, 16 deletions
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");
}
}