mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user