diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-20 21:56:19 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-20 21:56:19 +0300 |
commit | 11494e9472db54c0dc078c9d97fe9c53b763641b (patch) | |
tree | 58cfa5bc25a2faaf3284cbd5096d78a0478b55a4 /source/blender/blenlib/intern | |
parent | 90959c23728fe569d16ce0a962e841e5accd9e51 (diff) |
BLI: add macro to indicate unreachable codetemp-unreachable-abort
Diffstat (limited to 'source/blender/blenlib/intern')
4 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index 06a749ab921..86427bbbe1c 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -1920,14 +1920,12 @@ void add_edge_constraint( constexpr int unreasonably_large_crossings = 100000; if (!ok || crossings.size() == unreasonably_large_crossings) { /* Shouldn't happen but if does, just bail out. */ - BLI_assert(false); - return; + BLI_UNREACHABLE_ABORT; } if (crossings[n].lambda == 0) { if (crossings[n].vert->visit_index == visit) { /* Shouldn't happen but if it does, just bail out. */ - BLI_assert(false); - return; + BLI_UNREACHABLE_ABORT; } crossings[n].vert->visit_index = visit; } diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c index f8618c54ea4..92189290c8e 100644 --- a/source/blender/blenlib/intern/expr_pylike_eval.c +++ b/source/blender/blenlib/intern/expr_pylike_eval.c @@ -642,8 +642,7 @@ static bool parse_add_func(ExprParseState *state, eOpCode code, int args, void * break; default: - BLI_assert(false); - return false; + BLI_UNREACHABLE_ABORT; } parse_add_op(state, code, 1 - args)->arg.ptr = funcptr; diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index b2b8dd4e900..d26c2f79a93 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -1936,8 +1936,7 @@ static IMesh extract_subdivided_tri(const CDT_data &cd, } if (t_in_cdt == -1) { std::cout << "Could not find " << t << " in cdt input tris\n"; - BLI_assert(false); - return IMesh(); + BLI_UNREACHABLE_ABORT; } int t_orig = in_tm.face(t)->orig; constexpr int inline_buf_size = 20; diff --git a/source/blender/blenlib/intern/polyfill_2d_beautify.c b/source/blender/blenlib/intern/polyfill_2d_beautify.c index 7bfca149ffb..f8a028330b8 100644 --- a/source/blender/blenlib/intern/polyfill_2d_beautify.c +++ b/source/blender/blenlib/intern/polyfill_2d_beautify.c @@ -83,8 +83,7 @@ static int oedge_cmp(const void *a1, const void *a2) return -1; } /* Should never get here, no two edges should be the same. */ - BLI_assert(false); - return 0; + BLI_UNREACHABLE_ABORT; } BLI_INLINE bool is_boundary_edge(uint i_a, uint i_b, const uint coord_last) |