Ensure we continue to cover enums in switches

Where we already manage to cover an enum entirely in a switch
statement such that default: cannot be reached, help ensure
it stays that way by condemning that route.

Also adjust a 'const' I came across that is ignored.
This commit is contained in:
Aaron Gyes
2016-07-30 11:48:39 -07:00
parent acfd380176
commit ee26eafc25
9 changed files with 30 additions and 16 deletions

View File

@@ -3,6 +3,7 @@
// IWYU pragma: no_include <cstddef>
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <wchar.h>
#include <wctype.h>
#include <map>
@@ -602,11 +603,14 @@ bool pager_t::select_next_completion_in_direction(selection_direction_t directio
case direction_page_north:
case direction_east:
case direction_west:
case direction_deselect:
default: {
case direction_deselect: {
// These do nothing.
return false;
}
default: {
assert(0 && "Unhandled selection_direction_t constant");
abort();
}
}
}