[Bf-blender-cvs] [7a312290116] master: Cleanup: Use `BLI_assert_unreachable()` as example in comment of `_BLI_assert_abort`.

Bastien Montagne noreply at git.blender.org
Tue May 17 16:07:01 CEST 2022


Commit: 7a3122901166cc2200460a5659aa8b28dae70483
Author: Bastien Montagne
Date:   Tue May 17 15:25:03 2022 +0200
Branches: master
https://developer.blender.org/rB7a3122901166cc2200460a5659aa8b28dae70483

Cleanup: Use `BLI_assert_unreachable()` as example in comment of `_BLI_assert_abort`.

Using `BLI_assert(0)` should typically be avoided now that we have
`BLI_assert_unreachable`...

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

M	source/blender/blenlib/intern/BLI_assert.c

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

diff --git a/source/blender/blenlib/intern/BLI_assert.c b/source/blender/blenlib/intern/BLI_assert.c
index 2ebeba43dbe..96c16b47214 100644
--- a/source/blender/blenlib/intern/BLI_assert.c
+++ b/source/blender/blenlib/intern/BLI_assert.c
@@ -40,7 +40,7 @@ void _BLI_assert_abort(void)
   /* Wrap to remove 'noreturn' attribute since this suppresses missing return statements,
    * allowing changes to debug builds to accidentally to break release builds.
    *
-   * For example `BLI_assert(0);` at the end of a function that returns a value,
+   * For example `BLI_assert_unreachable();` at the end of a function that returns a value,
    * will hide that it's missing a return. */
 
   abort();



More information about the Bf-blender-cvs mailing list