From: Pasi Kallinen Date: Tue, 21 Jun 2016 11:14:54 +0000 (+0300) Subject: Silence some compiler warnings X-Git-Tag: NetHack-3.6.1_RC01~658 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d015cbec157fa913e58e67f29e55b0805de2df53;p=nethack Silence some compiler warnings --- diff --git a/include/mondata.h b/include/mondata.h index fa7aa9006..229617782 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -194,7 +194,7 @@ || ((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]))) diff --git a/src/mhitm.c b/src/mhitm.c index 2f734978f..6f9281960 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -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 */ diff --git a/src/mhitu.c b/src/mhitu.c index 0be49f42e..e07718fda 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -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 */