Add macro cf_assert ("control flow" assert) to hint to gcc that certain
conditions are impossible. Use it to avoid generating range checks for
situations that never happen. If the event did happen, the only
consequence would be truncated UI text, rather than a correctness
problem.
Rather than use an inline wrapper and rely on the compiler optimizer to
redirect gr_set_current_canvas(nullptr) to gr_set_default_canvas,
rewrite all relevant calls directly in the source.
git grep -l 'gr_set_current_canvas' | xargs sed -i -e 's:gr_set_current_canvas(\s*NULL\|nullptr\s*);:gr_set_default_canvas();:'
All supported compilers have an acceptable <type_traits>. Commit
4cb3d46148 ("Move <type_traits> test to Cxx11RequiredFeature") made
<type_traits> support mandatory in August and no one has objected.
Remove the indirection and use namespace std directly for type_traits
members.
For switch cases where existing comments or code flow logic obviously
intended to fall through, add a gcc-7 /*-fallthrough*/ comment to
silence warnings about this. Some cases which are less obvious are not
converted, so the code does not yet compile clean with
-Wimplicit-fallthrough.
Reported-by: parkerlreed <https://github.com/dxx-rebirth/dxx-rebirth/issues/338>
Commit 1c8ad24 removed all reads of `wind`, but did not remove its
assignment or declaration. This breaks the build with gcc due to
-Wunused-but-set-variable.
Fixes: 1c8ad24da3 ("Check for window_event_result::deleted for ui_get_filename polling loop")
Commit 917f079 removed all reads of `wind`, but did not remove its
assignment or declaration. This breaks the build with gcc due to
-Wunused-but-set-variable.
Fixes: 917f079f02 ("Check for window_event_result::deleted in ui_dialog_do_gadgets")