From: nhmall Date: Wed, 2 Feb 2022 20:33:49 +0000 (-0500) Subject: static keyword on prototype, but function missing it X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c26bae521b969494c6151e1c2fe355096e310178;p=nethack static keyword on prototype, but function missing it error 28 in line 4090 of "invent.c": redeclaration of var with new storage-class error 28 in line 4100 of "invent.c": redeclaration of var with new storage-class error 28 in line 610 of "mdlib.c": redeclaration of var with new storage-class error 28 in line 3846 of "options.c": redeclaration of var with new storage-class error 28 in line 3886 of "options.c": redeclaration of var with new storage-class error 28 in line 5307 of "options.c": redeclaration of var with new storage-class error 28 in line 5343 of "options.c": redeclaration of var with new storage-class error 28 in line 6853 of "options.c": redeclaration of var with new storage-class error 28 in line 7708 of "options.c": redeclaration of var with new storage-class error 28 in line 2686 of "pickup.c": redeclaration of var with new storage-class error 28 in line 1008 of "read.c": redeclaration of var with new storage-class error 28 in line 31 of "rnd.c": redeclaration of var with new storage-class --- diff --git a/src/invent.c b/src/invent.c index 9d59c0082..93be26e06 100644 --- a/src/invent.c +++ b/src/invent.c @@ -4085,7 +4085,7 @@ check_invent_gold(const char *why) /* 'why' == caller in case of warning */ } /* normal getobj callback for item to #adjust; excludes gold */ -int +static int adjust_ok(struct obj *obj) { if (!obj || obj->oclass == COIN_CLASS) @@ -4095,7 +4095,7 @@ adjust_ok(struct obj *obj) } /* getobj callback for item to #adjust if gold is wonky; allows gold */ -int +static int adjust_gold_ok(struct obj *obj) { if (!obj) diff --git a/src/mdlib.c b/src/mdlib.c index e9738dd1c..31cdf1739 100644 --- a/src/mdlib.c +++ b/src/mdlib.c @@ -605,7 +605,7 @@ static const char *const build_opts[] = { "and basic NetHack features" }; -int +static int count_and_validate_winopts(void) { int i, cnt = 0; diff --git a/src/options.c b/src/options.c index c66379903..462fec7b2 100644 --- a/src/options.c +++ b/src/options.c @@ -3840,7 +3840,7 @@ optfn_windowtype(int optidx, int req, boolean negated UNUSED, * Prefix-handling functions */ -int +static int pfxfn_cond_(int optidx UNUSED, int req, boolean negated, char *opts, char *op UNUSED) { @@ -3881,7 +3881,7 @@ pfxfn_cond_(int optidx UNUSED, int req, boolean negated, return optn_ok; } -int +static int pfxfn_font(int optidx, int req, boolean negated, char *opts, char *op) { int opttype = -1; @@ -5302,7 +5302,7 @@ bad_negation(const char *optname, boolean with_parameter) /* go through all of the options and set the minmatch value based on what is needed for uniqueness of each individual option. Set a minimum of 3 characters. */ -void +static void determine_ambiguities(void) { int i, j, len, tmpneeded, needed[SIZE(allopt)]; @@ -5338,7 +5338,7 @@ determine_ambiguities(void) } } -int +static int length_without_val(const char *user_string, int len) { const char *p = index(user_string, ':'), @@ -6848,7 +6848,7 @@ parse_role_opts(int optidx, boolean negated, const char *fullname, } /* Check if character c is illegal as a menu command key */ -boolean +static boolean illegal_menu_cmd_key(uchar c) { if (c == 0 || c == '\r' || c == '\n' || c == '\033' || c == ' ' @@ -7703,7 +7703,7 @@ count_cond(void) return cnt; } -int +static int count_apes(void) { int numapes = 0; diff --git a/src/pickup.c b/src/pickup.c index 94136b53d..553d7913e 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -2681,7 +2681,7 @@ u_handsy(void) } /* getobj callback for object to be stashed into a container */ -int +static int stash_ok(struct obj *obj) { if (!obj) diff --git a/src/read.c b/src/read.c index 54f22133d..df09611d4 100644 --- a/src/read.c +++ b/src/read.c @@ -1003,7 +1003,7 @@ valid_cloud_pos(int x, int y) /* Callback for getpos_sethilite, also used in determining whether a scroll * should have its regular effects, or not because it was out of range. */ -boolean +static boolean can_center_cloud(int x, int y) { if (!valid_cloud_pos(x, y)) diff --git a/src/rnd.c b/src/rnd.c index e02754b8f..77a17b25b 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -26,7 +26,7 @@ static struct rnglist_t rnglist[] = { { rn2_on_display_rng, FALSE, { 0 } }, /* DISP */ }; -int +static int whichrng(int (*fn)(int)) { int i;