From 8e8a6b80cf2749d176d14eaa3bbfd0eccc9ec75e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Jul 2021 18:23:28 +1000 Subject: Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text") This shows the text as part of the assertion message. --- source/blender/blenlib/BLI_assert.h | 2 +- source/blender/blenlib/intern/BLI_mempool.c | 2 +- source/blender/blenlib/intern/expr_pylike_eval.c | 2 +- source/blender/blenlib/intern/math_color.c | 2 +- source/blender/blenlib/intern/task_range.cc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/BLI_assert.h b/source/blender/blenlib/BLI_assert.h index 7f7bec425ce..6019f0f3566 100644 --- a/source/blender/blenlib/BLI_assert.h +++ b/source/blender/blenlib/BLI_assert.h @@ -106,7 +106,7 @@ void _BLI_assert_unreachable_print(const char *file, const int line, const char #define BLI_assert_unreachable() \ { \ _BLI_assert_unreachable_print(__FILE__, __LINE__, __func__); \ - BLI_assert(!"This line of code is marked to be unreachable."); \ + BLI_assert_msg(0, "This line of code is marked to be unreachable."); \ } \ ((void)0) diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index ff17f816588..5263af2ae56 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -387,7 +387,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) } } if (!found) { - BLI_assert(!"Attempt to free data which is not in pool.\n"); + BLI_assert_msg(0, "Attempt to free data which is not in pool.\n"); } } diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c index a5d4130cb20..4d1ba190c14 100644 --- a/source/blender/blenlib/intern/expr_pylike_eval.c +++ b/source/blender/blenlib/intern/expr_pylike_eval.c @@ -569,7 +569,7 @@ static int opcode_arg_count(eOpCode code) case OPCODE_FUNC3: return 3; default: - BLI_assert(!"unexpected opcode"); + BLI_assert_msg(0, "unexpected opcode"); return -1; } } diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c index 263c508c07c..da97e697f2f 100644 --- a/source/blender/blenlib/intern/math_color.c +++ b/source/blender/blenlib/intern/math_color.c @@ -153,7 +153,7 @@ void rgb_to_ycc(float r, float g, float b, float *r_y, float *r_cb, float *r_cr, cr = (0.5f * sr) - (0.41869f * sg) - (0.08131f * sb) + 128.0f; break; default: - BLI_assert(!"invalid colorspace"); + BLI_assert_msg(0, "invalid colorspace"); break; } diff --git a/source/blender/blenlib/intern/task_range.cc b/source/blender/blenlib/intern/task_range.cc index 871d04c1f35..8407be2cb2b 100644 --- a/source/blender/blenlib/intern/task_range.cc +++ b/source/blender/blenlib/intern/task_range.cc @@ -156,7 +156,7 @@ int BLI_task_parallel_thread_id(const TaskParallelTLS *UNUSED(tls)) if (thread_id == -1) { thread_id = atomic_fetch_and_add_int32(&tbb_thread_id_counter, 1); if (thread_id >= BLENDER_MAX_THREADS) { - BLI_assert(!"Maximum number of threads exceeded for sculpting"); + BLI_assert_msg(0, "Maximum number of threads exceeded for sculpting"); thread_id = thread_id % BLENDER_MAX_THREADS; } } -- cgit v1.2.3