warning suppression

Fix a couple of the clang static analyzer's warnings.

muse.c has some reformatting.  zap.c wasn't triggering any warning about
possible null pointer, but using MON_AT() to maybe avoid m_at() is not
a useful optimization since m_at() is a macro which starts out by using
MON_AT() itself.
This commit is contained in:
PatR
2015-11-19 18:49:50 -08:00
parent 7d23420314
commit a2a567737e
3 changed files with 44 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 zap.c $NHDT-Date: 1447475947 2015/11/14 04:39:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.235 $ */
/* NetHack 3.6 zap.c $NHDT-Date: 1447987787 2015/11/20 02:49:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.236 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3322,8 +3322,7 @@ int dx, dy;
dy = ydir[i];
bhitpos.x += dx;
bhitpos.y += dy;
if (MON_AT(bhitpos.x, bhitpos.y)) {
mtmp = m_at(bhitpos.x, bhitpos.y);
if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != 0) {
m_respond(mtmp);
tmp_at(DISP_END, 0);
return mtmp;