mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
remove unreachable break statements
Found with clang's -Wunreachable-code-break Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
6ab2da0e25
commit
d9ad5a2627
36 changed files with 0 additions and 50 deletions
|
@ -137,7 +137,6 @@ int parse_help_only_cmd_opts(struct help_only_cmd_opts_t &opts, int *optind, int
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,7 +398,6 @@ static int parse_cmd_opts(argparse_cmd_opts_t &opts, int *optind, //!OCLINT(hig
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -404,7 +404,6 @@ int parse_cmd_opts(bind_cmd_opts_t &opts, int *optind, //!OCLINT(high ncss meth
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@ static int parse_cmd_opts(block_cmd_opts_t &opts, int *optind, //!OCLINT(high n
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +124,6 @@ int builtin_block(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected scope");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (block) {
|
||||
|
|
|
@ -54,7 +54,6 @@ static int parse_cmd_opts(builtin_cmd_opts_t &opts, int *optind, int argc, wchar
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ static int parse_cmd_opts(command_cmd_opts_t &opts, int *optind, int argc, wchar
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,6 @@ static void replace_part(const wchar_t *begin, const wchar_t *end, const wchar_t
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected append_mode");
|
||||
break;
|
||||
}
|
||||
}
|
||||
out.append(end);
|
||||
|
@ -275,7 +274,6 @@ int builtin_commandline(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -414,7 +412,6 @@ int builtin_commandline(parser_t &parser, io_streams_t &streams, wchar_t **argv)
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected buffer_part");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -261,7 +261,6 @@ int builtin_complete(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ static int parse_cmd_opts(contains_cmd_opts_t &opts, int *optind, int argc, wcha
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,6 @@ static int parse_cmd_opts(echo_cmd_opts_t &opts, int *optind, int argc, wchar_t
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ static int parse_cmd_opts(exit_cmd_opts_t &opts, int *optind, //!OCLINT(high nc
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -164,7 +164,6 @@ static int parse_cmd_opts(function_cmd_opts_t &opts, int *optind, //!OCLINT(hig
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,6 @@ static int parse_cmd_opts(functions_cmd_opts_t &opts, int *optind, //!OCLINT(hi
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,7 +193,6 @@ static wcstring functions_def(const wcstring &name) {
|
|||
case event_type_t::any:
|
||||
default: {
|
||||
DIE("unexpected next->type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,7 +191,6 @@ static int parse_cmd_opts(history_cmd_opts_t &opts, int *optind, //!OCLINT(high
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +305,6 @@ int builtin_history(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
case HIST_UNDEF: {
|
||||
DIE("Unexpected HIST_UNDEF seen");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@ static void builtin_jobs_print(const job_t *j, int mode, int header, io_streams_
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected mode");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +164,6 @@ int builtin_jobs(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,6 @@ static int parse_cmd_opts(math_cmd_opts_t &opts, int *optind, //!OCLINT(high nc
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -570,7 +570,6 @@ void builtin_printf_state_t::print_direc(const wchar_t *start, size_t length, wc
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected opt");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ int builtin_pwd(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,6 @@ static int parse_cmd_opts(read_cmd_opts_t &opts, int *optind, //!OCLINT(high nc
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ static int parse_cmd_opts(return_cmd_opts_t &opts, int *optind, //!OCLINT(high
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,6 @@ static int parse_cmd_opts(set_cmd_opts_t &opts, int *optind, //!OCLINT(high ncs
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +335,6 @@ static void handle_env_return(int retval, const wchar_t *cmd, const wchar_t *key
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected vars.set() ret val");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -572,7 +570,6 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams
|
|||
}
|
||||
default: {
|
||||
DIE("invalid scope");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -145,7 +145,6 @@ int builtin_set_color(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -259,7 +259,6 @@ static int parse_cmd_opts(status_cmd_opts_t &opts, int *optind, //!OCLINT(high
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -517,7 +517,6 @@ unique_ptr<expression> test_parser::parse_expression(unsigned int start, unsigne
|
|||
switch (argc) {
|
||||
case 0: {
|
||||
DIE("argc should not be zero"); // should have been caught by the above test
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
return error(L"Missing argument at index %u", start + 1);
|
||||
|
|
|
@ -253,7 +253,6 @@ int builtin_ulimit(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,7 +205,6 @@ int builtin_wait(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected retval from wgetopt_long");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -867,7 +867,6 @@ static bool exec_process_in_job(parser_t &parser, process_t *p, const std::share
|
|||
// We should have handled exec up above.
|
||||
DIE("process_type_t::exec process found in pipeline, where it should never be. "
|
||||
"Aborting.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -615,7 +615,6 @@ static expand_result_t expand_cmdsubst(wcstring input, parser_t &parser,
|
|||
}
|
||||
default: {
|
||||
DIE("unhandled parse_ret value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -346,7 +346,6 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
|
|||
printf("%*ls %ls\n", -name_width, cat->name, _(cat->description));
|
||||
}
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
case 'p': {
|
||||
s_profiling_output_filename = optarg;
|
||||
|
@ -360,7 +359,6 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
|
|||
case 'v': {
|
||||
std::fwprintf(stdout, _(L"%s, version %s\n"), PACKAGE_NAME, get_fish_version());
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
case 'D': {
|
||||
char *end;
|
||||
|
@ -381,7 +379,6 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
|
|||
default: {
|
||||
// We assume getopt_long() has already emitted a diagnostic msg.
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -573,12 +573,10 @@ int main(int argc, char *argv[]) {
|
|||
case 'h': {
|
||||
print_help("fish_indent", 1);
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
case 'v': {
|
||||
std::fwprintf(stderr, _(L"%ls, version %s\n"), program_name, get_fish_version());
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
case 'w': {
|
||||
output_type = output_type_file;
|
||||
|
@ -634,7 +632,6 @@ int main(int argc, char *argv[]) {
|
|||
default: {
|
||||
// We assume getopt_long() has already emitted a diagnostic msg.
|
||||
exit(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -708,7 +705,6 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
case output_type_pygments_csv: {
|
||||
DIE("pygments_csv should have been handled above");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -732,7 +732,6 @@ bool pager_t::select_next_completion_in_direction(selection_motion_t direction,
|
|||
}
|
||||
default: {
|
||||
DIE("unknown cardinal direction");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -869,7 +869,6 @@ end_execution_reason_t parse_execution_context_t::expand_arguments_from_nodes(
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected expand_string() return value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1009,7 +1008,6 @@ end_execution_reason_t parse_execution_context_t::apply_variable_assignments(
|
|||
|
||||
default: {
|
||||
DIE("unexpected expand_string() return value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
wcstring_list_t vals;
|
||||
|
|
|
@ -178,7 +178,6 @@ RESOLVE(statement) {
|
|||
return production_for<decorated>();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case parse_token_type_pipe:
|
||||
case parse_token_type_redirection:
|
||||
|
|
|
@ -1014,7 +1014,6 @@ parser_test_error_bits_t parse_util_detect_errors_in_argument(tnode_t<grammar::a
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected parse_util_locate_cmdsubst() return value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -345,7 +345,6 @@ static size_t wchar_to_utf8_internal(const utf8_wchar_t *in, size_t insize, char
|
|||
}
|
||||
default: {
|
||||
DIE("unexpected utff8 len");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -306,7 +306,6 @@ static bool wildcard_complete_internal(const wchar_t *str, const wchar_t *wc,
|
|||
}
|
||||
default: {
|
||||
DIE("unreachable code reached");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue