From: PatR Date: Tue, 21 Jun 2022 08:08:07 +0000 (-0700) Subject: boolean options parsing bit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c686c82cb28cd29b70d3b8cf78122d14231b07b;p=nethack boolean options parsing bit Boolean switches: add an omitted 'break', plus a few 'default' cases that would matter if someone turned on the warning about a switch statement with 'enum' index that doesn't have cases for all possible values of that enum. I haven't made any attempt to be exhaustive about those; these few were just right in the same place. --- diff --git a/src/options.c b/src/options.c index 66a9318ad..0aaf1f997 100644 --- a/src/options.c +++ b/src/options.c @@ -4424,6 +4424,9 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op) } } #endif + break; /* from opt_perm_invent */ + default: + break; } /* this dates from when 'O' prompted for a line of options text rather than use a menu to control access to which options can @@ -4449,6 +4452,8 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op) case opt_tiled_map: iflags.wc_ascii_map = negated; break; + default: + break; } /* only do processing below if setting with doset() */ @@ -4545,6 +4550,8 @@ optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op) case opt_rest_on_space: update_rest_on_space(); break; + default: + break; } /* boolean value has been toggled but some option changes can