Module Name:    src
Committed By:   dholland
Date:           Wed Aug 12 05:35:44 UTC 2009

Modified Files:
        src/games/canfield/canfield: canfield.c
        src/games/canfield/cfscores: cfscores.c

Log Message:
sprinkle static


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/games/canfield/canfield/canfield.c
cvs rdiff -u -r1.15 -r1.16 src/games/canfield/cfscores/cfscores.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/canfield/canfield/canfield.c
diff -u src/games/canfield/canfield/canfield.c:1.25 src/games/canfield/canfield/canfield.c:1.26
--- src/games/canfield/canfield/canfield.c:1.25	Fri Aug  8 16:10:47 2008
+++ src/games/canfield/canfield/canfield.c	Wed Aug 12 05:35:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: canfield.c,v 1.25 2008/08/08 16:10:47 drochner Exp $	*/
+/*	$NetBSD: canfield.c,v 1.26 2009/08/12 05:35:44 dholland Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)canfield.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: canfield.c,v 1.25 2008/08/08 16:10:47 drochner Exp $");
+__RCSID("$NetBSD: canfield.c,v 1.26 2009/08/12 05:35:44 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -149,25 +149,25 @@
 
 #define	NIL	((struct cardtype *) -1)
 
-struct cardtype *deck[decksize];
-struct cardtype cards[decksize];
-struct cardtype *bottom[4], *found[4], *tableau[4];
-struct cardtype *talon, *hand, *stock, *basecard;
-int length[4];
-int cardsoff, base, cinhand, taloncnt, stockcnt, timesthru;
-char suitmap[4] = {spades, clubs, hearts, diamonds};
-char colormap[4] = {black, black, red, red};
-char pilemap[4] = {atabcol, btabcol, ctabcol, dtabcol};
-char srcpile, destpile;
-int mtforigin, tempbase;
-int coldcol, cnewcol, coldrow, cnewrow;
-bool errmsg, done;
-bool mtfdone, Cflag = FALSE;
+static struct cardtype *deck[decksize];
+static struct cardtype cards[decksize];
+static struct cardtype *bottom[4], *found[4], *tableau[4];
+static struct cardtype *talon, *hand, *stock, *basecard;
+static int length[4];
+static int cardsoff, base, cinhand, taloncnt, stockcnt, timesthru;
+static char suitmap[4] = {spades, clubs, hearts, diamonds};
+static char colormap[4] = {black, black, red, red};
+static char pilemap[4] = {atabcol, btabcol, ctabcol, dtabcol};
+static char srcpile, destpile;
+static int mtforigin, tempbase;
+static int coldcol, cnewcol, coldrow, cnewrow;
+static bool errmsg, done;
+static bool mtfdone, Cflag = FALSE;
 #define INSTRUCTIONBOX	1
 #define BETTINGBOX	2
 #define NOBOX		3
-int status = INSTRUCTIONBOX;
-int uid;
+static int status = INSTRUCTIONBOX;
+static int uid;
 
 /*
  * Basic betting costs
@@ -193,58 +193,57 @@
 	long	wins;		/* total winnings */
 	long	worth;		/* net worth after costs */
 };
