summaryrefslogtreecommitdiffstats
path: root/games/phantasia
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2002-01-16 01:28:54 +0000
committermillert <millert@openbsd.org>2002-01-16 01:28:54 +0000
commitfc8048171e0691ce3520db453b5ebfdb4f1dc5e6 (patch)
treecd2b081daa4ea66115d5b3e0c3567d99f8144953 /games/phantasia
parentJust tested a Eumitcom WL11000P in the guise of a Belkin F5D6000. (diff)
downloadwireguard-openbsd-fc8048171e0691ce3520db453b5ebfdb4f1dc5e6.tar.xz
wireguard-openbsd-fc8048171e0691ce3520db453b5ebfdb4f1dc5e6.zip
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')
-rw-r--r--games/phantasia/fight.c12
-rw-r--r--games/phantasia/io.c11
2 files changed, 8 insertions, 15 deletions
diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c
index f4dfd46def6..bac020cf490 100644
--- a/games/phantasia/fight.c
+++ b/games/phantasia/fight.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fight.c,v 1.6 2002/01/04 16:16:32 art Exp $ */
+/* $OpenBSD: fight.c,v 1.7 2002/01/16 01:28:54 millert Exp $ */
/* $NetBSD: fight.c,v 1.2 1995/03/24 03:58:39 cgd Exp $ */
/*
@@ -41,18 +41,14 @@ void
encounter(particular)
int particular;
{
- bool firsthit = Player.p_blessing; /* set if player gets the
- * first hit */
- int flockcnt = 1; /* how many time flocked */
+ int flockcnt = 1; /* how many time flocked */
+ volatile bool firsthit = Player.p_blessing; /* set if player gets
+ * the first hit */
/* let others know what we are doing */
Player.p_status = S_MONSTER;
writerecord(&Player, Fileloc);
-#if __GNUC__
- (void)&firsthit; /* XXX shut up gcc */
-#endif
-
#ifdef SYS5
flushinp();
#endif
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 */