]> granicus.if.org Git - nethack/commitdiff
Silence some compiler warnings
authorPasi Kallinen <paxed@alt.org>
Tue, 21 Jun 2016 11:14:54 +0000 (14:14 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 21 Jun 2016 11:14:54 +0000 (14:14 +0300)
include/mondata.h
src/mhitm.c
src/mhitu.c

index fa7aa9006c964fe09fa1796b8de2cf60ccef8854..2296177821707bfd478ee278738d5bb2e7287d1a 100644 (file)
      || ((ptr)->mlet == S_PUDDING && (ptr) != &mons[PM_BLACK_PUDDING]))
 
 #define befriend_with_obj(ptr, obj) \
-    ((obj)->oclass == FOOD_CLASS && is_domestic(ptr)                    \
+    (((obj)->oclass == FOOD_CLASS && is_domestic(ptr))                  \
      || ((obj)->otyp == BANANA &&                                       \
          ((ptr) == &mons[PM_MONKEY]                                     \
           || (ptr) == &mons[PM_APE])))
index 2f734978ff95e01918e40b12bc121a6b0225cb66..6f9281960bc76692216687d39e0459ae48a4d411 100644 (file)
@@ -293,7 +293,7 @@ register struct monst *magr, *mdef;
 {
     int i,          /* loop counter */
         tmp,        /* amour class difference */
-        strike,     /* hit this attack */
+        strike = 0, /* hit this attack */
         attk,       /* attack attempted this time */
         struck = 0, /* hit at least once */
         res[NATTK]; /* results of all attacks */
index 0be49f42ed32588365f14059e58147ff15b922c8..e07718fdac7499b53e2250f4c3f987d78e29ad25 100644 (file)
@@ -349,7 +349,7 @@ mattacku(mtmp)
 register struct monst *mtmp;
 {
     struct attack *mattk, alt_attk;
-    int i, j, tmp, sum[NATTK];
+    int i, j = 0, tmp, sum[NATTK];
     struct permonst *mdat = mtmp->data;
     boolean ranged = (distu(mtmp->mx, mtmp->my) > 3);
     /* Is it near you?  Affects your actions */