]> granicus.if.org Git - nethack/commitdiff
clear a -Wshadow warning in options.c
authornhmall <nhmall@nethack.org>
Mon, 5 Oct 2020 13:24:42 +0000 (09:24 -0400)
committernhmall <nhmall@nethack.org>
Mon, 5 Oct 2020 13:24:42 +0000 (09:24 -0400)
options.c
options.c: In function ‘match_optname’:
options.c:5734:27: warning: declaration of ‘opt_name’ shadows a global declaration [-Wshadow]
 const char *user_string, *opt_name;
                           ^~~~~~~~
In file included from options.c:52:0:
../include/optlist.h:56:1: note: shadowed declaration is here
 opt_##a,
 ^
../include/optlist.h:307:5: note: in expansion of macro ‘NHOPTC’
     NHOPTC(name, PL_NSIZ, opt_in, set_gameview, No, Yes, No, No, NoAlias,
     ^~~~~~

src/options.c

index f505b55233ad79a62181e7fea2869ffb6ae4b142..f8ddb2f5e3d5b70a30fa4aa637901d0ec5cfd7d2 100644 (file)
@@ -5730,8 +5730,8 @@ int len;
    substring of a particular option name; option string might have
    a colon or equals sign and arbitrary value appended to it */
 boolean
-match_optname(user_string, opt_name, min_length, val_allowed)
-const char *user_string, *opt_name;
+match_optname(user_string, optn_name, min_length, val_allowed)
+const char *user_string, *optn_name;
 int min_length;
 boolean val_allowed;
 {
@@ -5741,7 +5741,7 @@ boolean val_allowed;
         len = length_without_val(user_string, len);
 
     return (boolean) (len >= min_length
-                      && !strncmpi(opt_name, user_string, len));
+                      && !strncmpi(optn_name, user_string, len));
 }
 
 void