-/* $NetBSD: wump.c,v 1.28 2011/08/31 16:24:57 plunky Exp $ */
+/* $NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $ */
/*
* Copyright (c) 1989, 1993
#if 0
static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: wump.c,v 1.28 2011/08/31 16:24:57 plunky Exp $");
+__RCSID("$NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $");
#endif
#endif /* not lint */
static int wump_nearby(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int c, e=0;
}
static void
-display_room_stats()
+display_room_stats(void)
{
int i;
}
static int
-take_action()
+take_action(void)
{
/*
* Do the action specified by the player, either 'm'ove, 's'hoot
}
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;
}
static int
-shoot(room_list)
- char *room_list;
+shoot(char *room_list)
{
int chance, next, roomcnt;
int j, arrow_location, lnk, ok;
}
static int
-gcd(a, b)
- int a, b;
+gcd(int a, int b)
{
int r;
}
static void
-cave_init()
+cave_init(void)
{
int i, j, k, lnk;
int delta;
}
static void
-clear_things_in_cave()
+clear_things_in_cave(void)
{
int i;
}
static void
-initialize_things_in_cave()
+initialize_things_in_cave(void)
{
int i, loc;
}
static int
-getans(prompt)
- const char *prompt;
+getans(const char *prompt)
{
char buf[20];
}
static int
-bats_nearby()
+bats_nearby(void)
{
int i;
}
static int
-pit_nearby()
+pit_nearby(void)
{
int i;
}
static int
-wump_nearby()
+wump_nearby(void)
{
int i, j;
}
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;
err(1, "open %s", _PATH_WUMPINFO);
if (dup2(fd, STDIN_FILENO) == -1)
err(1, "dup2");
- (void)execl("/bin/sh", "sh", "-c", pager, NULL);
+ (void)execl("/bin/sh", "sh", "-c", pager, (char *) NULL);
err(1, "exec sh -c %s", pager);
case -1:
err(1, "fork");
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n");
/* messages */
static void
-wump_kill()
+wump_kill(void)
{
(void)printf(
"*ROAR* *chomp* *snurfle* *chomp*!\n\
}
static void
-kill_wump()
+kill_wump(void)
{
(void)printf(
"*thwock!* *groan* *crash*\n\n\
}
static void
-no_arrows()
+no_arrows(void)
{
(void)printf(
"\nYou turn and look at your quiver, and realize with a sinking feeling\n\
}
static void
-shoot_self()
+shoot_self(void)
{
(void)printf(
"\n*Thwack!* A sudden piercing feeling informs you that the ricochet\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\
}
static void
-pit_kill()
+pit_kill(void)
{
(void)printf(
"*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\
}
static void
-pit_survive()
+pit_survive(void)
{
(void)printf(
"Without conscious thought you grab for the side of the cave and manage\n\