Fix even more warnings

This commit is contained in:
Pasi Kallinen
2020-04-06 13:34:07 +03:00
parent 99519c4e5b
commit e215f09ddb
17 changed files with 109 additions and 109 deletions
+11
View File
@@ -631,6 +631,17 @@ struct role_filter {
short mask; short mask;
}; };
/* read.c, create_particular() & create_particular_parse() */
struct _create_particular_data {
int quan;
int which;
int fem;
char monclass;
boolean randmonst;
boolean maketame, makepeaceful, makehostile;
boolean sleeping, saddled, invisible, hidden;
};
/* instance_globals holds engine state that does not need to be /* instance_globals holds engine state that does not need to be
* persisted upon game exit. The initialization state is well defined * persisted upon game exit. The initialization state is well defined
* an set in decl.c during early early engine initialization. * an set in decl.c during early early engine initialization.
+1
View File
@@ -2492,6 +2492,7 @@ E boolean FDECL(load_special, (const char *));
E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *)); E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
E struct selectionvar *NDECL(selection_new); E struct selectionvar *NDECL(selection_new);
E void FDECL(selection_free, (struct selectionvar *, BOOLEAN_P)); E void FDECL(selection_free, (struct selectionvar *, BOOLEAN_P));
E struct selectionvar *FDECL(selection_clone, (struct selectionvar *));
E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int)))); E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int))));
E void FDECL(selection_floodfill, (struct selectionvar *, int, int, E void FDECL(selection_floodfill, (struct selectionvar *, int, int,
BOOLEAN_P)); BOOLEAN_P));
+1
View File
@@ -49,6 +49,7 @@ static int FDECL(possible_places, (int, boolean *,
struct proto_dungeon *)); struct proto_dungeon *));
static xchar FDECL(pick_level, (boolean *, int)); static xchar FDECL(pick_level, (boolean *, int));
static boolean FDECL(place_level, (int, struct proto_dungeon *)); static boolean FDECL(place_level, (int, struct proto_dungeon *));
static int FDECL(get_dgn_flags, (lua_State *));
static boolean FDECL(unplaced_floater, (struct dungeon *)); static boolean FDECL(unplaced_floater, (struct dungeon *));
static boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P)); static boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P));
static void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *, static void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *,
+6 -3
View File
@@ -127,6 +127,8 @@ extern char *sounddir;
#define SELECTSAVED #define SELECTSAVED
#endif #endif
static NHFILE *NDECL(new_nhfile);
static void FDECL(free_nhfile, (NHFILE *));
#ifdef SELECTSAVED #ifdef SELECTSAVED
static int FDECL(CFDECLSPEC strcmp_wrap, (const void *, const void *)); static int FDECL(CFDECLSPEC strcmp_wrap, (const void *, const void *));
#endif #endif
@@ -163,6 +165,7 @@ static void NDECL(free_config_sections);
static char *FDECL(choose_random_part, (char *, CHAR_P)); static char *FDECL(choose_random_part, (char *, CHAR_P));
static boolean FDECL(is_config_section, (const char *)); static boolean FDECL(is_config_section, (const char *));
static boolean FDECL(handle_config_section, (char *)); static boolean FDECL(handle_config_section, (char *));
static char *FDECL(find_optparam, (const char *));
static void FDECL(parseformat, (int *, char *)); static void FDECL(parseformat, (int *, char *));
#ifdef SELF_RECOVER #ifdef SELF_RECOVER
@@ -422,7 +425,7 @@ NHFILE *nhfp;
} }
} }
NHFILE * static NHFILE *
new_nhfile() new_nhfile()
{ {
NHFILE *nhfp = (NHFILE *)alloc(sizeof(NHFILE)); NHFILE *nhfp = (NHFILE *)alloc(sizeof(NHFILE));
@@ -431,7 +434,7 @@ new_nhfile()
return nhfp; return nhfp;
} }
void static void
free_nhfile(nhfp) free_nhfile(nhfp)
NHFILE *nhfp; NHFILE *nhfp;
{ {
@@ -2407,7 +2410,7 @@ char *buf;
#define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE) #define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE)
/* find the '=' or ':' */ /* find the '=' or ':' */
char * static char *
find_optparam(buf) find_optparam(buf)
const char *buf; const char *buf;
{ {
+2 -1
View File
@@ -16,6 +16,7 @@ static boolean FDECL(trapmove, (int, int, struct trap *));
static struct monst *FDECL(monstinroom, (struct permonst *, int)); static struct monst *FDECL(monstinroom, (struct permonst *, int));
static boolean FDECL(doorless_door, (int, int)); static boolean FDECL(doorless_door, (int, int));
static void FDECL(move_update, (BOOLEAN_P)); static void FDECL(move_update, (BOOLEAN_P));
static int NDECL(pickup_checks);
static void FDECL(maybe_smudge_engr, (int, int, int, int)); static void FDECL(maybe_smudge_engr, (int, int, int, int));
static void NDECL(domove_core); static void NDECL(domove_core);
@@ -2620,7 +2621,7 @@ boolean newlev;
0 = cannot pickup, no time taken 0 = cannot pickup, no time taken
-1 = do normal pickup -1 = do normal pickup
-2 = loot the monster */ -2 = loot the monster */
int static int
pickup_checks() pickup_checks()
{ {
/* uswallow case added by GAN 01/29/87 */ /* uswallow case added by GAN 01/29/87 */
+10 -5
View File
@@ -10,6 +10,7 @@ static int FDECL(iswall, (int, int));
static int FDECL(iswall_or_stone, (int, int)); static int FDECL(iswall_or_stone, (int, int));
static boolean FDECL(is_solid, (int, int)); static boolean FDECL(is_solid, (int, int));
static int FDECL(extend_spine, (int[3][3], int, int, int)); static int FDECL(extend_spine, (int[3][3], int, int, int));
static void FDECL(wall_cleanup, (int, int, int, int));
static boolean FDECL(okay, (int, int, int)); static boolean FDECL(okay, (int, int, int));
static void FDECL(maze0xy, (coord *)); static void FDECL(maze0xy, (coord *));
static boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P, static boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P,
@@ -21,7 +22,11 @@ static void NDECL(unsetup_waterlevel);
static void FDECL(check_ransacked, (char *)); static void FDECL(check_ransacked, (char *));
static void FDECL(migr_booty_item, (int, const char *)); static void FDECL(migr_booty_item, (int, const char *));
static void FDECL(migrate_orc, (struct monst *, unsigned long)); static void FDECL(migrate_orc, (struct monst *, unsigned long));
static void FDECL(shiny_orc_stuff, (struct monst *));
static void NDECL(stolen_booty); static void NDECL(stolen_booty);
static boolean FDECL(maze_inbounds, (int, int));
static void FDECL(maze_remove_deadends, (XCHAR_P));
static void FDECL(create_maze, (int, int));
/* adjust a coordinate one step in the specified direction */ /* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \ #define mz_move(X, Y, dir) \
@@ -119,7 +124,7 @@ int wall_there, dx, dy;
} }
/* Remove walls totally surrounded by stone */ /* Remove walls totally surrounded by stone */
void static void
wall_cleanup(x1, y1, x2, y2) wall_cleanup(x1, y1, x2, y2)
int x1, y1, x2, y2; int x1, y1, x2, y2;
{ {
@@ -635,7 +640,7 @@ unsigned long mflags;
migrate_to_level(mtmp, ledger_no(&dest), MIGR_RANDOM, (coord *) 0); migrate_to_level(mtmp, ledger_no(&dest), MIGR_RANDOM, (coord *) 0);
} }
void static void
shiny_orc_stuff(mtmp) shiny_orc_stuff(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
@@ -782,7 +787,7 @@ stolen_booty(VOID_ARGS)
#undef ORC_LEADER #undef ORC_LEADER
boolean static boolean
maze_inbounds(x, y) maze_inbounds(x, y)
int x, y; int x, y;
{ {
@@ -790,7 +795,7 @@ int x, y;
&& x < g.x_maze_max && y < g.y_maze_max && isok(x, y)); && x < g.x_maze_max && y < g.y_maze_max && isok(x, y));
} }
void static void
maze_remove_deadends(typ) maze_remove_deadends(typ)
xchar typ; xchar typ;
{ {
@@ -837,7 +842,7 @@ xchar typ;
/* Create a maze with specified corridor width and wall thickness /* Create a maze with specified corridor width and wall thickness
* TODO: rewrite walkfrom so it works on temp space, not levl * TODO: rewrite walkfrom so it works on temp space, not levl
*/ */
void static void
create_maze(corrwid, wallthick) create_maze(corrwid, wallthick)
int corrwid; int corrwid;
int wallthick; int wallthick;
+2 -1
View File
@@ -20,6 +20,7 @@
static boolean FDECL(isbig, (struct mkroom *)); static boolean FDECL(isbig, (struct mkroom *));
static struct mkroom *FDECL(pick_room, (BOOLEAN_P)); static struct mkroom *FDECL(pick_room, (BOOLEAN_P));
static void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp); static void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp);
static void FDECL(mk_zoo_thronemon, (int, int));
static void NDECL(mktemple); static void NDECL(mktemple);
static coord *FDECL(shrine_pos, (int)); static coord *FDECL(shrine_pos, (int));
static struct permonst *NDECL(morguemon); static struct permonst *NDECL(morguemon);
@@ -240,7 +241,7 @@ int type;
} }
} }
void static void
mk_zoo_thronemon(x,y) mk_zoo_thronemon(x,y)
int x,y; int x,y;
{ {
+2 -1
View File
@@ -34,6 +34,7 @@ static void FDECL(charm_snakes, (int));
static void FDECL(calm_nymphs, (int)); static void FDECL(calm_nymphs, (int));
static void FDECL(charm_monsters, (int)); static void FDECL(charm_monsters, (int));
static void FDECL(do_earthquake, (int)); static void FDECL(do_earthquake, (int));
static const char *NDECL(generic_lvl_desc);
static int FDECL(do_improvisation, (struct obj *)); static int FDECL(do_improvisation, (struct obj *));
/* /*
@@ -463,7 +464,7 @@ int force;
} }
} }
const char * static const char *
generic_lvl_desc() generic_lvl_desc()
{ {
if (Is_astralevel(&u.uz)) if (Is_astralevel(&u.uz))
+7 -6
View File
@@ -5,6 +5,12 @@
#include "hack.h" #include "hack.h"
#include "sp_lev.h" #include "sp_lev.h"
struct _lua_obj {
int state; /* UNUSED */
struct obj *obj;
};
static struct _lua_obj *FDECL(l_obj_check, (lua_State *, int));
static int FDECL(l_obj_add_to_container, (lua_State *)); static int FDECL(l_obj_add_to_container, (lua_State *));
static int FDECL(l_obj_gc, (lua_State *)); static int FDECL(l_obj_gc, (lua_State *));
static int FDECL(l_obj_getcontents, (lua_State *)); static int FDECL(l_obj_getcontents, (lua_State *));
@@ -17,14 +23,9 @@ static int FDECL(l_obj_to_table, (lua_State *));
static int FDECL(l_obj_at, (lua_State *)); static int FDECL(l_obj_at, (lua_State *));
static int FDECL(l_obj_container, (lua_State *)); static int FDECL(l_obj_container, (lua_State *));
struct _lua_obj {
int state; /* UNUSED */
struct obj *obj;
};
#define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE) #define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE)
struct _lua_obj * static struct _lua_obj *
l_obj_check(L, index) l_obj_check(L, index)
lua_State *L; lua_State *L;
int index; int index;
+8 -8
View File
@@ -146,7 +146,7 @@ lua_State *L;
schar x = -1, y = -1; schar x = -1, y = -1;
int val = 1; int val = 1;
int argc = lua_gettop(L); int argc = lua_gettop(L);
long coord = 0L; long crd = 0L;
if (argc == 0) { if (argc == 0) {
(void) l_selection_new(L); (void) l_selection_new(L);
@@ -172,11 +172,11 @@ lua_State *L;
} }
if (x == -1 && y == -1) if (x == -1 && y == -1)
coord = SP_COORD_PACK_RANDOM(0); crd = SP_COORD_PACK_RANDOM(0);
else else
coord = SP_COORD_PACK(x,y); crd = SP_COORD_PACK(x,y);
get_location_coord(&x, &y, ANY_LOC, get_location_coord(&x, &y, ANY_LOC,
g.coder ? g.coder->croom : NULL, coord); g.coder ? g.coder->croom : NULL, crd);
selection_setpoint(x, y, sel, val); selection_setpoint(x, y, sel, val);
lua_settop(L, 1); lua_settop(L, 1);
return 1; return 1;
@@ -191,13 +191,13 @@ lua_State *L;
schar x = (schar) luaL_checkinteger(L, 2); schar x = (schar) luaL_checkinteger(L, 2);
schar y = (schar) luaL_checkinteger(L, 3); schar y = (schar) luaL_checkinteger(L, 3);
int val; int val;
long coord; long crd;
if (x == -1 && y == -1) if (x == -1 && y == -1)
coord = SP_COORD_PACK_RANDOM(0); crd = SP_COORD_PACK_RANDOM(0);
else else
coord = SP_COORD_PACK(x,y); crd = SP_COORD_PACK(x,y);
get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, coord); get_location_coord(&x, &y, ANY_LOC, g.coder ? g.coder->croom : NULL, crd);
val = selection_getpoint(x, y, sel); val = selection_getpoint(x, y, sel);
lua_settop(L, 0); lua_settop(L, 0);
+11 -5
View File
@@ -16,6 +16,8 @@
/* lua_CFunction prototypes */ /* lua_CFunction prototypes */
static int FDECL(nhl_test, (lua_State *)); static int FDECL(nhl_test, (lua_State *));
static int FDECL(nhl_getmap, (lua_State *)); static int FDECL(nhl_getmap, (lua_State *));
static void FDECL(nhl_add_table_entry_bool, (lua_State *, const char *, BOOLEAN_P));
static char FDECL(splev_typ2chr, (SCHAR_P));
static int FDECL(nhl_gettrap, (lua_State *)); static int FDECL(nhl_gettrap, (lua_State *));
static int FDECL(nhl_deltrap, (lua_State *)); static int FDECL(nhl_deltrap, (lua_State *));
#if 0 #if 0
@@ -32,10 +34,14 @@ static int FDECL(nhl_ing_suffix, (lua_State *));
static int FDECL(nhl_an, (lua_State *)); static int FDECL(nhl_an, (lua_State *));
static int FDECL(nhl_rn2, (lua_State *)); static int FDECL(nhl_rn2, (lua_State *));
static int FDECL(nhl_random, (lua_State *)); static int FDECL(nhl_random, (lua_State *));
static void FDECL(init_nhc_data, (lua_State *));
static int FDECL(nhl_push_anything, (lua_State *, int, void *));
static int FDECL(nhl_meta_u_index, (lua_State *)); static int FDECL(nhl_meta_u_index, (lua_State *));
static int FDECL(nhl_meta_u_newindex, (lua_State *)); static int FDECL(nhl_meta_u_newindex, (lua_State *));
static int FDECL(nhl_u_clear_inventory, (lua_State *)); static int FDECL(nhl_u_clear_inventory, (lua_State *));
static int FDECL(nhl_u_giveobj, (lua_State *)); static int FDECL(nhl_u_giveobj, (lua_State *));
static void FDECL(init_u_data, (lua_State *));
static int FDECL(nhl_set_package_path, (lua_State *, const char *));
static int FDECL(traceback_handler, (lua_State *)); static int FDECL(traceback_handler, (lua_State *));
void void
@@ -224,7 +230,7 @@ const char *s;
return INVALID_TYPE; return INVALID_TYPE;
} }
char static char
splev_typ2chr(typ) splev_typ2chr(typ)
schar typ; schar typ;
{ {
@@ -837,7 +843,7 @@ static const struct {
}; };
/* register and init the constants table */ /* register and init the constants table */
void static void
init_nhc_data(L) init_nhc_data(L)
lua_State *L; lua_State *L;
{ {
@@ -854,7 +860,7 @@ lua_State *L;
lua_setglobal(L, "nhc"); lua_setglobal(L, "nhc");
} }
int static int
nhl_push_anything(L, anytype, src) nhl_push_anything(L, anytype, src)
lua_State *L; lua_State *L;
int anytype; int anytype;
@@ -960,7 +966,7 @@ static const struct luaL_Reg nhl_u_functions[] = {
{ NULL, NULL } { NULL, NULL }
}; };
void static void
init_u_data(L) init_u_data(L)
lua_State *L; lua_State *L;
{ {
@@ -975,7 +981,7 @@ lua_State *L;
lua_setglobal(L, "u"); lua_setglobal(L, "u");
} }
int static int
nhl_set_package_path(L, path) nhl_set_package_path(L, path)
lua_State *L; lua_State *L;
const char *path; const char *path;
+2 -1
View File
@@ -2531,7 +2531,8 @@ char *op;
return optn_ok; return optn_ok;
} }
int optfn_paranoid_confirmation(optidx, req, negated, opts, op) int
optfn_paranoid_confirmation(optidx, req, negated, opts, op)
int optidx; int optidx;
int req; int req;
boolean negated; boolean negated;
+2 -1
View File
@@ -32,6 +32,7 @@ static void NDECL(hmenu_dohistory);
static void NDECL(hmenu_dowhatis); static void NDECL(hmenu_dowhatis);
static void NDECL(hmenu_dowhatdoes); static void NDECL(hmenu_dowhatdoes);
static void NDECL(hmenu_doextlist); static void NDECL(hmenu_doextlist);
static void NDECL(domenucontrols);
#ifdef PORT_HELP #ifdef PORT_HELP
extern void NDECL(port_help); extern void NDECL(port_help);
#endif #endif
@@ -2068,7 +2069,7 @@ hmenu_doextlist(VOID_ARGS)
(void) doextlist(); (void) doextlist();
} }
void static void
domenucontrols(VOID_ARGS) domenucontrols(VOID_ARGS)
{ {
winid cwin = create_nhwindow(NHW_TEXT); winid cwin = create_nhwindow(NHW_TEXT);
+2 -1
View File
@@ -24,6 +24,7 @@ static void FDECL(convert_line, (char *,char *));
static void FDECL(deliver_by_pline, (const char *)); static void FDECL(deliver_by_pline, (const char *));
static void FDECL(deliver_by_window, (const char *, int)); static void FDECL(deliver_by_window, (const char *, int));
static boolean FDECL(skip_pager, (BOOLEAN_P)); static boolean FDECL(skip_pager, (BOOLEAN_P));
static boolean FDECL(com_pager_core, (const char *, const char *, BOOLEAN_P));
short short
quest_info(typ) quest_info(typ)
@@ -431,7 +432,7 @@ boolean common UNUSED;
return FALSE; return FALSE;
} }
boolean static boolean
com_pager_core(section, msgid, showerror) com_pager_core(section, msgid, showerror)
const char *section; const char *section;
const char *msgid; const char *msgid;
+5 -13
View File
@@ -18,7 +18,7 @@ static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
static boolean FDECL(learnscrolltyp, (SHORT_P)); static boolean FDECL(learnscrolltyp, (SHORT_P));
static char *FDECL(erode_obj_text, (struct obj *, char *)); static char *FDECL(erode_obj_text, (struct obj *, char *));
static char *FDECL(apron_text, (struct obj *, char *buf)); static char *FDECL(apron_text, (struct obj *, char *));
static void FDECL(stripspe, (struct obj *)); static void FDECL(stripspe, (struct obj *));
static void FDECL(p_glow1, (struct obj *)); static void FDECL(p_glow1, (struct obj *));
static void FDECL(p_glow2, (struct obj *, const char *)); static void FDECL(p_glow2, (struct obj *, const char *));
@@ -29,6 +29,8 @@ static boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P));
static void FDECL(display_stinking_cloud_positions, (int)); static void FDECL(display_stinking_cloud_positions, (int));
static void FDECL(set_lit, (int, int, genericptr)); static void FDECL(set_lit, (int, int, genericptr));
static void NDECL(do_class_genocide); static void NDECL(do_class_genocide);
static boolean FDECL(create_particular_parse, (char *, struct _create_particular_data *));
static boolean FDECL(create_particular_creation, (struct _create_particular_data *));
static boolean static boolean
learnscrolltyp(scrolltyp) learnscrolltyp(scrolltyp)
@@ -2269,17 +2271,7 @@ struct obj *from_obj;
return FALSE; return FALSE;
} }
struct _create_particular_data { static boolean
int quan;
int which;
int fem;
char monclass;
boolean randmonst;
boolean maketame, makepeaceful, makehostile;
boolean sleeping, saddled, invisible, hidden;
};
boolean
create_particular_parse(str, d) create_particular_parse(str, d)
char *str; char *str;
struct _create_particular_data *d; struct _create_particular_data *d;
@@ -2376,7 +2368,7 @@ struct _create_particular_data *d;
return FALSE; return FALSE;
} }
boolean static boolean
create_particular_creation(d) create_particular_creation(d)
struct _create_particular_data *d; struct _create_particular_data *d;
{ {
+2
View File
@@ -7,6 +7,8 @@
#ifdef USE_ISAAC64 #ifdef USE_ISAAC64
#include "isaac64.h" #include "isaac64.h"
static int FDECL(whichrng, (int FDECL((*fn), (int))));
#if 0 #if 0
static isaac64_ctx rng_state; static isaac64_ctx rng_state;
#endif #endif
+35 -63
View File
@@ -32,6 +32,7 @@ static void FDECL(flip_drawbridge_horizontal, (struct rm *));
static void FDECL(flip_drawbridge_vertical, (struct rm *)); static void FDECL(flip_drawbridge_vertical, (struct rm *));
static void FDECL(flip_visuals, (int, int, int, int, int)); static void FDECL(flip_visuals, (int, int, int, int, int));
static int FDECL(flip_encoded_direction_bits, (int, int)); static int FDECL(flip_encoded_direction_bits, (int, int));
static void FDECL(sel_set_wall_property, (int, int, genericptr_t));
static void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, static void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
int)); int));
static void NDECL(count_features); static void NDECL(count_features);
@@ -96,6 +97,7 @@ 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_door, (int, int, genericptr_t));
static void FDECL(sel_set_feature, (int, int, genericptr_t)); static void FDECL(sel_set_feature, (int, int, genericptr_t));
static int FDECL(get_coord, (lua_State *, int, int *, int *)); static int FDECL(get_coord, (lua_State *, int, int *, int *));
static void FDECL(levregion_add, (lev_region *));
static void FDECL(get_table_xy_or_coord, (lua_State *, int *, int *)); static void FDECL(get_table_xy_or_coord, (lua_State *, int *, int *));
static int FDECL(get_table_region, (lua_State *, const char *, static int FDECL(get_table_region, (lua_State *, const char *,
int *, int *, int *, int *, BOOLEAN_P)); int *, int *, int *, int *, BOOLEAN_P));
@@ -103,6 +105,20 @@ static void FDECL(set_wallprop_in_selection, (lua_State *, int));
static int FDECL(floodfillchk_match_under, (int, int)); static int FDECL(floodfillchk_match_under, (int, int));
static int FDECL(floodfillchk_match_accessible, (int, int)); static int FDECL(floodfillchk_match_accessible, (int, int));
static void FDECL(l_push_wid_hei_table, (lua_State *, int, int)); static void FDECL(l_push_wid_hei_table, (lua_State *, int, int));
static int FDECL(get_table_align, (lua_State *));
static int FDECL(get_table_monclass, (lua_State *));
static int FDECL(find_montype, (lua_State *, const char *));
static int FDECL(get_table_montype, (lua_State *));
static int FDECL(get_table_int_or_random, (lua_State *, const char *, int));
static int FDECL(get_table_buc, (lua_State *));
static int FDECL(get_table_objclass, (lua_State *));
static int FDECL(find_objtype, (lua_State *, const char *));
static int FDECL(get_table_objtype, (lua_State *));
static int FDECL(get_table_roomtype_opt, (lua_State *, const char *, int));
static int FDECL(get_table_traptype_opt, (lua_State *, const char *, int));
static int FDECL(get_traptype_byname, (const char *));
static int FDECL(get_table_intarray_entry, (lua_State *, int, int));
static struct sp_coder *NDECL(sp_level_coder_init);
/* lua_CFunction prototypes */ /* lua_CFunction prototypes */
int FDECL(lspo_altar, (lua_State *)); int FDECL(lspo_altar, (lua_State *));
@@ -842,7 +858,7 @@ boolean extras;
} }
void static void
sel_set_wall_property(x, y, arg) sel_set_wall_property(x, y, arg)
int x, y; int x, y;
genericptr_t arg; genericptr_t arg;
@@ -2985,7 +3001,7 @@ lua_State *L;
return 0; /* number of results */ return 0; /* number of results */
} }
int static int
get_table_align(L) get_table_align(L)
lua_State *L; lua_State *L;
{ {
@@ -3003,7 +3019,7 @@ lua_State *L;
return a; return a;
} }
int static int
get_table_monclass(L) get_table_monclass(L)
lua_State *L; lua_State *L;
{ {
@@ -3016,7 +3032,7 @@ lua_State *L;
return ret; return ret;
} }
int static int
find_montype(L, s) find_montype(L, s)
lua_State *L; lua_State *L;
const char *s; const char *s;
@@ -3030,7 +3046,7 @@ const char *s;
return NON_PM; return NON_PM;
} }
int static int
get_table_montype(L) get_table_montype(L)
lua_State *L; lua_State *L;
{ {
@@ -3212,7 +3228,7 @@ lua_State *L;
/* the hash key 'name' is an integer or "random", /* the hash key 'name' is an integer or "random",
or if not existent, also return rndval. or if not existent, also return rndval.
*/ */
int static int
get_table_int_or_random(L, name, rndval) get_table_int_or_random(L, name, rndval)
lua_State *L; lua_State *L;
const char *name; const char *name;
@@ -3244,7 +3260,7 @@ int rndval;
return ret; return ret;
} }
int static int
get_table_buc(L) get_table_buc(L)
lua_State *L; lua_State *L;
{ {
@@ -3258,7 +3274,7 @@ lua_State *L;
return curse_state; return curse_state;
} }
int static int
get_table_objclass(L) get_table_objclass(L)
lua_State *L; lua_State *L;
{ {
@@ -3271,7 +3287,7 @@ lua_State *L;
return ret; return ret;
} }
int static int
find_objtype(L, s) find_objtype(L, s)
lua_State *L; lua_State *L;
const char *s; const char *s;
@@ -3311,7 +3327,7 @@ const char *s;
return STRANGE_OBJECT; return STRANGE_OBJECT;
} }
int static int
get_table_objtype(L) get_table_objtype(L)
lua_State *L; lua_State *L;
{ {
@@ -3695,7 +3711,7 @@ static const struct {
{ 0, 0 } { 0, 0 }
}; };
int static int
get_table_roomtype_opt(L, name, defval) get_table_roomtype_opt(L, name, defval)
lua_State *L; lua_State *L;
const char *name; const char *name;
@@ -3962,7 +3978,7 @@ lua_State *L;
int x, y; int x, y;
long acoord; long acoord;
int shrine; int shrine;
int align; int al;
create_des_coder(); create_des_coder();
@@ -3970,7 +3986,7 @@ lua_State *L;
get_table_xy_or_coord(L, &x, &y); get_table_xy_or_coord(L, &x, &y);
align = get_table_align(L); al = get_table_align(L);
shrine = shrines2i[get_table_option(L, "type", "altar", shrines)]; shrine = shrines2i[get_table_option(L, "type", "altar", shrines)];
if (x == -1 && y == -1) if (x == -1 && y == -1)
@@ -3979,7 +3995,7 @@ lua_State *L;
acoord = SP_COORD_PACK(x, y); acoord = SP_COORD_PACK(x, y);
tmpaltar.coord = acoord; tmpaltar.coord = acoord;
tmpaltar.align = align; tmpaltar.align = al;
tmpaltar.shrine = shrine; tmpaltar.shrine = shrine;
create_altar(&tmpaltar, g.coder->croom); create_altar(&tmpaltar, g.coder->croom);
@@ -4016,7 +4032,7 @@ static const struct {
{ "random", -1 }, { "random", -1 },
{ 0, NO_TRAP } }; { 0, NO_TRAP } };
int static int
get_table_traptype_opt(L, name, defval) get_table_traptype_opt(L, name, defval)
lua_State *L; lua_State *L;
const char *name; const char *name;
@@ -4049,7 +4065,7 @@ int ttyp;
return NULL; return NULL;
} }
int static int
get_traptype_byname(trapname) get_traptype_byname(trapname)
const char *trapname; const char *trapname;
{ {
@@ -4299,38 +4315,6 @@ struct selectionvar *s;
return s; return s;
} }
struct selectionvar *
selection_logical_oper(s1, s2, oper)
struct selectionvar *s1, *s2;
char oper;
{
struct selectionvar *ov;
int x, y;
ov = selection_new();
if (!ov)
return NULL;
for (x = 0; x < ov->wid; x++)
for (y = 0; y < ov->hei; y++) {
switch (oper) {
default:
case '|':
if (selection_getpoint(x, y, s1)
|| selection_getpoint(x, y, s2))
selection_setpoint(x, y, ov, 1);
break;
case '&':
if (selection_getpoint(x, y, s1)
&& selection_getpoint(x, y, s2))
selection_setpoint(x, y, ov, 1);
break;
}
}
return ov;
}
struct selectionvar * struct selectionvar *
selection_filter_mapchar(ov, typ, lit) selection_filter_mapchar(ov, typ, lit)
struct selectionvar *ov; struct selectionvar *ov;
@@ -5350,7 +5334,7 @@ ensure_way_out()
selection_free(ov, TRUE); selection_free(ov, TRUE);
} }
int static int
get_table_intarray_entry(L, tableidx, entrynum) get_table_intarray_entry(L, tableidx, entrynum)
lua_State *L; lua_State *L;
int tableidx, entrynum; int tableidx, entrynum;
@@ -5433,7 +5417,7 @@ int *x, *y;
return 0; return 0;
} }
void static void
levregion_add(lregion) levregion_add(lregion)
lev_region *lregion; lev_region *lregion;
{ {
@@ -6009,8 +5993,6 @@ int
lspo_map(L) lspo_map(L)
lua_State *L; lua_State *L;
{ {
xchar tmpxstart, tmpystart, tmpxsize, tmpysize;
/* /*
TODO: allow passing an array of strings as map data TODO: allow passing an array of strings as map data
TODO: handle if map lines aren't same length TODO: handle if map lines aren't same length
@@ -6062,11 +6044,6 @@ TODO: g.coder->croom needs to be updated
return 0; return 0;
} }
tmpxsize = g.xsize;
tmpysize = g.ysize;
tmpxstart = g.xstart;
tmpystart = g.ystart;
g.xsize = mf->wid; g.xsize = mf->wid;
g.ysize = mf->hei; g.ysize = mf->hei;
@@ -6197,11 +6174,6 @@ TODO: g.coder->croom needs to be updated
lua_call(L, 1, 0); lua_call(L, 1, 0);
} }
tmpxsize = g.xsize;
tmpysize = g.ysize;
tmpxstart = g.xstart;
tmpystart = g.ystart;
return 0; return 0;
} }
@@ -6217,7 +6189,7 @@ update_croom()
g.coder->croom = NULL; g.coder->croom = NULL;
} }
struct sp_coder * static struct sp_coder *
sp_level_coder_init() sp_level_coder_init()
{ {
int tmpi; int tmpi;