analyzer lint for zap.c

This commit is contained in:
PatR
2025-01-19 11:42:02 -08:00
parent 49a2851882
commit 047ae6f68e

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 zap.c $NHDT-Date: 1732979463 2024/11/30 07:11:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.551 $ */
/* NetHack 3.7 zap.c $NHDT-Date: 1737344505 2025/01/19 19:41:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.562 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2076,6 +2076,7 @@ stone_to_flesh_obj(struct obj *obj) /* nonnull */
res = 0;
break;
}
nhUse(obj); /* avoid 'assigned value not used' for poly_obj() calls */
if (smell) {
/* non-meat eaters smell meat, meat eaters smell its flavor;
@@ -3215,7 +3216,7 @@ zap_updown(struct obj *obj) /* wand or spell, nonnull */
we need to call it before probing for buried objects */
ltyp = SURFACE_AT(x, y);
zap_map(x, y, obj);
map_zapped = TRUE;
/*map_zapped = TRUE; // not needed due to early return*/
if (ltyp == ICE || IS_FURNITURE(ltyp)) {
surf = "it";
if (svl.lastseentyp[x][y] != rememberedltyp)
@@ -3872,7 +3873,8 @@ bhit(
&& hits_bars(pobj, x - ddx, y - ddy, x, y,
point_blank ? 0 : !rn2(5), 1)) {
/* caveat: obj might now be null... */
obj = *pobj;
obj = *pobj; /* not currently needed due to 'break'; keep */
nhUse(obj); /* in case usage gets added after the loop */
gb.bhitpos.x -= ddx;
gb.bhitpos.y -= ddy;
break;