diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-17 16:11:30 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-17 17:06:54 +0300 |
commit | 22bf2632690598d74a7fcdf85d9632f43c48456c (patch) | |
tree | 7eccd8c8288c033e17fd4ddc9d0846e4b1baabba | |
parent | c6e3242e1840b3df977288e126f5d625db2a4920 (diff) |
Cleanup: Use `switch` and `BLI_assert_unreachable()` more.
Replace some `if/else if` chains by proper `switch` statement.
Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/undofile.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 16bad11629a..1b9c450967a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2413,7 +2413,7 @@ static int lib_link_main_data_restore_cb(LibraryIDLinkCallbackData *cb_data) if (collection->flag & COLLECTION_IS_MASTER) { /* We should never reach that point anymore, since master collection private ID should be * properly tagged with IDWALK_CB_EMBEDDED. */ - BLI_assert(0); + BLI_assert_unreachable(); return IDWALK_RET_NOP; } } diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index bb3b6d0b75d..b5c2a73c268 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -120,7 +120,7 @@ void BLO_memfile_write_init(MemFileWriteData *mem_data, *entry = mem_chunk; } else { - BLI_assert(0); + BLI_assert_unreachable(); } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 2ae660ab1b6..b0a25221098 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1409,7 +1409,7 @@ bool BLO_write_file(Main *mainvar, BKE_bpath_absolute_convert(mainvar, dir_src, NULL); break; case BLO_WRITE_PATH_REMAP_NONE: - BLI_assert(0); /* Unreachable. */ + BLI_assert_unreachable(); /* Unreachable. */ break; } } |