summaryrefslogtreecommitdiffstats
path: root/monop/cards.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>1997-10-12 17:45:06 +0000
committerchristos <christos@NetBSD.org>1997-10-12 17:45:06 +0000
commita77b3f8edc13dc6efdbcf80e336689cfa1de08ab (patch)
treedfe6f38b6473068455b85cd2410d8394e1239336 /monop/cards.c
parent5526682d8116582745b79bee12e5007abfddcd86 (diff)
downloadbsdgames-darwin-a77b3f8edc13dc6efdbcf80e336689cfa1de08ab.tar.gz
bsdgames-darwin-a77b3f8edc13dc6efdbcf80e336689cfa1de08ab.tar.zst
bsdgames-darwin-a77b3f8edc13dc6efdbcf80e336689cfa1de08ab.zip
WARNSify
Diffstat (limited to 'monop/cards.c')
-rw-r--r--monop/cards.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/monop/cards.c b/monop/cards.c
index b65f0f26..29c9d887 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $ */
+/* $NetBSD: cards.c,v 1.4 1997/10/12 17:45:07 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -33,11 +33,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $";
+__RCSID("$NetBSD: cards.c,v 1.4 1997/10/12 17:45:07 christos Exp $");
#endif
#endif /* not lint */
@@ -58,11 +59,16 @@ static char *cardfile = "cards.pck";
static FILE *deckf;
+static void set_up __P((DECK *));
+static void printmes __P((void));
+
/*
* This routine initializes the decks from the data file,
* which it opens.
*/
-init_decks() {
+void
+init_decks()
+{
if ((deckf=fopen(cardfile, "r")) == NULL) {
file_err:
@@ -77,10 +83,11 @@ file_err:
/*
* This routine sets up the offset pointers for the given deck.
*/
+static void
set_up(dp)
DECK *dp; {
- reg int r1, r2;
+ int r1, r2;
int i;
dp->offsets = (long *) calloc(sizeof (long), dp->num_cards);
@@ -91,7 +98,7 @@ DECK *dp; {
dp->last_card = 0;
dp->gojf_used = FALSE;
for (i = 0; i < dp->num_cards; i++) {
- reg long temp;
+ long temp;
r1 = roll(1, dp->num_cards) - 1;
r2 = roll(1, dp->num_cards) - 1;
@@ -103,11 +110,13 @@ DECK *dp; {
/*
* This routine draws a card from the given deck
*/
+void
get_card(dp)
-DECK *dp; {
+DECK *dp;
+{
- reg char type_maj, type_min;
- reg int num;
+ char type_maj, type_min;
+ int num;
int i, per_h, per_H, num_h, num_H;
OWN *op;
@@ -198,12 +207,14 @@ DECK *dp; {
}
spec = FALSE;
}
+
/*
* This routine prints out the message on the card
*/
+static void
printmes() {
- reg char c;
+ char c;
printline();
fflush(stdout);