Subject: bin/17498: WARNS=2 patch for rogue
To: None <gnats-bugs@gnats.netbsd.org>
From: David Holland <dholland@eecs.harvard.edu>
List: netbsd-bugs
Date: 07/06/2002 21:47:58
>Number: 17498
>Category: bin
>Synopsis: WARNS=2 patch for rogue
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Jul 06 18:48:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: dholland@eecs.harvard.edu (David A. Holland)
>Release: NetBSD 1.6B
>Organization:
- David A. Holland / dholland@eecs.harvard.edu
>Environment:
System: NetBSD alicante 1.6B NetBSD 1.6B (ALICANTE) #2: Tue Jul 2 14:12:37 EDT 2002 dholland@alicante:/usr/src/sys/arch/i386/compile/ALICANTE i386
Architecture: i386
Machine: i386
>Description:
Small enclosed patch makes rogue build with WARNS=2, should
this be construed as worthwhile, which maybe it isn't.
>How-To-Repeat:
n/a
>Fix:
Index: games/rogue/Makefile
===================================================================
RCS file: /cvsroot/basesrc/games/rogue/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile 1999/09/13 17:14:07 1.14
+++ Makefile 2002/07/07 01:38:52
@@ -11,6 +11,7 @@
HIDEGAME=hidegame
SETGIDGAME=yes
MAN= rogue.6
+WARNS=2
.if make(install)
SUBDIR+=USD.doc
Index: games/rogue/hit.c
===================================================================
RCS file: /cvsroot/basesrc/games/rogue/hit.c,v
retrieving revision 1.5
diff -u -r1.5 hit.c
--- hit.c 1998/11/10 13:01:31 1.5
+++ hit.c 2002/07/07 01:38:58
@@ -213,17 +213,17 @@
const object *obj;
{
char new_damage[12];
- int to_hit, damage;
+ int tmp_to_hit, tmp_damage;
int i = 0;
if ((!obj) || (obj->what_is != WEAPON)) {
return(-1);
}
- to_hit = get_number(obj->damage) + obj->hit_enchant;
+ tmp_to_hit = get_number(obj->damage) + obj->hit_enchant;
while (obj->damage[i++] != 'd') ;
- damage = get_number(obj->damage + i) + obj->d_enchant;
+ tmp_damage = get_number(obj->damage + i) + obj->d_enchant;
- sprintf(new_damage, "%dd%d", to_hit, damage);
+ sprintf(new_damage, "%dd%d", tmp_to_hit, tmp_damage);
return(get_damage(new_damage, 1));
}
Index: games/rogue/inventory.c
===================================================================
RCS file: /cvsroot/basesrc/games/rogue/inventory.c,v
retrieving revision 1.6
diff -u -r1.6 inventory.c
--- inventory.c 1998/11/10 13:01:32 1.6
+++ inventory.c 2002/07/07 01:39:07
@@ -362,15 +362,15 @@
}
int
-get_com_id(index, ch)
- int *index;
+get_com_id(indexp, ch)
+ int *indexp;
short ch;
{
short i;
for (i = 0; i < COMS; i++) {
if (com_id_tab[i].com_char == ch) {
- *index = i;
+ *indexp = i;
return(1);
}
}
Index: games/rogue/score.c
===================================================================
RCS file: /cvsroot/basesrc/games/rogue/score.c,v
retrieving revision 1.9
diff -u -r1.9 score.c
--- score.c 2001/08/09 13:02:49 1.9
+++ score.c 2002/07/07 01:39:11
@@ -209,7 +209,7 @@
char buf[128];
FILE *fp;
long s;
- boolean pause = score_only;
+ boolean dopause = score_only;
md_lock(1);
@@ -322,7 +322,7 @@
refresh();
fclose(fp);
message("", 0);
- if (pause) {
+ if (dopause) {
message("", 0);
}
clean_up("");
>Release-Note:
>Audit-Trail:
>Unformatted:
Patch applies to -current as of today, 20020706.