From: Pasi Kallinen Date: Sat, 21 Nov 2015 21:40:06 +0000 (+0200) Subject: Pacify some clang compile warnings X-Git-Tag: NetHack-3.6.0_RC01~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7063488621e00c66d2d24ee07b7cff28f9b265d1;p=nethack Pacify some clang compile warnings --- diff --git a/include/extern.h b/include/extern.h index 2b96c74e8..660fa4163 100644 --- a/include/extern.h +++ b/include/extern.h @@ -797,6 +797,9 @@ E boolean FDECL(bad_rock, (struct permonst *, XCHAR_P, XCHAR_P)); E int FDECL(cant_squeeze_thru, (struct monst *)); E boolean FDECL(invocation_pos, (XCHAR_P, XCHAR_P)); E boolean FDECL(test_move, (int, int, int, int, int)); +#ifdef DEBUG +E int NDECL(wiz_debug_cmd_traveldisplay); +#endif E boolean NDECL(u_rooted); E void NDECL(domove); E boolean NDECL(overexertion); diff --git a/src/end.c b/src/end.c index 111766f44..324e0a440 100644 --- a/src/end.c +++ b/src/end.c @@ -52,6 +52,7 @@ STATIC_DCL void FDECL(savelife, (int)); STATIC_DCL void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P)); STATIC_DCL void FDECL(list_genocided, (CHAR_P, BOOLEAN_P)); STATIC_DCL boolean FDECL(should_query_disclose_option, (int, char *)); +STATIC_DCL int NDECL(num_extinct); #if defined(__BEOS__) || defined(MICRO) || defined(WIN32) || defined(OS2) extern void FDECL(nethack_exit, (int)); diff --git a/src/hack.c b/src/hack.c index c39cbb633..187c1a9bb 100644 --- a/src/hack.c +++ b/src/hack.c @@ -843,8 +843,8 @@ int mode; #ifdef DEBUG static boolean trav_debug = FALSE; -int wiz_debug_cmd_traveldisplay() /* in this case, toggle display of travel - debug info */ +/* in this case, toggle display of travel debug info */ +int wiz_debug_cmd_traveldisplay() { trav_debug = !trav_debug; return 0; @@ -1207,8 +1207,9 @@ domove() struct trap *trap = NULL; int wtcap; boolean on_ice; - xchar chainx, chainy, ballx, bally; /* ball&chain new positions */ - int bc_control; /* control for ball&chain */ + xchar chainx = 0, chainy = 0, + ballx = 0, bally = 0; /* ball&chain new positions */ + int bc_control = 0; /* control for ball&chain */ boolean cause_delay = FALSE; /* dragging ball will skip a move */ u_wipe_engr(rnd(5)); diff --git a/src/mapglyph.c b/src/mapglyph.c index d3e72d790..640d0af62 100644 --- a/src/mapglyph.c +++ b/src/mapglyph.c @@ -9,7 +9,7 @@ #include "color.h" #define HI_DOMESTIC CLR_WHITE /* monst.c */ -int explcolors[] = { +static int explcolors[] = { CLR_BLACK, /* dark */ CLR_GREEN, /* noxious */ CLR_BROWN, /* muddy */ diff --git a/src/mkobj.c b/src/mkobj.c index 6b56739a2..9a1023117 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -23,46 +23,46 @@ struct icp { char iclass; /* item class */ }; -const struct icp mkobjprobs[] = { { 10, WEAPON_CLASS }, - { 10, ARMOR_CLASS }, - { 20, FOOD_CLASS }, - { 8, TOOL_CLASS }, - { 8, GEM_CLASS }, - { 16, POTION_CLASS }, - { 16, SCROLL_CLASS }, - { 4, SPBOOK_CLASS }, - { 4, WAND_CLASS }, - { 3, RING_CLASS }, - { 1, AMULET_CLASS } }; - -const struct icp boxiprobs[] = { { 18, GEM_CLASS }, - { 15, FOOD_CLASS }, - { 18, POTION_CLASS }, - { 18, SCROLL_CLASS }, - { 12, SPBOOK_CLASS }, - { 7, COIN_CLASS }, - { 6, WAND_CLASS }, - { 5, RING_CLASS }, - { 1, AMULET_CLASS } }; - -const struct icp rogueprobs[] = { { 12, WEAPON_CLASS }, - { 12, ARMOR_CLASS }, - { 22, FOOD_CLASS }, - { 22, POTION_CLASS }, - { 22, SCROLL_CLASS }, - { 5, WAND_CLASS }, - { 5, RING_CLASS } }; - -const struct icp hellprobs[] = { { 20, WEAPON_CLASS }, - { 20, ARMOR_CLASS }, - { 16, FOOD_CLASS }, - { 12, TOOL_CLASS }, - { 10, GEM_CLASS }, - { 1, POTION_CLASS }, - { 1, SCROLL_CLASS }, - { 8, WAND_CLASS }, - { 8, RING_CLASS }, - { 4, AMULET_CLASS } }; +static const struct icp mkobjprobs[] = { { 10, WEAPON_CLASS }, + { 10, ARMOR_CLASS }, + { 20, FOOD_CLASS }, + { 8, TOOL_CLASS }, + { 8, GEM_CLASS }, + { 16, POTION_CLASS }, + { 16, SCROLL_CLASS }, + { 4, SPBOOK_CLASS }, + { 4, WAND_CLASS }, + { 3, RING_CLASS }, + { 1, AMULET_CLASS } }; + +static const struct icp boxiprobs[] = { { 18, GEM_CLASS }, + { 15, FOOD_CLASS }, + { 18, POTION_CLASS }, + { 18, SCROLL_CLASS }, + { 12, SPBOOK_CLASS }, + { 7, COIN_CLASS }, + { 6, WAND_CLASS }, + { 5, RING_CLASS }, + { 1, AMULET_CLASS } }; + +static const struct icp rogueprobs[] = { { 12, WEAPON_CLASS }, + { 12, ARMOR_CLASS }, + { 22, FOOD_CLASS }, + { 22, POTION_CLASS }, + { 22, SCROLL_CLASS }, + { 5, WAND_CLASS }, + { 5, RING_CLASS } }; + +static const struct icp hellprobs[] = { { 20, WEAPON_CLASS }, + { 20, ARMOR_CLASS }, + { 16, FOOD_CLASS }, + { 12, TOOL_CLASS }, + { 10, GEM_CLASS }, + { 1, POTION_CLASS }, + { 1, SCROLL_CLASS }, + { 8, WAND_CLASS }, + { 8, RING_CLASS }, + { 4, AMULET_CLASS } }; struct oextra * newoextra() diff --git a/src/mon.c b/src/mon.c index 5d476118f..8116d7877 100644 --- a/src/mon.c +++ b/src/mon.c @@ -13,6 +13,7 @@ STATIC_VAR boolean vamp_rise_msg; +STATIC_DCL void FDECL(sanity_check_single_mon, (struct monst *, const char *)); STATIC_DCL boolean FDECL(restrap, (struct monst *)); STATIC_DCL long FDECL(mm_aggression, (struct monst *, struct monst *)); STATIC_DCL long FDECL(mm_displacement, (struct monst *, struct monst *)); @@ -2725,8 +2726,8 @@ struct monst *mon; } } -short *animal_list = 0; /* list of PM values for animal monsters */ -int animal_list_count; +static short *animal_list = 0; /* list of PM values for animal monsters */ +static int animal_list_count; void mon_animal_list(construct) diff --git a/src/options.c b/src/options.c index 91a9700b3..82f1011e4 100644 --- a/src/options.c +++ b/src/options.c @@ -512,9 +512,14 @@ STATIC_DCL const char *FDECL(attr2attrname, (int)); STATIC_DCL int NDECL(query_color); STATIC_DCL int NDECL(query_msgtype); STATIC_DCL int FDECL(query_attr, (const char *)); +STATIC_DCL const char * FDECL(msgtype2name, (int)); +STATIC_DCL boolean FDECL(msgtype_add, (int, char *)); +STATIC_DCL void FDECL(free_one_msgtype, (int)); +STATIC_DCL int NDECL(msgtype_count); STATIC_DCL boolean FDECL(add_menu_coloring_parsed, (char *, int, int)); STATIC_DCL void FDECL(free_one_menu_coloring, (int)); STATIC_DCL int NDECL(count_menucolors); +STATIC_DCL int FDECL(handle_add_list_remove, (char *, int)); void reglyph_darkroom() @@ -3492,7 +3497,7 @@ int doset() { char buf[BUFSZ], buf2[BUFSZ]; - int i, pass, boolcount, pick_cnt, pick_idx, opt_indx; + int i = 0, pass, boolcount, pick_cnt, pick_idx, opt_indx; boolean *bool_p; winid tmpwin; anything any;