-/* $NetBSD: fish.c,v 1.15 2004/01/27 20:30:29 jsm Exp $ */
+/* $NetBSD: fish.c,v 1.18 2007/12/15 19:44:40 perry Exp $ */
/*-
* Copyright (c) 1990, 1993
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.15 2004/01/27 20:30:29 jsm Exp $");
+__RCSID("$NetBSD: fish.c,v 1.18 2007/12/15 19:44:40 perry Exp $");
#endif
#endif /* not lint */
void goodmove(int, int, int *, int *);
void init(void);
void instructions(void);
-int main(int, char *[]);
int nrandom(int);
void printhand(const int *);
void printplayer(int);
int promove(void);
-void usage(void) __attribute__((__noreturn__));
+void usage(void) __dead;
int usermove(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int ch, move;
}
int
-usermove()
+usermove(void)
{
int n;
const char *const *p;
}
int
-compmove()
+compmove(void)
{
static int lmove;
}
int
-promove()
+promove(void)
{
int i, max;
}
int
-drawcard(player, hand)
- int player;
- int *hand;
+drawcard(int player, int *hand)
{
int card;
}
int
-gofish(askedfor, player, hand)
- int askedfor, player;
- int *hand;
+gofish(int askedfor, int player, int *hand)
{
printplayer(OTHER(player));
(void)printf("say \"GO FISH!\"\n");
}
void
-goodmove(player, move, hand, opphand)
- int player, move;
- int *hand, *opphand;
+goodmove(int player, int move, int *hand, int *opphand)
{
printplayer(OTHER(player));
(void)printf("have %d %s%s.\n",
}
void
-chkwinner(player, hand)
- int player;
- const int *hand;
+chkwinner(int player, const int *hand)
{
int cb, i, ub;
}
void
-printplayer(player)
- int player;
+printplayer(int player)
{
switch (player) {
case COMPUTER:
}
void
-printhand(hand)
- const int *hand;
+printhand(const int *hand)
{
int book, i, j;
}
int
-countcards(hand)
- const int *hand;
+countcards(const int *hand)
{
int i, count;
}
int
-countbooks(hand)
- const int *hand;
+countbooks(const int *hand)
{
int i, count;
}
void
-init()
+init(void)
{
int i, j, temp;
}
int
-nrandom(n)
- int n;
+nrandom(int n)
{
return((int)random() % n);
}
void
-instructions()
+instructions(void)
{
int input;
pid_t pid;
err(1, "open %s", _PATH_INSTR);
if (dup2(fd, 0) == -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);
/*NOTREACHED*/
case -1:
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: fish [-p]\n");
exit(1);