]> granicus.if.org Git - nethack/commitdiff
Pacify some clang compile warnings
authorPasi Kallinen <paxed@alt.org>
Sat, 21 Nov 2015 21:40:06 +0000 (23:40 +0200)
committerPasi Kallinen <paxed@alt.org>
Sat, 21 Nov 2015 21:40:06 +0000 (23:40 +0200)
include/extern.h
src/end.c
src/hack.c
src/mapglyph.c
src/mkobj.c
src/mon.c
src/options.c

index 2b96c74e86b9d685c4ac2cf25a0dc21d2d7b38a0..660fa416386103e1787eb5251d5f003be62c9955 100644 (file)
@@ -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);
index 111766f44237d9f736a6c4e3c18e825b36ccceca..324e0a4407594a2863ad3275de21fec7d05bdcf5 100644 (file)
--- 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));
index c39cbb63346b55e00e3eae901a3e0de483e2d05f..187c1a9bb93ec443317b1c5d0ab2d4c8da85806a 100644 (file)
@@ -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));
index d3e72d79015a7790bffb928b7ef7203436c13f6c..640d0af62507b8c110a55456c9086ebde14ae170 100644 (file)
@@ -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   */
index 6b56739a22dada6deaddd6e2439bc86fe3c41ae1..9a10231171be149c3f5a8408371c958e7ec7504d 100644 (file)
@@ -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()
index 5d476118f954b2e63d5c5fcd09d995aa36faba39..8116d787773ab7af3ea6d2fb05c983dcaf7bef03 100644 (file)
--- 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)
index 91a9700b33ee34b4050254e418c9a2d02e02fbcc..82f1011e4f4ca6e713db9fbc3d868ee59103d9bf 100644 (file)
@@ -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;