clear a -Wshadow warning in options.c
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,
^~~~~~
This commit is contained in:
@@ -5730,8 +5730,8 @@ int len;
|
|||||||
substring of a particular option name; option string might have
|
substring of a particular option name; option string might have
|
||||||
a colon or equals sign and arbitrary value appended to it */
|
a colon or equals sign and arbitrary value appended to it */
|
||||||
boolean
|
boolean
|
||||||
match_optname(user_string, opt_name, min_length, val_allowed)
|
match_optname(user_string, optn_name, min_length, val_allowed)
|
||||||
const char *user_string, *opt_name;
|
const char *user_string, *optn_name;
|
||||||
int min_length;
|
int min_length;
|
||||||
boolean val_allowed;
|
boolean val_allowed;
|
||||||
{
|
{
|
||||||
@@ -5741,7 +5741,7 @@ boolean val_allowed;
|
|||||||
len = length_without_val(user_string, len);
|
len = length_without_val(user_string, len);
|
||||||
|
|
||||||
return (boolean) (len >= min_length
|
return (boolean) (len >= min_length
|
||||||
&& !strncmpi(opt_name, user_string, len));
|
&& !strncmpi(optn_name, user_string, len));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user