NOSTATICFN for src/*

This commit is contained in:
nhkeni
2024-03-14 17:41:51 -04:00
parent d523041b60
commit 9c0ed8ae63
111 changed files with 3871 additions and 3879 deletions

164
src/eat.c
View File

@@ -5,46 +5,46 @@
#include "hack.h"
static int eatmdone(void);
static int eatfood(void);
static struct obj *costly_tin(int);
static int opentin(void);
static int unfaint(void);
staticfn int eatmdone(void);
staticfn int eatfood(void);
staticfn struct obj *costly_tin(int);
staticfn int opentin(void);
staticfn int unfaint(void);
static const char *food_xname(struct obj *, boolean);
static void choke(struct obj *);
static void recalc_wt(void);
static int adj_victual_nutrition(void);
static struct obj *touchfood(struct obj *) NONNULL;
static void do_reset_eat(void);
static void done_eating(boolean);
static void cprefx(int);
static boolean temp_givit(int, struct permonst *);
static void givit(int, struct permonst *);
static void eye_of_newt_buzz(void);
static void cpostfx(int);
static void consume_tin(const char *);
static void start_tin(struct obj *);
static int eatcorpse(struct obj *);
static void start_eating(struct obj *, boolean);
static void garlic_breath(struct monst *);
static void fprefx(struct obj *);
static void fpostfx(struct obj *);
static int bite(void);
static int edibility_prompts(struct obj *);
static int doeat_nonfood(struct obj *);
static int tinopen_ok(struct obj *);
static int rottenfood(struct obj *);
static void eatspecial(void);
static int bounded_increase(int, int, int);
static void accessory_has_effect(struct obj *);
static void eataccessory(struct obj *);
static const char *foodword(struct obj *);
static int tin_variety(struct obj *, boolean);
static boolean maybe_cannibal(int, boolean);
static int eat_ok(struct obj *);
static int offer_ok(struct obj *);
static int tin_ok(struct obj *);
staticfn const char *food_xname(struct obj *, boolean);
staticfn void choke(struct obj *);
staticfn void recalc_wt(void);
staticfn int adj_victual_nutrition(void);
staticfn struct obj *touchfood(struct obj *) NONNULL;
staticfn void do_reset_eat(void);
staticfn void done_eating(boolean);
staticfn void cprefx(int);
staticfn boolean temp_givit(int, struct permonst *);
staticfn void givit(int, struct permonst *);
staticfn void eye_of_newt_buzz(void);
staticfn void cpostfx(int);
staticfn void consume_tin(const char *);
staticfn void start_tin(struct obj *);
staticfn int eatcorpse(struct obj *);
staticfn void start_eating(struct obj *, boolean);
staticfn void garlic_breath(struct monst *);
staticfn void fprefx(struct obj *);
staticfn void fpostfx(struct obj *);
staticfn int bite(void);
staticfn int edibility_prompts(struct obj *);
staticfn int doeat_nonfood(struct obj *);
staticfn int tinopen_ok(struct obj *);
staticfn int rottenfood(struct obj *);
staticfn void eatspecial(void);
staticfn int bounded_increase(int, int, int);
staticfn void accessory_has_effect(struct obj *);
staticfn void eataccessory(struct obj *);
staticfn const char *foodword(struct obj *);
staticfn int tin_variety(struct obj *, boolean);
staticfn boolean maybe_cannibal(int, boolean);
staticfn int eat_ok(struct obj *);
staticfn int offer_ok(struct obj *);
staticfn int tin_ok(struct obj *);
/* also used to see if you're allowed to eat cats and dogs */
#define CANNIBAL_ALLOWED() (Role_if(PM_CAVE_DWELLER) || Race_if(PM_ORC))
@@ -157,7 +157,7 @@ static const struct {
#define TTSZ SIZE(tintxts)
/* called after mimicking is over */
static int
staticfn int
eatmdone(void)
{
/* release `eatmbuf' */
@@ -211,7 +211,7 @@ eatmupdate(void)
}
/* ``[the(] singular(food, xname) [)]'' */
static const char *
staticfn const char *
food_xname(struct obj *food, boolean the_pfx)
{
const char *result;
@@ -239,7 +239,7 @@ food_xname(struct obj *food, boolean the_pfx)
*
* To a full belly all food is bad. (It.)
*/
static void
staticfn void
choke(struct obj *food)
{
/* only happens if you were satiated */
@@ -286,7 +286,7 @@ choke(struct obj *food)
}
/* modify victual.piece->owt depending on time spent consuming it */
static void
staticfn void
recalc_wt(void)
{
struct obj *piece = gc.context.victual.piece;
@@ -332,7 +332,7 @@ obj_nutrition(struct obj *otmp)
/* nutrition increment for next byte; this used to be factored into
victual.piece->oeaten but that produced weight change if hero
polymorphed to or from one of the races which has nutrition adjusted */
static int
staticfn int
adj_victual_nutrition(void)
{
int otyp = gc.context.victual.piece->otyp;
@@ -353,7 +353,7 @@ adj_victual_nutrition(void)
return nut;
}
static struct obj *
staticfn struct obj *
touchfood(struct obj *otmp)
{
if (otmp->quan > 1L) {
@@ -413,7 +413,7 @@ food_substitution(struct obj *old_obj, struct obj *new_obj)
}
}
static void
staticfn void
do_reset_eat(void)
{
debugpline0("do_reset_eat...");
@@ -483,10 +483,10 @@ eating_dangerous_corpse(int res)
}
#if 0 /* no longer used */
static void maybe_extend_timed_resist(int);
staticfn void maybe_extend_timed_resist(int);
/* if temp resist against 'prop' is about to timeout, extend it slightly */
static void
staticfn void
maybe_extend_timed_resist(int prop)
{
long timeout = temp_resist(prop);
@@ -505,7 +505,7 @@ maybe_extend_timed_resist(int prop)
#endif
/* called each move during eating process */
static int
staticfn int
eatfood(void)
{
struct obj *food = gc.context.victual.piece;
@@ -530,7 +530,7 @@ eatfood(void)
}
}
static void
staticfn void
done_eating(boolean message)
{
struct obj *piece = gc.context.victual.piece;
@@ -738,7 +738,7 @@ eat_brains(
}
/* eating a corpse or egg of one's own species is usually naughty */
static boolean
staticfn boolean
maybe_cannibal(int pm, boolean allowmsg)
{
static NEARDATA long ate_brains = 0L;
@@ -771,7 +771,7 @@ maybe_cannibal(int pm, boolean allowmsg)
return FALSE;
}
static void
staticfn void
cprefx(int pm)
{
(void) maybe_cannibal(pm, TRUE);
@@ -967,7 +967,7 @@ should_givit(int type, struct permonst *ptr)
return (ptr->mlevel > rn2(chance));
}
static boolean
staticfn boolean
temp_givit(int type, struct permonst *ptr)
{
int chance = (type == STONE_RES) ? 6 : (type == ACID_RES) ? 3 : 0;
@@ -978,7 +978,7 @@ temp_givit(int type, struct permonst *ptr)
/* givit() tries to give you an intrinsic based on the monster's level
* and what type of intrinsic it is trying to give you.
*/
static void
staticfn void
givit(int type, struct permonst *ptr)
{
debugpline1("Attempting to give intrinsic %d", type);
@@ -1078,7 +1078,7 @@ givit(int type, struct permonst *ptr)
}
}
static void
staticfn void
eye_of_newt_buzz(void)
{
/* MRKR: "eye of newt" may give small magical energy boost */
@@ -1104,7 +1104,7 @@ eye_of_newt_buzz(void)
DISABLE_WARNING_FORMAT_NONLITERAL
/* called after completely consuming a corpse */
static void
staticfn void
cpostfx(int pm)
{
int tmp = 0;
@@ -1350,7 +1350,7 @@ violated_vegetarian(void)
/* common code to check and possibly charge for 1 gc.context.tin.tin,
* will split() gc.context.tin.tin if necessary */
static struct obj *
staticfn struct obj *
costly_tin(int alter_type) /* COST_xxx */
{
struct obj *tin = gc.context.tin.tin;
@@ -1450,7 +1450,7 @@ set_tin_variety(struct obj *obj, int forcetype)
obj->spe = -(r + 1); /* offset by 1 to allow index 0 */
}
static int
staticfn int
tin_variety(
struct obj *obj,
boolean displ) /* we're just displaying so leave things alone */
@@ -1476,7 +1476,7 @@ tin_variety(
return r;
}
static void
staticfn void
consume_tin(const char *mesg)
{
const char *what;
@@ -1618,7 +1618,7 @@ consume_tin(const char *mesg)
}
/* called during each move whilst opening a tin */
static int
staticfn int
opentin(void)
{
/* perhaps it was stolen (although that should cause interruption) */
@@ -1638,7 +1638,7 @@ opentin(void)
}
/* called when starting to open a tin */
static void
staticfn void
start_tin(struct obj *otmp)
{
const char *mesg = 0;
@@ -1727,7 +1727,7 @@ Hear_again(void)
}
/* called on the "first bite" of rotten food */
static int
staticfn int
rottenfood(struct obj *obj)
{
pline("Blecch! %s %s!",
@@ -1769,7 +1769,7 @@ rottenfood(struct obj *obj)
}
/* called when a corpse is selected as food */
static int
staticfn int
eatcorpse(struct obj *otmp)
{
int retcode = 0, tp = 0, mnum = otmp->corpsenm;
@@ -1934,7 +1934,7 @@ eatcorpse(struct obj *otmp)
}
/* called as you start to eat */
static void
staticfn void
start_eating(struct obj *otmp, boolean already_partly_eaten)
{
const char *old_nomovemsg, *save_nomovemsg;
@@ -1997,7 +1997,7 @@ eating_glob(struct obj *glob)
}
/* scare nearby monster when hero eats garlic */
static void
staticfn void
garlic_breath(struct monst *mtmp)
{
if (olfaction(mtmp->data) && distu(mtmp->mx, mtmp->my) < 7)
@@ -2010,7 +2010,7 @@ garlic_breath(struct monst *mtmp)
* Messages should use present tense since multi-turn food won't be
* finishing at the time they're issued.
*/
static void
staticfn void
fprefx(struct obj *otmp)
{
switch (otmp->otyp) {
@@ -2119,7 +2119,7 @@ fprefx(struct obj *otmp)
}
/* increment a combat intrinsic with limits on its growth */
static int
staticfn int
bounded_increase(int old, int inc, int typ)
{
int absold, absinc, sgnold, sgninc;
@@ -2156,14 +2156,14 @@ bounded_increase(int old, int inc, int typ)
return old + inc;
}
static void
staticfn void
accessory_has_effect(struct obj *otmp)
{
pline("Magic spreads through your body as you digest the %s.",
(otmp->oclass == RING_CLASS) ? "ring" : "amulet");
}
static void
staticfn void
eataccessory(struct obj *otmp)
{
int typ = otmp->otyp;
@@ -2311,7 +2311,7 @@ eataccessory(struct obj *otmp)
}
/* called after eating non-food */
static void
staticfn void
eatspecial(void)
{
struct obj *otmp = gc.context.victual.piece;
@@ -2395,7 +2395,7 @@ static const char *const foodwords[] = {
"plastic", "glass", "rich food", "stone"
};
static const char *
staticfn const char *
foodword(struct obj *otmp)
{
if (otmp->oclass == FOOD_CLASS)
@@ -2407,7 +2407,7 @@ foodword(struct obj *otmp)
}
/* called after consuming (non-corpse) food */
static void
staticfn void
fpostfx(struct obj *otmp)
{
switch (otmp->otyp) {
@@ -2503,9 +2503,9 @@ fpostfx(struct obj *otmp)
/* intended for eating a spellbook while polymorphed, but not used;
"leather" applied to appearance, not composition, and has been
changed to "leathery" to reflect that */
static boolean leather_cover(struct obj *);
staticfn boolean leather_cover(struct obj *);
static boolean
staticfn boolean
leather_cover(struct obj *otmp)
{
const char *odesc = OBJ_DESCR(objects[otmp->otyp]);
@@ -2523,7 +2523,7 @@ leather_cover(struct obj *otmp)
* return 1 if the food was dangerous and you chose to stop.
* return 2 if the food was dangerous and you chose to eat it anyway.
*/
static int
staticfn int
edibility_prompts(struct obj *otmp)
{
/* Blessed food detection grants hero a one-use
@@ -2630,7 +2630,7 @@ edibility_prompts(struct obj *otmp)
return 0;
}
static int
staticfn int
doeat_nonfood(struct obj *otmp)
{
int basenutrit; /* nutrition of full item */
@@ -2969,7 +2969,7 @@ doeat(void)
}
/* getobj callback for object to be opened with a tin opener */
static int
staticfn int
tinopen_ok(struct obj *obj)
{
if (obj && obj->otyp == TIN)
@@ -3014,7 +3014,7 @@ use_tin_opener(struct obj *obj)
/* Take a single bite from a piece of food, checking for choking and
* modifying usedtime. Returns 1 if they choked and survived, 0 otherwise.
*/
static int
staticfn int
bite(void)
{
/* hack to pacify static analyzer incorporated into gcc 12.2 */
@@ -3217,7 +3217,7 @@ lesshungry(int num)
newuhs(FALSE);
}
static int
staticfn int
unfaint(void)
{
(void) Hear_again();
@@ -3398,7 +3398,7 @@ newuhs(boolean incr)
}
/* getobj callback for object to eat - effectively just wraps is_edible() */
static int
staticfn int
eat_ok(struct obj *obj)
{
/* 'getobj_else' will be non-zero if floor food is present and
@@ -3420,7 +3420,7 @@ eat_ok(struct obj *obj)
/* getobj callback for object to be offered (corpses and things that look like
* the Amulet only */
static int
staticfn int
offer_ok(struct obj *obj)
{
if (!obj)
@@ -3442,7 +3442,7 @@ offer_ok(struct obj *obj)
}
/* getobj callback for object to be tinned */
static int
staticfn int
tin_ok(struct obj *obj)
{
if (!obj)