mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 21:11:15 -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 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
@@ -255,7 +256,7 @@ block_t *parser_t::block_at_index(size_t idx) {
|
||||
return idx < count ? block_stack.at(count - idx - 1) : NULL;
|
||||
}
|
||||
|
||||
block_t *const parser_t::current_block() { return block_stack.empty() ? NULL : block_stack.back(); }
|
||||
block_t *parser_t::current_block() { return block_stack.empty() ? NULL : block_stack.back(); }
|
||||
|
||||
void parser_t::forbid_function(const wcstring &function) { forbidden_function.push_back(function); }
|
||||
|
||||
@@ -869,8 +870,8 @@ wcstring block_t::description() const {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
append_format(result, L"unknown type %ld", (long)this->type());
|
||||
break;
|
||||
assert(0 && "Unhandled block_type_t constant");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user