summaryrefslogtreecommitdiffstats
path: root/wump
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2012-06-19 05:46:08 +0000
committerdholland <dholland@NetBSD.org>2012-06-19 05:46:08 +0000
commit59a1b2e1425834dcc8f7d2b99c931f3c6f6bc28c (patch)
tree629475be65e4569ada852759c1510dc0ea17512f /wump
parent4cb1100e13371f1523900523aba506ae1c62e44c (diff)
downloadbsdgames-darwin-59a1b2e1425834dcc8f7d2b99c931f3c6f6bc28c.tar.gz
bsdgames-darwin-59a1b2e1425834dcc8f7d2b99c931f3c6f6bc28c.tar.zst
bsdgames-darwin-59a1b2e1425834dcc8f7d2b99c931f3c6f6bc28c.zip
WARNS=5, and make WARNS=5 the default for src/games.
Diffstat (limited to 'wump')
-rw-r--r--wump/wump.c60
1 files changed, 26 insertions, 34 deletions
diff --git a/wump/wump.c b/wump/wump.c
index 559ebc9b..0175bb05 100644
--- a/wump/wump.c
+++ b/wump/wump.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wump.c,v 1.29 2011/09/01 07:18:51 plunky Exp $ */
+/* $NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\
#if 0
static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: wump.c,v 1.29 2011/09/01 07:18:51 plunky Exp $");
+__RCSID("$NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $");
#endif
#endif /* not lint */
@@ -138,9 +138,7 @@ static void wump_kill(void);
static int wump_nearby(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int c, e=0;
@@ -255,7 +253,7 @@ quiver holds %d custom super anti-evil Wumpus arrows. Good luck.\n",
}
static void
-display_room_stats()
+display_room_stats(void)
{
int i;
@@ -285,7 +283,7 @@ display_room_stats()
}
static int
-take_action()
+take_action(void)
{
/*
* Do the action specified by the player, either 'm'ove, 's'hoot
@@ -314,8 +312,7 @@ take_action()
}
static int
-move_to(room_number)
- const char *room_number;
+move_to(const char *room_number)
{
int i, just_moved_by_bats, next_room, tunnel_available;
@@ -406,8 +403,7 @@ move_to(room_number)
}
static int
-shoot(room_list)
- char *room_list;
+shoot(char *room_list)
{
int chance, next, roomcnt;
int j, arrow_location, lnk, ok;
@@ -519,8 +515,7 @@ The arrow is weakly shot and can go no further!\n");
}
static int
-gcd(a, b)
- int a, b;
+gcd(int a, int b)
{
int r;
@@ -531,7 +526,7 @@ gcd(a, b)
}
static void
-cave_init()
+cave_init(void)
{
int i, j, k, lnk;
int delta;
@@ -611,7 +606,7 @@ try_again: lnk = (random() % room_num) + 1;
}
static void
-clear_things_in_cave()
+clear_things_in_cave(void)
{
int i;
@@ -624,7 +619,7 @@ clear_things_in_cave()
}
static void
-initialize_things_in_cave()
+initialize_things_in_cave(void)
{
int i, loc;
@@ -668,8 +663,7 @@ initialize_things_in_cave()
}
static int
-getans(prompt)
- const char *prompt;
+getans(const char *prompt)
{
char buf[20];
@@ -694,7 +688,7 @@ getans(prompt)
}
static int
-bats_nearby()
+bats_nearby(void)
{
int i;
@@ -706,7 +700,7 @@ bats_nearby()
}
static int
-pit_nearby()
+pit_nearby(void)
{
int i;
@@ -718,7 +712,7 @@ pit_nearby()
}
static int
-wump_nearby()
+wump_nearby(void)
{
int i, j;
@@ -735,20 +729,19 @@ wump_nearby()
}
static void
-move_wump()
+move_wump(void)
{
wumpus_loc = cave[wumpus_loc].tunnel[random() % link_num];
}
static int
-int_compare(a, b)
- const void *a, *b;
+int_compare(const void *a, const void *b)
{
return(*(const int *)a < *(const int *)b ? -1 : 1);
}
static void
-instructions()
+instructions(void)
{
const char *pager;
pid_t pid;
@@ -792,7 +785,7 @@ puff of greasy black smoke! (poof)\n");
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n");
@@ -802,7 +795,7 @@ usage()
/* messages */
static void
-wump_kill()
+wump_kill(void)
{
(void)printf(
"*ROAR* *chomp* *snurfle* *chomp*!\n\
@@ -814,7 +807,7 @@ passed out from the stench!\n");
}
static void
-kill_wump()
+kill_wump(void)
{
(void)printf(
"*thwock!* *groan* *crash*\n\n\
@@ -826,7 +819,7 @@ mightiest adventurer at a single whiff!!\n");
}
static void
-no_arrows()
+no_arrows(void)
{
(void)printf(
"\nYou turn and look at your quiver, and realize with a sinking feeling\n\
@@ -836,7 +829,7 @@ you, and with a mighty *ROAR* eats you alive!\n");
}
static void
-shoot_self()
+shoot_self(void)
{
(void)printf(
"\n*Thwack!* A sudden piercing feeling informs you that the ricochet\n\
@@ -847,8 +840,7 @@ and immediately rushes to your side, not to help, alas, but to EAT YOU!\n\
}
static void
-jump(where)
- int where;
+jump(int where)
{
(void)printf(
"\nWith a jaunty step you enter the magic tunnel. As you do, you\n\
@@ -857,7 +849,7 @@ a very curious, warm sensation and find yourself in room %d!!\n", where);
}
static void
-pit_kill()
+pit_kill(void)
{
(void)printf(
"*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\
@@ -869,7 +861,7 @@ you can at least find out if Jules Verne was right...\n");
}
static void
-pit_survive()
+pit_survive(void)
{
(void)printf(
"Without conscious thought you grab for the side of the cave and manage\n\