From d087746fd7a56ef8a5891eec8defde9e6738cd54 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 6 Apr 2020 15:41:26 +0300 Subject: [PATCH] And some more warning fixes --- src/sp_lev.c | 30 ++---------------------------- src/teleport.c | 6 +++--- src/trap.c | 4 +++- src/wizard.c | 3 ++- 4 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/sp_lev.c b/src/sp_lev.c index 0fecb55d0..4f52abdf2 100755 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -93,6 +93,7 @@ static void NDECL(spo_pop_container); static int FDECL(l_create_stairway, (lua_State *, BOOLEAN_P)); static void FDECL(spo_endroom, (struct sp_coder *)); static void FDECL(l_table_getset_feature_flag, (lua_State *, int, int, const char *, int)); +static void FDECL(sel_set_lit, (int, int, genericptr_t)); static void FDECL(sel_set_ter, (int, int, genericptr_t)); static void FDECL(sel_set_door, (int, int, genericptr_t)); static void FDECL(sel_set_feature, (int, int, genericptr_t)); @@ -4825,32 +4826,6 @@ genericptr_t arg; (*func)(x, y, arg); } - -void -stackDump(L) -lua_State *L; -{ - int i; - int top = lua_gettop(L); - for (i = 1; i <= top; i++) { /* repeat for each level */ - int t = lua_type(L, i); - switch (t) { - case LUA_TSTRING: /* strings */ - pline("%i:\"%s\"", i, lua_tostring(L, i)); - break; - case LUA_TBOOLEAN: /* booleans */ - pline("%i:%s", i, lua_toboolean(L, i) ? "true" : "false"); - break; - case LUA_TNUMBER: /* numbers */ - pline("%i:%g", i, lua_tonumber(L, i)); - break; - default: /* other values */ - pline("%i:%s", i, lua_typename(L, t)); - break; - } - } -} - static void sel_set_ter(x, y, arg) int x, y; @@ -5548,8 +5523,7 @@ lua_State *L; return 0; } - -void +static void sel_set_lit(x, y, arg) int x, y; genericptr_t arg; diff --git a/src/teleport.c b/src/teleport.c index d1200e06c..3beec5d69 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -1020,11 +1020,11 @@ level_tele() which branches don't connect to anything deeper; mainly used to distinguish "can't get there from here" vs "from anywhere" rather than to control destination */ - d_level *branch = In_quest(&u.uz) ? &qstart_level + d_level *qbranch = In_quest(&u.uz) ? &qstart_level : In_mines(&u.uz) ? &mineend_level : &sanctum_level; - int deepest = g.dungeons[branch->dnum].depth_start - + dunlevs_in_dungeon(branch) - 1; + int deepest = g.dungeons[qbranch->dnum].depth_start + + dunlevs_in_dungeon(qbranch) - 1; /* if invocation did not yet occur, teleporting into * the last level of Gehennom is forbidden. diff --git a/src/trap.c b/src/trap.c index 076254ebd..84587a0fd 100644 --- a/src/trap.c +++ b/src/trap.c @@ -9,6 +9,8 @@ extern const char *const destroy_strings[][3]; /* from zap.c */ static boolean FDECL(keep_saddle_with_steedcorpse, (unsigned, struct obj *, struct obj *)); +static boolean FDECL(mu_maybe_destroy_web, (struct monst *, BOOLEAN_P, + struct trap *)); static struct obj *FDECL(t_missile, (int, struct trap *)); static char *FDECL(trapnote, (struct trap *, BOOLEAN_P)); static int FDECL(steedintrap, (struct trap *, struct obj *)); @@ -805,7 +807,7 @@ struct obj *objchn, *saddle; /* monster or you go through and possibly destroy a web. return TRUE if could go through. */ -boolean +static boolean mu_maybe_destroy_web(mtmp, domsg, trap) struct monst *mtmp; boolean domsg; diff --git a/src/wizard.c b/src/wizard.c index e8dfa776a..a96281e27 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -17,6 +17,7 @@ static struct obj *FDECL(on_ground, (SHORT_P)); static boolean FDECL(you_have, (int)); static unsigned long FDECL(target_on, (int, struct monst *)); static unsigned long FDECL(strategy, (struct monst *)); +static void FDECL(choose_stairs, (xchar *, xchar *)); /* adding more neutral creatures will tend to reduce the number of monsters summoned by nasty(); adding more lawful creatures will reduce the number @@ -321,7 +322,7 @@ register struct monst *mtmp; return dstrat; } -void +static void choose_stairs(sx, sy) xchar *sx; xchar *sy;