From acf60063d57dd9e326d9f351b0e93534690be67f Mon Sep 17 00:00:00 2001 From: nhkeni Date: Thu, 29 Feb 2024 10:49:53 -0500 Subject: [PATCH] Add missing prototypes for static functions to avoid warnings. --- src/botl.c | 1 + src/cmd.c | 2 ++ src/end.c | 3 +++ src/hack.c | 1 + src/hacklib.c | 1 + src/insight.c | 1 + src/isaac64.c | 5 +++++ src/makemon.c | 1 + src/mkmaze.c | 1 + src/mkobj.c | 1 + src/monmove.c | 1 + src/nhlobj.c | 1 + src/nhlua.c | 9 +++++++++ src/options.c | 3 +++ src/rnd.c | 1 + src/sounds.c | 1 + src/sp_lev.c | 4 ++++ src/spell.c | 5 +++++ src/teleport.c | 1 + src/utf8map.c | 1 + src/zap.c | 1 + 21 files changed, 45 insertions(+) diff --git a/src/botl.c b/src/botl.c index 8866a6e86..f5cbe006e 100644 --- a/src/botl.c +++ b/src/botl.c @@ -18,6 +18,7 @@ const char *const enc_stat[] = { static const char *rank(void); static void bot_via_windowport(void); static void stat_update_time(void); +static char *get_strength_str(void); static char * get_strength_str(void) diff --git a/src/cmd.c b/src/cmd.c index 1c9e804a6..e21f06540 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -19,6 +19,8 @@ static int wiz_display_macros(void); static int wiz_mon_diff(void); #endif +static int wiz_load_splua(void); +static int wiz_telekinesis(void); #ifdef DUMB /* stuff commented out in extern.h, but needed here */ extern int doapply(void); /**/ diff --git a/src/end.c b/src/end.c index 6045ff9a7..3f1560bdc 100644 --- a/src/end.c +++ b/src/end.c @@ -40,6 +40,9 @@ static void dump_everything(int, time_t); #ifdef CRASHREPORT static const char *get_saved_pline(int); #endif +static void fixup_death(int); +static int wordcount(char *); +static void bel_copy1(char **, char *); #if defined(__BEOS__) || defined(MICRO) || defined(OS2) || defined(WIN32) ATTRNORETURN extern void nethack_exit(int) NORETURN; diff --git a/src/hack.c b/src/hack.c index 2a3661cd9..2624db0e9 100644 --- a/src/hack.c +++ b/src/hack.c @@ -40,6 +40,7 @@ static void move_update(boolean); static int pickup_checks(void); static boolean doorless_door(coordxy, coordxy); static void maybe_wail(void); +static boolean water_turbulence(coordxy *, coordxy *); #define IS_SHOP(x) (gr.rooms[x].rtype >= SHOPBASE) diff --git a/src/hacklib.c b/src/hacklib.c index ae265a5f3..1d09a1ae9 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -948,6 +948,7 @@ static struct tm *getlt(void); /* Sets the seed for the random number generator */ #ifdef USE_ISAAC64 +static void set_random(unsigned long seed, int (*)(int)); static void set_random(unsigned long seed, diff --git a/src/insight.c b/src/insight.c index 78b172686..b81ece08e 100644 --- a/src/insight.c +++ b/src/insight.c @@ -35,6 +35,7 @@ static int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr); static int num_extinct(void); static int num_gone(int, int *); static char *size_str(int); +static void item_resistance_message(int, const char *, int); extern const char *const hu_stat[]; /* hunger status from eat.c */ extern const char *const enc_stat[]; /* encumbrance status from botl.c */ diff --git a/src/isaac64.c b/src/isaac64.c index e95eb8131..7b5d016dd 100644 --- a/src/isaac64.c +++ b/src/isaac64.c @@ -30,6 +30,11 @@ #define inline /*empty*/ #endif +static inline uint32_t lower_bits(uint64_t); +static inline uint32_t upper_bits(uint64_t); +static void isaac64_update(isaac64_ctx *); +static void isaac64_mix(uint64_t[8]); + /* Extract ISAAC64_SZ_LOG bits (starting at bit 3). */ static inline uint32_t lower_bits(uint64_t x) { diff --git a/src/makemon.c b/src/makemon.c index 882c035ad..bd61ef13e 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -24,6 +24,7 @@ static void m_initthrow(struct monst *, int, int); static void m_initweap(struct monst *); static void m_initinv(struct monst *); static boolean makemon_rnd_goodpos(struct monst *, mmflags_nht, coord *); +static void init_mextra(struct mextra *); #define m_initsgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 3, mmf) #define m_initlgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 10, mmf) diff --git a/src/mkmaze.c b/src/mkmaze.c index db752a2f3..92cb485d2 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -26,6 +26,7 @@ static void stolen_booty(void); static boolean maze_inbounds(coordxy, coordxy); static void maze_remove_deadends(xint16); static void populate_maze(void); +static boolean is_exclusion_zone(xint16, coordxy, coordxy); /* adjust a coordinate one step in the specified direction */ #define mz_move(X, Y, dir) \ diff --git a/src/mkobj.c b/src/mkobj.c index a7751f3a8..422ef9d06 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -25,6 +25,7 @@ static void insane_object(struct obj *, const char *, const char *, static void check_contained(struct obj *, const char *); static void check_glob(struct obj *, const char *); static void sanity_check_worn(struct obj *); +static void init_oextra(struct oextra *); struct icp { int iprob; /* probability of an item type */ diff --git a/src/monmove.c b/src/monmove.c index 31c0ba0f1..2c0d62f14 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -26,6 +26,7 @@ static void leppie_stash(struct monst *); static boolean m_balks_at_approaching(struct monst *); static boolean stuff_prevents_passage(struct monst *); static int vamp_shift(struct monst *, struct permonst *, boolean); +static void maybe_spin_web(struct monst *); /* a11y: give a message when monster moved */ static void diff --git a/src/nhlobj.c b/src/nhlobj.c index 092cc60e7..2eefac8b9 100644 --- a/src/nhlobj.c +++ b/src/nhlobj.c @@ -27,6 +27,7 @@ static int l_obj_timer_peek(lua_State *); static int l_obj_timer_stop(lua_State *); static int l_obj_timer_start(lua_State *); static int l_obj_bury(lua_State *); +static struct _lua_obj *l_obj_push(lua_State *, struct obj *); #define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE) diff --git a/src/nhlua.c b/src/nhlua.c index 0c587cf56..d6bed268f 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -23,6 +23,8 @@ /* */ +struct e; + /* lua_CFunction prototypes */ #ifdef DUMPLOG static int nhl_dump_fmtstr(lua_State *); @@ -80,6 +82,13 @@ static void nhlL_openlibs(lua_State *, uint32_t); static void *nhl_alloc(void *, void *, size_t, size_t); static lua_State *nhlL_newstate (nhl_sandbox_info *, const char *); static void end_luapat(void); +static int nhl_get_config(lua_State *); +static int nhl_variable(lua_State *); +static void nhl_clearfromtable(lua_State *, int, int, struct e *); +static void nhl_warn(void *, const char *, int); +static void nhl_clearfromtable(lua_State *, int, int, struct e *); +static int nhl_panic(lua_State *); +static void nhl_hookfn(lua_State *, lua_Debug *); static const char *const nhcore_call_names[NUM_NHCORE_CALLS] = { "start_new_game", diff --git a/src/options.c b/src/options.c index d290fcc5d..d91f330c6 100644 --- a/src/options.c +++ b/src/options.c @@ -26,6 +26,9 @@ NEARDATA struct instance_flags iflags; /* provide linkage */ #define PREV_MSGS 0 #endif +static char *color_attr_to_str(color_attr *); +static boolean color_attr_parse_str(color_attr *, char *); + /* * NOTE: If you add (or delete) an option, please review the following: * doc/options.txt diff --git a/src/rnd.c b/src/rnd.c index 58787b9d1..410f85687 100644 --- a/src/rnd.c +++ b/src/rnd.c @@ -8,6 +8,7 @@ #include "isaac64.h" static int whichrng(int (*fn)(int)); +static int RND(int); #if 0 static isaac64_ctx rng_state; diff --git a/src/sounds.c b/src/sounds.c index ebd8ed8d8..5c34ffd97 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -14,6 +14,7 @@ static int domonnoise(struct monst *); static int dochat(void); static struct monst *responsive_mon_at(int, int); static int mon_in_room(struct monst *, int); +static boolean oracle_sound(struct monst *); /* this easily could be a macro, but it might overtax dumb compilers */ static int diff --git a/src/sp_lev.c b/src/sp_lev.c index a19d91408..973598791 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -67,6 +67,10 @@ static void fill_empty_maze(void); static void splev_initlev(lev_init *); static boolean generate_way_out_method(coordxy nx, coordxy ny, struct selectionvar *ov); +static void l_push_wid_hei_table(lua_State *, int, int); +static boolean good_stair_loc(coordxy, coordxy); +static void ensure_way_out(void); + #if 0 /* macosx complains that these are unused */ static long sp_code_jmpaddr(long, long); diff --git a/src/spell.c b/src/spell.c index 49617c21d..0ea9adfe9 100644 --- a/src/spell.c +++ b/src/spell.c @@ -25,6 +25,9 @@ #define spellet(spell) \ ((char) ((spell < 26) ? ('a' + spell) : ('A' + spell - 26))) +struct chain_lightning_queue; +struct chain_lightning_zap; + static int spell_let_to_idx(char); static boolean cursed_book(struct obj * bp); static boolean confused_book(struct obj *); @@ -48,6 +51,8 @@ static const char *spelltypemnemonic(int); static boolean can_center_spell_location(coordxy, coordxy); static void display_spell_target_positions(boolean); static boolean spell_aim_step(genericptr_t, coordxy, coordxy); +static void propagate_chain_lightning(struct chain_lightning_queue *, + struct chain_lightning_zap); /* The roles[] table lists the role-specific values for tuning * percent_success(). diff --git a/src/teleport.c b/src/teleport.c index e1a4d2e82..8c3abfa99 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -14,6 +14,7 @@ static boolean rloc_pos_ok(coordxy, coordxy, struct monst *); static void rloc_to_core(struct monst *, coordxy, coordxy, unsigned); static void mvault_tele(struct monst *); static boolean m_blocks_teleporting(struct monst *); +static stairway *stairway_find_forwiz(boolean, boolean); /* does monster block others from teleporting? */ static boolean diff --git a/src/utf8map.c b/src/utf8map.c index 6ee0c19d6..4b229fbfd 100644 --- a/src/utf8map.c +++ b/src/utf8map.c @@ -50,6 +50,7 @@ static char *fix_glyphname(char *str); static int32_t rgbstr_to_int32(const char *rgbstr); boolean closest_color(uint32_t lcolor, uint32_t *closecolor, int *clridx); static const long nonzero_black = 0x1000000; +static int color_distance(uint32_t, uint32_t); static void to_custom_symset_entry_callback(int glyph, struct find_struct *findwhat) diff --git a/src/zap.c b/src/zap.c index eb07ca773..18f156a6a 100644 --- a/src/zap.c +++ b/src/zap.c @@ -36,6 +36,7 @@ static int zap_ok(struct obj *) NO_NNARGS; static void boxlock_invent(struct obj *) NONNULLARG1; static int spell_hit_bonus(int); static int maybe_destroy_item(struct monst *, struct obj *, int) NONNULLPTRS; +static boolean destroyable(struct obj *, int); static void wishcmdassist(int);