+/* $NetBSD: print.c,v 1.18 2011/08/21 08:50:08 christos Exp $ */
+
/*
- * Copyright (c) 1982 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1982, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 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
-/*static char sccsid[] = "from: @(#)print.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: print.c,v 1.2 1993/08/01 18:53:57 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: print.c,v 1.18 2011/08/21 08:50:08 christos Exp $");
+#endif
#endif /* not lint */
-# include "mille.h"
+#include "mille.h"
/*
* @(#)print.c 1.1 (Berkeley) 4/1/82
*/
-# define COMP_STRT 20
-# define CARD_STRT 2
+#define COMP_STRT 20
+#define CARD_STRT 2
-prboard() {
+static void show_card(int, int, CARD, CARD *);
+static void show_score(int, int, int, int *);
- reg PLAY *pp;
- reg int i, j, k, temp;
+void
+prboard(void)
+{
+ PLAY *pp;
+ int i, j, k, temp;
for (k = 0; k < 2; k++) {
pp = &Player[k];
show_card(14, temp, pp->battle, &pp->sh_battle);
show_card(16, temp, pp->speed, &pp->sh_speed);
for (i = C_25; i <= C_200; i++) {
- reg char *name;
- reg int end;
+ const char *name;
+ int end;
if (pp->nummiles[i] == pp->sh_nummiles[i])
continue;
pp = &Player[PLAYER];
for (i = 0; i < HAND_SZ; i++)
show_card(i + 6, temp, pp->hand[i], &pp->sh_hand[i]);
- mvprintw(6, COMP_STRT + CARD_STRT, "%2d", Topcard - Deck);
+ mvprintw(6, COMP_STRT + CARD_STRT, "%2ld", (long)(Topcard - Deck));
show_card(8, COMP_STRT + CARD_STRT, Discard, &Sh_discard);
if (End == 1000) {
move(EXT_Y, EXT_X);
* show_card:
* Show the given card if it is different from the last one shown
*/
-show_card(y, x, c, lc)
-int y, x;
-register CARD c, *lc;
+static void
+show_card(int y, int x, CARD c, CARD *lc)
{
if (c == *lc)
return;
*lc = c;
}
-static char Score_fmt[] = "%4d";
-
-prscore(for_real)
-reg bool for_real; {
+static const char Score_fmt[] = "%4d";
- reg PLAY *pp;
- reg int x;
+void
+prscore(bool for_real)
+{
+ PLAY *pp;
+ int x;
stdscr = Score;
for (pp = Player; pp < &Player[2]; pp++) {
* Show a score value if it is different from the last time we
* showed it.
*/
-show_score(y, x, s, ls)
-int y, x;
-register int s, *ls;
+static void
+show_score(int y, int x, int s, int *ls)
{
if (s == *ls)
return;