-/* $NetBSD: init.c,v 1.6 1997/05/23 23:09:37 jtc Exp $ */
+/* $NetBSD: init.c,v 1.11 2009/05/25 23:34:50 dholland Exp $ */
/*
* Copyright (c) 1982, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: init.c,v 1.6 1997/05/23 23:09:37 jtc Exp $";
+__RCSID("$NetBSD: init.c,v 1.11 2009/05/25 23:34:50 dholland Exp $");
#endif
#endif /* not lint */
-# include "mille.h"
+#include "mille.h"
/*
* @(#)init.c 1.1 (Berkeley) 4/1/82
*/
-init() {
+void
+init(void)
+{
+ PLAY *pp;
+ int i, j;
+ CARD card;
- register PLAY *pp;
- register int i, j;
- register CARD card;
-
- bzero(Numseen, sizeof Numseen);
+ memset(Numseen, 0, sizeof Numseen);
Numgos = 0;
for (i = 0; i < 2; i++) {
pp->hand[j] = *--Topcard;
if (i == COMP) {
account(card = *Topcard);
- if (issafety(card))
+ if (is_safety(card))
pp->safety[card - S_CONV] = S_IN_HAND;
}
}
End = 700;
}
-shuffle() {
-
- register int i, r;
- register CARD temp;
+void
+shuffle(void)
+{
+ int i, r;
+ CARD temp;
for (i = 0; i < DECK_SZ; i++) {
r = roll(1, DECK_SZ) - 1;
if (r < 0 || r > DECK_SZ - 1) {
- fprintf(stderr, "shuffle: card no. error: %d\n", r);
+ warnx("shuffle: card no. error: %d", r);
die(1);
}
temp = Deck[r];
Topcard = &Deck[DECK_SZ];
}
-newboard() {
-
- register int i;
- register PLAY *pp;
+void
+newboard(void)
+{
+ int i;
+ PLAY *pp;
static int first = TRUE;
if (first) {
newscore();
}
-newscore() {
-
- register int i, new;
- register PLAY *pp;
+void
+newscore(void)
+{
+ int i, new;
+ PLAY *pp;
static int was_full = -1;
static int last_win = -1;