From: PatR Date: Sun, 15 May 2016 01:34:15 +0000 (-0700) Subject: role parsing lint X-Git-Tag: NetHack-3.6.1_RC01~768 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=094f39337898c837024c05d3400c34d350dd1df1;p=nethack role parsing lint --- diff --git a/src/options.c b/src/options.c index e24618e6a..ba4e0f1b4 100644 --- a/src/options.c +++ b/src/options.c @@ -519,6 +519,8 @@ STATIC_DCL int NDECL(msgtype_count); STATIC_DCL boolean FDECL(add_menu_coloring_parsed, (char *, int, int)); STATIC_DCL void FDECL(free_one_menu_coloring, (int)); STATIC_DCL int NDECL(count_menucolors); +STATIC_DCL boolean FDECL(parse_role_opts, (BOOLEAN_P, const char *, + char *, char **)); STATIC_DCL void FDECL(oc_to_str, (char *, char *)); STATIC_DCL void FDECL(doset_add_menu, (winid, const char *, int)); @@ -1723,18 +1725,20 @@ count_menucolors() return count; } -boolean +STATIC_OVL boolean parse_role_opts(negated, fullname, opts, opp) boolean negated; -char *fullname; +const char *fullname; char *opts; char **opp; { char *op = *opp; + if (negated) { bad_negation(fullname, FALSE); } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { boolean val_negated = FALSE; + while ((*op == '!') || !strncmpi(op, "no", 2)) { if (*op == '!') op++; @@ -1762,7 +1766,7 @@ boolean tinitial, tfrom_file; { char *op; unsigned num; - boolean negated, val_negated, duplicate; + boolean negated, duplicate; int i; const char *fullname;