summaryrefslogtreecommitdiff
path: root/games/canfield
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-09 15:59:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-09 15:59:27 +0000
commitc1b01e7eebe1d3206f4204776b105318b0b7b8bc (patch)
tree940af30a6f1a9912227868afece1c2d1b1091dff /games/canfield
parentfe859c06cf60db912ac03d66f1dc8d70b91bd189 (diff)
ansi; khalek@linuxgamers.net
Diffstat (limited to 'games/canfield')
-rw-r--r--games/canfield/canfield/canfield.c130
-rw-r--r--games/canfield/cfscores/cfscores.c12
2 files changed, 53 insertions, 89 deletions
diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c
index 978dfb04665..60c8ce2fcfc 100644
--- a/games/canfield/canfield/canfield.c
+++ b/games/canfield/canfield/canfield.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: canfield.c,v 1.9 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: canfield.c,v 1.10 2004/07/09 15:59:26 deraadt Exp $ */
/* $NetBSD: canfield.c,v 1.7 1995/05/13 07:28:35 jtc Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: canfield.c,v 1.9 2003/06/03 03:01:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: canfield.c,v 1.10 2004/07/09 15:59:26 deraadt Exp $";
#endif
#endif /* not lint */
@@ -254,7 +254,7 @@ void usedtalon(void);
* procedure to set the move command box
*/
void
-movebox()
+movebox(void)
{
switch (status) {
case BETTINGBOX:
@@ -289,7 +289,7 @@ movebox()
* print directions above move box
*/
void
-printtopinstructions()
+printtopinstructions(void)
{
move(tboxrow, boxcol);
printw("*----------------------------------*");
@@ -323,7 +323,7 @@ printtopinstructions()
* Print the betting box.
*/
void
-printtopbettingbox()
+printtopbettingbox(void)
{
move(tboxrow, boxcol);
@@ -358,7 +358,7 @@ printtopbettingbox()
* clear info above move box
*/
void
-clearabovemovebox()
+clearabovemovebox(void)
{
int i;
@@ -374,7 +374,7 @@ clearabovemovebox()
* print instructions below move box
*/
void
-printbottominstructions()
+printbottominstructions(void)
{
move(bboxrow, boxcol);
printw("|Replace # with the number of the |");
@@ -388,7 +388,7 @@ printbottominstructions()
* print betting information below move box
*/
void
-printbottombettingbox()
+printbottombettingbox(void)
{
move(bboxrow, boxcol);
printw("|x = toggle information box |");
@@ -402,7 +402,7 @@ printbottombettingbox()
* clear info below move box
*/
void
-clearbelowmovebox()
+clearbelowmovebox(void)
{
int i;
@@ -418,7 +418,7 @@ clearbelowmovebox()
* procedure to put the board on the screen using addressable cursor
*/
void
-makeboard()
+makeboard(void)
{
clear();
refresh();
@@ -457,7 +457,7 @@ makeboard()
* clean up the board for another game
*/
void
-cleanupboard()
+cleanupboard(void)
{
int cnt, row, col;
struct cardtype *ptr;
@@ -513,8 +513,7 @@ cleanupboard()
* procedure to create a deck of cards
*/
void
-initdeck(deck)
- struct cardtype *deck[];
+initdeck(struct cardtype *deck[])
{
int i;
int scnt;
@@ -539,8 +538,7 @@ initdeck(deck)
* procedure to shuffle the deck
*/
void
-shuffle(deck)
- struct cardtype *deck[];
+shuffle(struct cardtype *deck[])
{
int i,j;
struct cardtype *temp;
@@ -563,8 +561,7 @@ shuffle(deck)
* procedure to remove the card from the board
*/
void
-removecard(a, b)
- int a, b;
+removecard(int a, int b)
{
move(b, a);
printw(" ");
@@ -574,10 +571,7 @@ removecard(a, b)
* procedure to print the cards on the board
*/
void
-printrank(a, b, cp, inverse)
- int a, b;
- const struct cardtype *cp;
- bool inverse;
+printrank(int a, int b, const struct cardtype *cp, bool inverse)
{
move(b, a);
if (cp->rank != 10)
@@ -609,9 +603,7 @@ printrank(a, b, cp, inverse)
* procedure to print out a card
*/
void
-printcard(a, b, cp)
- int a, b;
- const struct cardtype *cp;
+printcard(int a, int b, const struct cardtype *cp)
{
if (cp == NIL)
removecard(a, b);
@@ -636,8 +628,7 @@ printcard(a, b, cp)
* of the piles.
*/
void
-transit(source, dest)
- struct cardtype **source, **dest;
+transit(struct cardtype **source, struct cardtype **dest)
{
struct cardtype *temp;
@@ -653,9 +644,7 @@ transit(source, dest)
* the game, so the pile will have exactly one card in it.
*/
void
-fndbase(cp, column, row)
- struct cardtype **cp;
- int column, row;
+fndbase(struct cardtype **cp, int column, int row)
{
bool nomore;
@@ -699,7 +688,7 @@ fndbase(cp, column, row)
* procedure to initialize the things necessary for the game
*/
void
-initgame()
+initgame(void)
{
int i;
@@ -745,7 +734,7 @@ initgame()
* procedure to print the beginning cards and to start each game
*/
void
-startgame()
+startgame(void)
{
int j;
@@ -786,7 +775,7 @@ startgame()
* procedure to clear the message printed from an error
*/
void
-clearmsg()
+clearmsg(void)
{
int i;
@@ -803,7 +792,7 @@ clearmsg()
* procedure to print an error message if the move is not listed
*/
void
-dumberror()
+dumberror(void)
{
errmsg = TRUE;
move(msgrow, msgcol);
@@ -814,7 +803,7 @@ dumberror()
* procedure to print an error message if the move is not possible
*/
void
-destinerror()
+destinerror(void)
{
errmsg = TRUE;
move(msgrow, msgcol);
@@ -825,8 +814,7 @@ destinerror()
* function to see if the source has cards in it
*/
bool
-notempty(cp)
- const struct cardtype *cp;
+notempty(const struct cardtype *cp)
{
if (cp == NIL) {
errmsg = TRUE;
@@ -841,8 +829,7 @@ notempty(cp)
* function to see if the rank of one card is less than another
*/
bool
-ranklower(cp1, cp2)
- const struct cardtype *cp1, *cp2;
+ranklower(const struct cardtype *cp1, const struct cardtype *cp2)
{
if (cp2->rank == Ace)
if (cp1->rank == King)
@@ -859,8 +846,7 @@ ranklower(cp1, cp2)
* function to check the cardcolor for moving to a tableau
*/
bool
-diffcolor(cp1, cp2)
- const struct cardtype *cp1, *cp2;
+diffcolor(const struct cardtype *cp1, const struct cardtype *cp2)
{
if (cp1->color == cp2->color)
return (FALSE);
@@ -872,9 +858,7 @@ diffcolor(cp1, cp2)
* function to see if the card can move to the tableau
*/
bool
-tabok(cp, des)
- const struct cardtype *cp;
- int des;
+tabok(const struct cardtype *cp, int des)
{
if ((cp == stock) && (tableau[des] == NIL))
return (TRUE);
@@ -895,7 +879,7 @@ tabok(cp, des)
* procedure to turn the cards onto the talon from the deck
*/
void
-movetotalon()
+movetotalon(void)
{
int i, fin;
@@ -980,7 +964,7 @@ movetotalon()
* procedure to print card counting info on screen
*/
void
-showstat()
+showstat(void)
{
int row, col;
struct cardtype *ptr;
@@ -1023,7 +1007,7 @@ showstat()
* procedure to clear card counting info from screen
*/
void
-clearstat()
+clearstat(void)
{
int row;
@@ -1043,7 +1027,7 @@ clearstat()
* procedure to update card counting base
*/
void
-usedtalon()
+usedtalon(void)
{
removecard(coldcol, coldrow);
DECRHAND(coldrow, coldcol);
@@ -1068,7 +1052,7 @@ usedtalon()
* procedure to update stock card counting base
*/
void
-usedstock()
+usedstock(void)
{
stockcnt--;
if (Cflag) {
@@ -1081,7 +1065,7 @@ usedstock()
* let 'em know how they lost!
*/
void
-showcards()
+showcards(void)
{
struct cardtype *ptr;
int row;
@@ -1129,7 +1113,7 @@ showcards()
* procedure to update the betting values
*/
void
-updatebettinginfo()
+updatebettinginfo(void)
{
long thiscosts, gamecosts, totalcosts;
double thisreturn, gamereturn, totalreturn;
@@ -1188,9 +1172,7 @@ updatebettinginfo()
* procedure to move a card from the stock or talon to the tableau
*/
void
-simpletableau(cp, des)
- struct cardtype **cp;
- int des;
+simpletableau(struct cardtype **cp, int des)
{
int origin;
@@ -1222,8 +1204,7 @@ simpletableau(cp, des)
* print the tableau
*/
void
-tabprint(sour, des)
- int sour, des;
+tabprint(int sour, int des)
{
int dlength, slength, i;
struct cardtype *tempcard;
@@ -1249,8 +1230,7 @@ tabprint(sour, des)
* procedure to move from the tableau to the tableau
*/
void
-tabtotab(sour, des)
- int sour, des;
+tabtotab(int sour, int des)
{
struct cardtype *temp;
@@ -1276,9 +1256,7 @@ tabtotab(sour, des)
* functions to see if the card can go onto the foundation
*/
bool
-rankhigher(cp, let)
- const struct cardtype *cp;
- int let;
+rankhigher(const struct cardtype *cp, int let)
{
if (found[let]->rank == King)
if (cp->rank == Ace)
@@ -1295,9 +1273,7 @@ rankhigher(cp, let)
* function to determine if two cards are the same suit
*/
int
-samesuit(cp, let)
- const struct cardtype *cp;
- int let;
+samesuit(const struct cardtype *cp, int let)
{
if (cp->suit == found[let]->suit)
return (TRUE);
@@ -1309,9 +1285,7 @@ samesuit(cp, let)
* procedure to move a card to the correct foundation pile
*/
void
-movetofound(cp, source)
- struct cardtype **cp;
- int source;
+movetofound(struct cardtype **cp, int source)
{
tempbase = 0;
mtfdone = FALSE;
@@ -1361,9 +1335,7 @@ movetofound(cp, source)
* procedure to get a command
*/
void
-getcmd(row, col, cp)
- int row, col;
- const char *cp;
+getcmd(int row, int col, const char *cp)
{
char cmd[2] = { '\0', '\0'};
int ch, i;
@@ -1414,7 +1386,7 @@ getcmd(row, col, cp)
* Suspend the game (shell escape if no process control on system)
*/
void
-suspend()
+suspend(void)
{
#ifndef SIGTSTP
char *sh;
@@ -1436,7 +1408,7 @@ suspend()
* procedure to evaluate and make the specific moves
*/
void
-movecard()
+movecard(void)
{
int source, dest;
char osrcpile, odestpile;
@@ -1632,7 +1604,7 @@ const char *const bettinginstructions[] = {
* procedure to printout instructions
*/
void
-instruct()
+instruct(void)
{
const char *const *cp;
@@ -1668,7 +1640,7 @@ instruct()
* procedure to initialize the game
*/
void
-initall()
+initall(void)
{
int i;
@@ -1700,7 +1672,7 @@ initall()
* procedure to end the game
*/
bool
-finish()
+finish(void)
{
int row, col;
@@ -1738,8 +1710,7 @@ finish()
* procedure to clean up and exit
*/
void
-cleanup(dummy)
- int dummy;
+cleanup(int dummy)
{
total.thinktime += 1;
@@ -1762,8 +1733,7 @@ cleanup(dummy)
* Field an interrupt.
*/
void
-askquit(dummy)
- int dummy;
+askquit(int dummy)
{
move(msgrow, msgcol);
printw("Really wish to quit? ");
@@ -1780,9 +1750,7 @@ askquit(dummy)
* Can you tell that this used to be a Pascal program?
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
#ifdef MAXLOAD
double vec[3];
diff --git a/games/canfield/cfscores/cfscores.c b/games/canfield/cfscores/cfscores.c
index 2fd2559ce5b..177f5c2caa2 100644
--- a/games/canfield/cfscores/cfscores.c
+++ b/games/canfield/cfscores/cfscores.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfscores.c,v 1.11 2003/07/10 00:03:01 david Exp $ */
+/* $OpenBSD: cfscores.c,v 1.12 2004/07/09 15:59:26 deraadt Exp $ */
/* $NetBSD: cfscores.c,v 1.3 1995/03/21 15:08:37 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: cfscores.c,v 1.11 2003/07/10 00:03:01 david Exp $";
+static char rcsid[] = "$OpenBSD: cfscores.c,v 1.12 2004/07/09 15:59:26 deraadt Exp $";
#endif
#endif /* not lint */
@@ -70,9 +70,7 @@ int dbfd;
void printuser(const struct passwd *, int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct passwd *pw;
int uid;
@@ -118,9 +116,7 @@ main(argc, argv)
* print out info for specified password entry
*/
void
-printuser(pw, printfail)
- const struct passwd *pw;
- int printfail;
+printuser(const struct passwd *pw, int printfail)
{
struct betinfo total;
int i;