-struct betinfo this, game, total;
-bool startedgame = FALSE, infullgame = FALSE;
-time_t acctstart;
-int dbfd = -1;
-
-void	askquit(int);
-void	cleanup(int) __dead;
-void	cleanupboard(void);
-void	clearabovemovebox(void);
-void	clearbelowmovebox(void);
-void	clearmsg(void);
-void	clearstat(void);
-void	destinerror(void);
-bool	diffcolor(const struct cardtype *, const struct cardtype *);
-void	dumberror(void);
-bool	finish(void);
-void	fndbase(struct cardtype **, int, int);
-void	getcmd(int, int, const char *);
-void	initall(void);
-void	initdeck(struct cardtype *[]);
-void	initgame(void);
-void	instruct(void);
-int	main(void);
-void	makeboard(void);
-void	movebox(void);
-void	movecard(void);
-void	movetofound(struct cardtype **, int);
-void	movetotalon(void);
-bool	notempty(const struct cardtype *);
-void	printbottombettingbox(void);
-void	printbottominstructions(void);
-void	printcard(int, int, const struct cardtype *);
-void	printrank(int, int, const struct cardtype *, bool);
-void	printtopbettingbox(void);
-void	printtopinstructions(void);
-bool	rankhigher(const struct cardtype *, int);
-bool	ranklower(const struct cardtype *, const struct cardtype *);
-void	removecard(int, int);
-int	samesuit(const struct cardtype *, int);
-void	showcards(void);
-void	showstat(void);
-void	shuffle(struct cardtype *[]);
-void	simpletableau(struct cardtype **, int);
-void	startgame(void);
-void	suspend(void);
-bool	tabok(const struct cardtype *, int);
-void	tabprint(int, int);
-void	tabtotab(int, int);
-void	transit(struct cardtype **, struct cardtype **);
-void	updatebettinginfo(void);
-void	usedstock(void);
-void	usedtalon(void);
+static struct betinfo this, game, total;
+static bool startedgame = FALSE, infullgame = FALSE;
+static time_t acctstart;
+static int dbfd = -1;
+
+static void	askquit(int);
+static void	cleanup(int) __dead;
+static void	cleanupboard(void);
+static void	clearabovemovebox(void);
+static void	clearbelowmovebox(void);
+static void	clearmsg(void);
+static void	clearstat(void);
+static void	destinerror(void);
+static bool	diffcolor(const struct cardtype *, const struct cardtype *);
+static void	dumberror(void);
+static bool	finish(void);
+static void	fndbase(struct cardtype **, int, int);
+static void	getcmd(int, int, const char *);
+static void	initall(void);
+static void	initdeck(struct cardtype *[]);
+static void	initgame(void);
+static void	instruct(void);
+static void	makeboard(void);
+static void	movebox(void);
+static void	movecard(void);
+static void	movetofound(struct cardtype **, int);
+static void	movetotalon(void);
+static bool	notempty(const struct cardtype *);
+static void	printbottombettingbox(void);
+static void	printbottominstructions(void);
+static void	printcard(int, int, const struct cardtype *);
+static void	printrank(int, int, const struct cardtype *, bool);
+static void	printtopbettingbox(void);
+static void	printtopinstructions(void);
+static bool	rankhigher(const struct cardtype *, int);
+static bool	ranklower(const struct cardtype *, const struct cardtype *);
+static void	removecard(int, int);
+static int	samesuit(const struct cardtype *, int);
+static void	showcards(void);
+static void	showstat(void);
+static void	shuffle(struct cardtype *[]);
+static void	simpletableau(struct cardtype **, int);
+static void	startgame(void);
+static void	suspend(void);
+static bool	tabok(const struct cardtype *, int);
+static void	tabprint(int, int);
+static void	tabtotab(int, int);
+static void	transit(struct cardtype **, struct cardtype **);
+static void	updatebettinginfo(void);
+static void	usedstock(void);
+static void	usedtalon(void);
 
 /*
  * The following procedures print the board onto the screen using the
@@ -253,7 +252,7 @@
  *
  * procedure to set the move command box
  */
