diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-01-16 01:28:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-01-16 01:28:55 +0000 |
commit | 496e01e18f4d501ab034f7e71a4cb06167ff88c7 (patch) | |
tree | 3b457e6ee395b8d25e40dc6501edb7b037c62ff1 /games/phantasia/io.c | |
parent | 51f4383f61889d34ee59c9078b745fc1afd1e51d (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.c | 11 |
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 */ |