Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/hangman Pass -Wstrict-overflow; while here, use curses...
details: https://anonhg.NetBSD.org/src/rev/950f9c1d3359
branches: trunk
changeset: 782059:950f9c1d3359
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Oct 13 21:01:13 2012 +0000
description:
Pass -Wstrict-overflow; while here, use curses TRUE and FALSE only with
curses.
diffstat:
games/hangman/getguess.c | 10 +++++-----
games/hangman/playgame.c | 12 ++++++------
2 files changed, 11 insertions(+), 11 deletions(-)
diffs (70 lines):
diff -r d7f18b72f871 -r 950f9c1d3359 games/hangman/getguess.c
--- a/games/hangman/getguess.c Sat Oct 13 20:57:35 2012 +0000
+++ b/games/hangman/getguess.c Sat Oct 13 21:01:13 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getguess.c,v 1.9 2012/06/19 05:45:00 dholland Exp $ */
+/* $NetBSD: getguess.c,v 1.10 2012/10/13 21:01:13 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getguess.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getguess.c,v 1.9 2012/06/19 05:45:00 dholland Exp $");
+__RCSID("$NetBSD: getguess.c,v 1.10 2012/10/13 21:01:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -76,12 +76,12 @@
move(MESGY, MESGX);
clrtoeol();
- Guessed[ch - 'a'] = TRUE;
- correct = FALSE;
+ Guessed[ch - 'a'] = true;
+ correct = false;
for (i = 0; Word[i] != '\0'; i++)
if (Word[i] == ch) {
Known[i] = ch;
- correct = TRUE;
+ correct = true;
}
if (!correct)
Errors++;
diff -r d7f18b72f871 -r 950f9c1d3359 games/hangman/playgame.c
--- a/games/hangman/playgame.c Sat Oct 13 20:57:35 2012 +0000
+++ b/games/hangman/playgame.c Sat Oct 13 21:01:13 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: playgame.c,v 1.6 2012/06/19 05:45:00 dholland Exp $ */
+/* $NetBSD: playgame.c,v 1.7 2012/10/13 21:01:13 dholland Exp $ */
/*-
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)playgame.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: playgame.c,v 1.6 2012/06/19 05:45:00 dholland Exp $");
+__RCSID("$NetBSD: playgame.c,v 1.7 2012/10/13 21:01:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -47,13 +47,13 @@
void
playgame(void)
{
- bool *bp;
+ int i;
getword();
Errors = 0;
- bp = Guessed;
- while (bp < &Guessed[26])
- *bp++ = FALSE;
+ for (i=0; i<26; i++) {
+ Guessed[i] = false;
+ }
while (Errors < MAXERRS && strchr(Known, '-') != NULL) {
prword();
prdata();
Home |
Main Index |
Thread Index |
Old Index