[Bf-blender-cvs] [63da2c4082a] master: Cleanup: replace BLI_assert(test || !"text") with BLI_assert_msg(test, text)

Campbell Barton noreply at git.blender.org
Wed Jul 21 16:47:54 CEST 2021


Commit: 63da2c4082a432379fc7fa4ed0d2c34b4cb2858d
Author: Campbell Barton
Date:   Thu Jul 22 00:46:45 2021 +1000
Branches: master
https://developer.blender.org/rB63da2c4082a432379fc7fa4ed0d2c34b4cb2858d

Cleanup: replace BLI_assert(test || !"text") with BLI_assert_msg(test, text)

===================================================================

M	source/blender/blenkernel/intern/fcurve.c
M	source/blender/editors/space_file/file_ops.c
M	source/blender/io/alembic/exporter/abc_writer_mesh.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 8f47a7e75d4..5decc7a1792 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -918,7 +918,7 @@ void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
   }
 
   /* The active keyframe should always be selected. */
-  BLI_assert(BEZT_ISSEL_ANY(active_bezt) || !"active keyframe must be selected");
+  BLI_assert_msg(BEZT_ISSEL_ANY(active_bezt), "active keyframe must be selected");
 
   fcu->active_keyframe_index = (int)offset;
 }
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 995383d9d0e..4d25524cd19 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -2340,7 +2340,9 @@ static int file_directory_new_exec(bContext *C, wmOperator *op)
 
   /* If we don't enter the directory directly, remember file to jump into editing. */
   if (do_diropen == false) {
-    BLI_assert(params->rename_id == NULL || !"File rename handling should immediately clear rename_id when done, because otherwise it will keep taking precedence over renamefile.");
+    BLI_assert_msg(params->rename_id == NULL,
+                   "File rename handling should immediately clear rename_id when done, "
+                   "because otherwise it will keep taking precedence over renamefile.");
     BLI_strncpy(params->renamefile, name, FILE_MAXFILE);
     rename_flag = FILE_PARAMS_RENAME_PENDING;
   }
diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc
index 7ffb61e1d1b..131b60b90fb 100644
--- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc
@@ -538,7 +538,7 @@ static void get_loop_normals(struct Mesh *mesh,
 
   BKE_mesh_calc_normals_split(mesh);
   const float(*lnors)[3] = static_cast<float(*)[3]>(CustomData_get_layer(&mesh->ldata, CD_NORMAL));
-  BLI_assert(lnors != nullptr || !"BKE_mesh_calc_normals_split() should have computed CD_NORMAL");
+  BLI_assert_msg(lnors != nullptr, "BKE_mesh_calc_normals_split() should have computed CD_NORMAL");
 
   normals.resize(mesh->totloop);



More information about the Bf-blender-cvs mailing list