Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/hack Fix up some lint.
details: https://anonhg.NetBSD.org/src/rev/6bbc537f0698
branches: trunk
changeset: 768047:6bbc537f0698
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Aug 07 06:03:45 2011 +0000
description:
Fix up some lint.
diffstat:
games/hack/hack.apply.c | 6 +++---
games/hack/hack.c | 6 +++---
games/hack/hack.do_name.c | 11 ++++++-----
games/hack/hack.dog.c | 19 ++++++++++---------
games/hack/hack.eat.c | 12 ++++++------
games/hack/hack.engrave.c | 11 +++++++----
games/hack/hack.invent.c | 6 ++++--
games/hack/hack.mkobj.c | 7 ++++---
games/hack/hack.mkshop.c | 6 +++---
games/hack/hack.mon.c | 5 +++--
games/hack/hack.objnam.c | 10 +++++-----
games/hack/hack.shk.c | 5 +++--
games/hack/hack.trap.c | 6 +++---
games/hack/hack.wizard.c | 6 +++---
14 files changed, 63 insertions(+), 53 deletions(-)
diffs (truncated from 473 to 300 lines):
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.apply.c
--- a/games/hack/hack.apply.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.apply.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.apply.c,v 1.12 2011/08/06 20:42:43 dholland Exp $ */
+/* $NetBSD: hack.apply.c,v 1.13 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.apply.c,v 1.12 2011/08/06 20:42:43 dholland Exp $");
+__RCSID("$NetBSD: hack.apply.c,v 1.13 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -108,7 +108,7 @@
use_magic_whistle(obj);
break;
}
- /* fall into next case */
+ /* FALLTHROUGH */
case WHISTLE:
use_whistle(obj);
break;
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.c
--- a/games/hack/hack.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.c,v 1.10 2010/02/03 15:34:38 roy Exp $ */
+/* $NetBSD: hack.c,v 1.11 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.c,v 1.10 2010/02/03 15:34:38 roy Exp $");
+__RCSID("$NetBSD: hack.c,v 1.11 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -600,7 +600,7 @@
break;
if (flags.run != 1)
goto stop;
- /* fall into next case */
+ /* FALLTHROUGH */
case CORR_SYM:
corr:
if (flags.run == 1 || flags.run == 3) {
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.do_name.c
--- a/games/hack/hack.do_name.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.do_name.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.do_name.c,v 1.12 2011/08/06 20:29:37 dholland Exp $ */
+/* $NetBSD: hack.do_name.c,v 1.13 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.do_name.c,v 1.12 2011/08/06 20:29:37 dholland Exp $");
+__RCSID("$NetBSD: hack.do_name.c,v 1.13 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -119,7 +119,8 @@
{
char buf[BUFSZ];
coord cc;
- int cx, cy, lth;
+ int cx, cy;
+ size_t lth;
unsigned i;
struct monst *mtmp, *mtmp2;
cc = getpos(0, "the monster you want to name");
@@ -173,7 +174,7 @@
do_oname(struct obj *obj)
{
struct obj *otmp, *otmp2;
- int lth;
+ size_t lth;
char buf[BUFSZ];
pline("What do you want to name %s? ", doname(obj));
getlin(buf);
@@ -295,7 +296,7 @@
(void) strlcpy(buf, shkname(mtmp), sizeof(buf));
break;
}
- /* fall into next case */
+ /* FALLTHROUGH */
default:
(void) snprintf(buf, sizeof(buf), "the %s%s",
mtmp->minvis ? "invisible " : "",
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.dog.c
--- a/games/hack/hack.dog.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.dog.c Sun Aug 07 06:03:45 2011 +0000
@@ -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 @@
default:
if (!obj->cursed)
return (APPORT);
- /* fall into next case */
+ /* FALLTHROUGH */
case BALL_SYM:
case CHAIN_SYM:
case ROCK_SYM:
@@ -475,12 +475,13 @@
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 */
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.eat.c
--- a/games/hack/hack.eat.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.eat.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.eat.c,v 1.11 2011/08/06 20:42:43 dholland Exp $ */
+/* $NetBSD: hack.eat.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.eat.c,v 1.11 2011/08/06 20:42:43 dholland Exp $");
+__RCSID("$NetBSD: hack.eat.c,v 1.12 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -495,11 +495,11 @@
case 'n':
u.uhp = u.uhpmax;
flags.botl = 1;
- /* fall into next case */
+ /* FALLTHROUGH */
case '@':
pline("You cannibal! You will be sorry for this!");
/* not tp++; */
- /* fall into next case */
+ /* FALLTHROUGH */
case 'd':
Aggravate_monster |= INTRINSIC;
break;
@@ -512,12 +512,12 @@
Invis |= INTRINSIC;
See_invisible |= INTRINSIC;
}
- /* fall into next case */
+ /* FALLTHROUGH */
case 'y':
#ifdef QUEST
u.uhorizon++;
#endif /* QUEST */
- /* fall into next case */
+ /* FALLTHROUGH */
case 'B':
Confusion = 50;
break;
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.engrave.c
--- a/games/hack/hack.engrave.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.engrave.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.engrave.c,v 1.13 2011/08/06 20:42:43 dholland Exp $ */
+/* $NetBSD: hack.engrave.c,v 1.14 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.engrave.c,v 1.13 2011/08/06 20:42:43 dholland Exp $");
+__RCSID("$NetBSD: hack.engrave.c,v 1.14 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -105,7 +105,8 @@
{
struct engr *ep = engr_at(x, y);
char *t;
- int n;
+ size_t n;
+
if (ep && ep->engr_time <= moves) {
t = ep->engr_txt;
/*
@@ -132,8 +133,10 @@
wipe_engr_at(xchar x, xchar y, xchar cnt)
{
struct engr *ep = engr_at(x, y);
- int lth, pos;
+ int pos;
char ch;
+ size_t lth;
+
if (ep) {
if ((ep->engr_type != DUST) || Levitation) {
cnt = rn2(1 + 50 / (cnt + 1)) ? 0 : 1;
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.invent.c
--- a/games/hack/hack.invent.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.invent.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.invent.c,v 1.17 2011/08/06 20:42:43 dholland Exp $ */
+/* $NetBSD: hack.invent.c,v 1.18 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.invent.c,v 1.17 2011/08/06 20:42:43 dholland Exp $");
+__RCSID("$NetBSD: hack.invent.c,v 1.18 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <assert.h>
@@ -664,10 +664,12 @@
switch (sym) {
case 'a':
allflag = 1;
+ /* FALLTHROUGH */
case 'y':
cnt += (*fn) (otmp);
if (--max == 0)
goto ret;
+ break;
case 'n':
default:
break;
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.mkobj.c
--- a/games/hack/hack.mkobj.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.mkobj.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $ */
+/* $NetBSD: hack.mkobj.c,v 1.9 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.mkobj.c,v 1.8 2009/08/12 07:28:41 dholland Exp $");
+__RCSID("$NetBSD: hack.mkobj.c,v 1.9 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -141,9 +141,10 @@
if (otmp->otyp == TIN)
otmp->spe = rnd(...);
#endif /* NOT_YET_IMPLEMENTED */
- /* fall into next case */
+ /* FALLTHROUGH */
case GEM_SYM:
otmp->quan = rn2(6) ? 1 : 2;
+ break;
case TOOL_SYM:
case CHAIN_SYM:
case BALL_SYM:
diff -r e9ae32822a12 -r 6bbc537f0698 games/hack/hack.mkshop.c
--- a/games/hack/hack.mkshop.c Sun Aug 07 06:01:51 2011 +0000
+++ b/games/hack/hack.mkshop.c Sun Aug 07 06:03:45 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.mkshop.c,v 1.10 2009/08/12 07:28:41 dholland Exp $ */
Home |
Main Index |
Thread Index |
Old Index