]> granicus.if.org Git - nethack/commitdiff
boolean options parsing bit
authorPatR <rankin@nethack.org>
Tue, 21 Jun 2022 08:08:07 +0000 (01:08 -0700)
committerPatR <rankin@nethack.org>
Tue, 21 Jun 2022 08:08:07 +0000 (01:08 -0700)
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.

src/options.c

index 66a9318ad59c50221133792950d6d38a8ab70fe9..0aaf1f997ceb6e5625d2e1be1b3cde11ab7364d0 100644 (file)
@@ -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