summaryrefslogtreecommitdiff
path: root/games/phantasia/io.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-01-16 01:28:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-01-16 01:28:55 +0000
commit496e01e18f4d501ab034f7e71a4cb06167ff88c7 (patch)
tree3b457e6ee395b8d25e40dc6501edb7b037c62ff1 /games/phantasia/io.c
parent51f4383f61889d34ee59c9078b745fc1afd1e51d (diff)
Use the volatile specifier to fix warnings about variables being
clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
Diffstat (limited to 'games/phantasia/io.c')
-rw-r--r--games/phantasia/io.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/games/phantasia/io.c b/games/phantasia/io.c
index 47ca6909d1f..5d0cbce9da1 100644
--- a/games/phantasia/io.c
+++ b/games/phantasia/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.4 1998/11/29 19:56:57 pjanzen Exp $ */
+/* $OpenBSD: io.c,v 1.5 2002/01/16 01:28:54 millert Exp $ */
/* $NetBSD: io.c,v 1.2 1995/03/24 03:58:50 cgd Exp $ */
/*
@@ -325,16 +325,13 @@ getanswer(choices, def)
char *choices;
bool def;
{
- int ch; /* input */
- int loop; /* counter */
- int oldx, oldy; /* original coordinates on screen */
+ int ch; /* input */
+ volatile int loop; /* counter */
+ volatile int oldx, oldy; /* original coordinates on screen */
getyx(stdscr, oldy, oldx);
alarm(0); /* make sure alarm is off */
-#if __GNUC__
- (void)&loop; /* XXX quiet gcc */
-#endif
for (loop = 3; loop; --loop)
for (loop = 3; loop; --loop)
/* try for 3 times */