summaryrefslogtreecommitdiffstats
path: root/hack/hack.dog.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2011-08-07 06:03:45 +0000
committerdholland <dholland@NetBSD.org>2011-08-07 06:03:45 +0000
commit04539cb235b06fd8cacf5c4c40081bd86e0dfa04 (patch)
tree0ce2c465383e0aecdf9d0d1192b34a137636b113 /hack/hack.dog.c
parent18451d9c4ce377951796a0ac6188ca7b1bf34335 (diff)
downloadbsdgames-darwin-04539cb235b06fd8cacf5c4c40081bd86e0dfa04.tar.gz
bsdgames-darwin-04539cb235b06fd8cacf5c4c40081bd86e0dfa04.tar.zst
bsdgames-darwin-04539cb235b06fd8cacf5c4c40081bd86e0dfa04.zip
Fix up some lint.
Diffstat (limited to 'hack/hack.dog.c')
-rw-r--r--hack/hack.dog.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/hack/hack.dog.c b/hack/hack.dog.c
index bc8f88dd..a76e7ffe 100644
--- a/hack/hack.dog.c
+++ b/hack/hack.dog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $ */
+/* $NetBSD: hack.dog.c,v 1.12 2011/08/07 06:03:45 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.dog.c,v 1.11 2009/08/12 07:28:40 dholland Exp $");
+__RCSID("$NetBSD: hack.dog.c,v 1.12 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -177,7 +177,7 @@ dogfood(struct obj *obj)
default:
if (!obj->cursed)
return (APPORT);
- /* fall into next case */
+ /* FALLTHROUGH */
case BALL_SYM:
case CHAIN_SYM:
case ROCK_SYM:
@@ -475,12 +475,13 @@ int
inroom(xchar x, xchar y)
{
#ifndef QUEST
- struct mkroom *croom = &rooms[0];
- while (croom->hx >= 0) {
- if (croom->hx >= x - 1 && croom->lx <= x + 1 &&
- croom->hy >= y - 1 && croom->ly <= y + 1)
- return (croom - rooms);
- croom++;
+ int pos = 0;
+
+ while (rooms[pos].hx >= 0) {
+ if (rooms[pos].hx >= x - 1 && rooms[pos].lx <= x + 1 &&
+ rooms[pos].hy >= y - 1 && rooms[pos].ly <= y + 1)
+ return pos;
+ pos++;
}
#endif /* QUEST */
return (-1); /* not in room or on door */