-void
+static void
 movebox(void)
 {
 	switch (status) {
@@ -288,7 +287,7 @@
 /*
  * print directions above move box
  */
-void
+static void
 printtopinstructions(void)
 {
 	    move(tboxrow, boxcol);
@@ -322,7 +321,7 @@
 /*
  * Print the betting box.
  */
-void
+static void
 printtopbettingbox(void)
 {
 
@@ -357,7 +356,7 @@
 /*
  * clear info above move box
  */
-void
+static void
 clearabovemovebox(void)
 {
 	int i;
@@ -373,7 +372,7 @@
 /*
  * print instructions below move box
  */
-void
+static void
 printbottominstructions(void)
 {
 	    move(bboxrow, boxcol);
@@ -387,7 +386,7 @@
 /*
  * print betting information below move box
  */
-void
+static void
 printbottombettingbox(void)
 {
 	    move(bboxrow, boxcol);
@@ -401,7 +400,7 @@
 /*
  * clear info below move box
  */
-void
+static void
 clearbelowmovebox(void)
 {
 	int i;
@@ -417,7 +416,7 @@
 /*
  * procedure to put the board on the screen using addressable cursor
  */
-void
+static void
 makeboard(void)
 {
 	clear();
@@ -456,7 +455,7 @@
 /*
  * clean up the board for another game
  */
-void
+static void
 cleanupboard(void)
 {
 	int cnt, row, col;
@@ -513,7 +512,7 @@
 /*
  * procedure to create a deck of cards
  */
-void
+static void
 initdeck(struct cardtype *ideck[])
 {
 	int i;
@@ -538,7 +537,7 @@
 /*
  * procedure to shuffle the deck
  */
-void
+static void
 shuffle(struct cardtype *ideck[])
 {
 	int i,j;
@@ -561,7 +560,7 @@
 /*
  * procedure to remove the card from the board
  */
-void
+static void
 removecard(int a, int b)
 {
 	move(b, a);
@@ -571,7 +570,7 @@
 /*
  * procedure to print the cards on the board
  */
-void
+static void
 printrank(int a, int b, const struct cardtype *cp, bool inverse)
 {
 	move(b, a);
@@ -603,7 +602,7 @@
 /*
  * procedure to print out a card
  */
-void
+static void
 printcard(int a, int b, const struct cardtype *cp)
 {
 	if (cp == NIL)
@@ -628,7 +627,7 @@
  * of another location. The pointers always point to the top
  * of the piles.
  */
-void
+static void
 transit(struct cardtype **source, struct cardtype **dest)
 {
 	struct cardtype *temp;
@@ -644,7 +643,7 @@
  * Note that it is only called on a foundation pile at the beginning of
  * the game, so the pile will have exactly one card in it.
  */
-void
+static void
 fndbase(struct cardtype **cp, int column, int row)
 {
 	bool nomore;
@@ -688,7 +687,7 @@
 /*
  * procedure to initialize the things necessary for the game
  */
-void
+static void
 initgame(void)
 {
 	int i;
@@ -734,7 +733,7 @@
 /*
  * procedure to print the beginning cards and to start each game
  */
-void
+static void
 startgame(void)
 {
 	int j;
@@ -775,7 +774,7 @@
 /*
  * procedure to clear the message printed from an error
  */
-void
+static void
 clearmsg(void)
 {
 	int i;
@@ -792,7 +791,7 @@
 /*
  * procedure to print an error message if the move is not listed
  */
-void
+static void
 dumberror(void)
 {
 	errmsg = TRUE;
@@ -803,7 +802,7 @@
 /*
  * procedure to print an error message if the move is not possible
  */
-void
+static void
 destinerror(void)
 {
 	errmsg = TRUE;
@@ -814,7 +813,7 @@
 /*
  * function to see if the source has cards in it
  */
-bool
+static bool
 notempty(const struct cardtype *cp)
 {
 	if (cp == NIL) {
@@ -829,7 +828,7 @@
 /*
  * function to see if the rank of one card is less than another
  */
-bool
+static bool
 ranklower(const struct cardtype *cp1, const struct cardtype *cp2)
 {
 	if (cp2->rank == Ace) 
@@ -846,7 +845,7 @@
 /*
  * function to check the cardcolor for moving to a tableau
  */
-bool
+static bool
 diffcolor(const struct cardtype *cp1, const struct cardtype *cp2)
 {
 	if (cp1->color == cp2->color)
@@ -858,7 +857,7 @@
 /*
  * function to see if the card can move to the tableau
  */
-bool
+static bool
 tabok(const struct cardtype *cp, int des)
 {
 	if ((cp == stock) && (tableau[des] == NIL))
@@ -879,7 +878,7 @@
 /*
  * procedure to turn the cards onto the talon from the deck
  */
-void
+static void
 movetotalon(void)
 {
 	int i, fin;
@@ -965,7 +964,7 @@
  * procedure to print card counting info on screen
  */
 
-void
+static void
 showstat(void)
 {
 	int row, col;
@@ -1008,7 +1007,7 @@
 /*
  * procedure to clear card counting info from screen
  */
-void
+static void
 clearstat(void)
 {
 	int row;
@@ -1028,7 +1027,7 @@
 /*
  * procedure to update card counting base
  */
-void
+static void
 usedtalon(void)
 {
 	removecard(coldcol, coldrow);
@@ -1053,7 +1052,7 @@
 /*
  * procedure to update stock card counting base
  */
-void
+static void
 usedstock(void)
 {
 	stockcnt--;
@@ -1066,7 +1065,7 @@
 /*
  * let 'em know how they lost!
  */
-void
+static void
 showcards(void)
 {
 	struct cardtype *ptr;
@@ -1114,7 +1113,7 @@
 /*
  * procedure to update the betting values
  */
-void
+static void
 updatebettinginfo(void)
 {
 	long thiscosts, gamecosts, totalcosts;
@@ -1173,7 +1172,7 @@
 /*
  * procedure to move a card from the stock or talon to the tableau
  */
-void
+static void
 simpletableau(struct cardtype **cp, int des)
 {
 	int origin;
@@ -1205,7 +1204,7 @@
 /*
  * print the tableau
  */
-void
+static void
 tabprint(int sour, int des)
 {
 	int dlength, slength, i;
@@ -1231,7 +1230,7 @@
 /*
  * procedure to move from the tableau to the tableau
  */
-void
+static void
 tabtotab(int sour, int des)
 {
 	struct cardtype *temp;
@@ -1258,7 +1257,7 @@
 /*
  * functions to see if the card can go onto the foundation
  */
-bool
+static bool
 rankhigher(const struct cardtype *cp, int let)
 {
 	if (found[let]->rank == King)
@@ -1275,7 +1274,7 @@
 /*
  * function to determine if two cards are the same suit
  */
-int
+static int
 samesuit(const struct cardtype *cp, int let)
 {
 	if (cp->suit == found[let]->suit)
@@ -1287,7 +1286,7 @@
 /*
  * procedure to move a card to the correct foundation pile
  */
-void
+static void
 movetofound(struct cardtype **cp, int source)
 {
 	tempbase = 0;
@@ -1340,7 +1339,7 @@
 /*
  * procedure to get a command
  */
-void
+static void
 getcmd(int row, int col, const char *cp)
 {
 	char cmd[2] = { '\0', '\0'}, ch;
@@ -1389,7 +1388,7 @@
 /*
  * Suspend the game (shell escape if no process control on system)
  */
-void
+static void
 suspend(void)
 {
 #ifndef SIGTSTP
@@ -1411,7 +1410,7 @@
 /*
  * procedure to evaluate and make the specific moves
  */
-void
+static void
 movecard(void)
 {
 	int source, dest;
@@ -1561,7 +1560,7 @@
 	} while (!done);
 }
 
-const char *const basicinstructions[] = {
+static const char *const basicinstructions[] = {
 	"Here are brief instructions to the game of Canfield:\n\n",
 	"     If you have never played solitaire before, it is recom-\n",
 	"mended  that  you  consult  a solitaire instruction book. In\n",
@@ -1583,7 +1582,7 @@
 	"push any key when you are finished: ",
 	0 };
 
-const char *const bettinginstructions[] = {
+static const char *const bettinginstructions[] = {
 	"     The rules for betting are  somewhat  less  strict  than\n",
 	"those  used in the official version of the game. The initial\n",
 	"deal costs $13. You may quit at this point  or  inspect  the\n",
@@ -1608,7 +1607,7 @@
 /*
  * procedure to printout instructions
  */
-void
+static void
 instruct(void)
 {
 	const char *const *cp;
@@ -1644,7 +1643,7 @@
 /*
  * procedure to initialize the game
  */
-void
+static void
 initall(void)
 {
 	int i;
@@ -1681,7 +1680,7 @@
 /*
  * procedure to end the game
  */
-bool
+static bool
 finish(void)
 {
 	int row, col;
@@ -1719,7 +1718,7 @@
 /*
  * procedure to clean up and exit
  */
-void
+static void
 cleanup(int dummy __unused)
 {
 
@@ -1742,7 +1741,7 @@
 /*
  * Field an interrupt.
  */
-void
+static void
 askquit(int dummy __unused)
 {
 	move(msgrow, msgcol);

Index: src/games/canfield/cfscores/cfscores.c
diff -u src/games/canfield/cfscores/cfscores.c:1.15 src/games/canfield/cfscores/cfscores.c:1.16
--- src/games/canfield/cfscores/cfscores.c:1.15	Sun Jul 20 01:03:21 2008
+++ src/games/canfield/cfscores/cfscores.c	Wed Aug 12 05:35:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cfscores.c,v 1.15 2008/07/20 01:03:21 lukem Exp $	*/
+/*	$NetBSD: cfscores.c,v 1.16 2009/08/12 05:35:44 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)cfscores.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: cfscores.c,v 1.15 2008/07/20 01:03:21 lukem Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.16 2009/08/12 05:35:44 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -64,9 +64,9 @@
 	long	worth;		/* net worth after costs */
 };
 
-int dbfd;
+static int dbfd;
 
-void	printuser(const struct passwd *, int);
+static void printuser(const struct passwd *, int);
 
 int
 main(int argc, char *argv[])
@@ -112,7 +112,7 @@
 /*
  * print out info for specified password entry
  */
-void
+static void
 printuser(const struct passwd *pw, int printfail)
 {
 	struct betinfo total;

Reply via email to