From 1c75ca2e2dc72d118edbb854455e602d70d80a52 Mon Sep 17 00:00:00 2001 From: rillig Date: Sun, 2 May 2021 12:50:43 +0000 Subject: games: remove trailing whitespace in *.c and *.h --- canfield/canfield/canfield.c | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'canfield') diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c index 157507d0..67a15982 100644 --- a/canfield/canfield/canfield.c +++ b/canfield/canfield/canfield.c @@ -1,4 +1,4 @@ -/* $NetBSD: canfield.c,v 1.30 2014/03/22 23:47:03 dholland Exp $ */ +/* $NetBSD: canfield.c,v 1.31 2021/05/02 12:50:44 rillig Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: canfield.c,v 1.30 2014/03/22 23:47:03 dholland Exp $"); +__RCSID("$NetBSD: canfield.c,v 1.31 2021/05/02 12:50:44 rillig Exp $"); #endif #endif /* not lint */ @@ -182,7 +182,7 @@ static uid_t uid; #define maxtimecharge 3 #define valuepercardup 5 /* - * Variables associated with betting + * Variables associated with betting */ static struct betinfo this, game, total; static bool startedgame = FALSE, infullgame = FALSE; @@ -614,7 +614,7 @@ printcard(int a, int b, const struct cardtype *cp) } /* - * procedure to move the top card from one location to the top + * procedure to move the top card from one location to the top * of another location. The pointers always point to the top * of the piles. */ @@ -622,7 +622,7 @@ static void transit(struct cardtype **source, struct cardtype **dest) { struct cardtype *temp; - + temp = *source; *source = (*source)->next; temp->next = *dest; @@ -670,7 +670,7 @@ fndbase(struct cardtype **cp, int column, int row) game.wins += valuepercardup; total.wins += valuepercardup; } - } else + } else nomore = TRUE; } while (nomore == FALSE); } @@ -812,7 +812,7 @@ notempty(const struct cardtype *cp) move(msgrow, msgcol); printw("Error: no cards to move"); return (FALSE); - } else + } else return (TRUE); } @@ -822,14 +822,14 @@ notempty(const struct cardtype *cp) static bool ranklower(const struct cardtype *cp1, const struct cardtype *cp2) { - if (cp2->rank == Ace) + if (cp2->rank == Ace) if (cp1->rank == King) return (TRUE); - else + else return (FALSE); else if (cp1->rank + 1 == cp2->rank) return (TRUE); - else + else return (FALSE); } @@ -841,7 +841,7 @@ diffcolor(const struct cardtype *cp1, const struct cardtype *cp2) { if (cp1->color == cp2->color) return (FALSE); - else + else return (TRUE); } @@ -854,15 +854,15 @@ tabok(const struct cardtype *cp, int des) if ((cp == stock) && (tableau[des] == NIL)) return (TRUE); else if (tableau[des] == NIL) - if (stock == NIL && - cp != bottom[0] && cp != bottom[1] && + if (stock == NIL && + cp != bottom[0] && cp != bottom[1] && cp != bottom[2] && cp != bottom[3]) return (TRUE); - else + else return (FALSE); else if (ranklower(cp, tableau[des]) && diffcolor(cp, tableau[des])) return (TRUE); - else + else return (FALSE); } @@ -1187,7 +1187,7 @@ simpletableau(struct cardtype **cp, int des) usedtalon(); printcard(taloncol, talonrow, talon); } - } else + } else destinerror(); } } @@ -1207,7 +1207,7 @@ tabprint(int sour, int des) slength = length[sour]; if (slength == tabrow) printcard(pilemap[des], dlength, tableau[sour]); - else + else while (slength != tabrow - 1) { tempcard = tableau[sour]; for (i=1; i<=slength-tabrow; i++) @@ -1236,11 +1236,11 @@ tabtotab(int sour, int des) temp->next = tableau[des]; tableau[des] = tableau[sour]; tableau[sour] = NIL; - length[des] = length[des] + + length[des] = length[des] + (length[sour] - (tabrow - 1)); length[sour] = tabrow - 1; timesthru = 0; - } else + } else destinerror(); } } @@ -1254,11 +1254,11 @@ rankhigher(const struct cardtype *cp, int let) if (found[let]->rank == King) if (cp->rank == Ace) return(TRUE); - else + else return(FALSE); else if (cp->rank - 1 == found[let]->rank) return(TRUE); - else + else return(FALSE); } @@ -1270,7 +1270,7 @@ samesuit(const struct cardtype *cp, int let) { if (cp->suit == found[let]->suit) return (TRUE); - else + else return (FALSE); } @@ -1299,14 +1299,14 @@ movetofound(struct cardtype **cp, int source) timesthru = 0; if (mtforigin == stk) { usedstock(); - printcard(stockcol, stockrow, + printcard(stockcol, stockrow, stock); } else if (mtforigin == tal) { usedtalon(); - printcard(taloncol, talonrow, + printcard(taloncol, talonrow, talon); } else { - removecard(pilemap[source], + removecard(pilemap[source], length[source]); length[source]--; } @@ -1319,7 +1319,7 @@ movetofound(struct cardtype **cp, int source) mtfdone = TRUE; } else tempbase++; - else + else tempbase++; } while ((tempbase != 4) && !mtfdone); if (!mtfdone) -- cgit v1.2.3-56-ge451