diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-21 17:46:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-21 17:47:29 +0300 |
commit | 581a6da8048eb4e15189633dedcbce9e04156622 (patch) | |
tree | 87381d80833bda17880e7ebff49693941439c1ec | |
parent | 63da2c4082a432379fc7fa4ed0d2c34b4cb2858d (diff) |
Fix incorrect use of BLI_assert with error strings
Some asserts were never raised because of invalid checks.
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task_pool.cc | 2 | ||||
-rw-r--r-- | source/blender/compositor/nodes/COM_RenderLayersNode.cc | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/geometry/FastGrid.cpp | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 2879a995ad6..ffc060bb64e 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1947,7 +1947,7 @@ static void nlaevalchan_blendOrcombine(NlaEvalChannelSnapshot *lower_necs, return; } default: - BLI_assert("Mix mode should've been handled"); + BLI_assert_msg(0, "Mix mode should've been handled"); } return; } @@ -1960,7 +1960,7 @@ static void nlaevalchan_blendOrcombine(NlaEvalChannelSnapshot *lower_necs, return; } default: - BLI_assert("Blend mode should've been handled"); + BLI_assert_msg(0, "Blend mode should've been handled"); } } @@ -2110,7 +2110,7 @@ static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan( return; } default: - BLI_assert("Mix mode should've been handled"); + BLI_assert_msg(0, "Mix mode should've been handled"); } return; } @@ -2123,7 +2123,7 @@ static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan( return; } default: - BLI_assert("Blend mode should've been handled"); + BLI_assert_msg(0, "Blend mode should've been handled"); } } diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc index 6250c1b9986..cbb5bf34477 100644 --- a/source/blender/blenlib/intern/task_pool.cc +++ b/source/blender/blenlib/intern/task_pool.cc @@ -532,7 +532,7 @@ bool BLI_task_pool_current_canceled(TaskPool *pool) case TASK_POOL_BACKGROUND_SERIAL: return background_task_pool_canceled(pool); } - BLI_assert("BLI_task_pool_canceled: Control flow should not come here!"); + BLI_assert_msg(0, "BLI_task_pool_canceled: Control flow should not come here!"); return false; } diff --git a/source/blender/compositor/nodes/COM_RenderLayersNode.cc b/source/blender/compositor/nodes/COM_RenderLayersNode.cc index 253ca542c04..6744e98ecdb 100644 --- a/source/blender/compositor/nodes/COM_RenderLayersNode.cc +++ b/source/blender/compositor/nodes/COM_RenderLayersNode.cc @@ -143,7 +143,7 @@ void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *o break; } default: { - BLI_assert("!Unexpected data type"); + BLI_assert_msg(0, "Unexpected data type"); return; } } diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 28af1fbf79a..35072518b66 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -147,7 +147,7 @@ static bool drw_draw_show_annotation(void) * the draw manager is only used to draw the background. */ return false; default: - BLI_assert(""); + BLI_assert(0); return false; } } diff --git a/source/blender/freestyle/intern/geometry/FastGrid.cpp b/source/blender/freestyle/intern/geometry/FastGrid.cpp index 1e0ae06da19..0f1edd647c7 100644 --- a/source/blender/freestyle/intern/geometry/FastGrid.cpp +++ b/source/blender/freestyle/intern/geometry/FastGrid.cpp @@ -62,7 +62,7 @@ Cell *FastGrid::getCell(const Vec3u &p) << " " << _cells_size << endl; } #endif - BLI_assert(_cells || ("_cells is a null pointer")); + BLI_assert_msg(_cells, "_cells is a null pointer"); BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); BLI_assert(p[0] < _cells_nb[0]); BLI_assert(p[1] < _cells_nb[1]); @@ -72,7 +72,7 @@ Cell *FastGrid::getCell(const Vec3u &p) void FastGrid::fillCell(const Vec3u &p, Cell &cell) { - BLI_assert(_cells || ("_cells is a null pointer")); + BLI_assert_msg(_cells, "_cells is a null pointer"); BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size); BLI_assert(p[0] < _cells_nb[0]); BLI_assert(p[1] < _cells_nb[1]); |