]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - monop/cards.c
Merge upstream (can't test, hopefully nothing broke)
[bsdgames-darwin.git] / monop / cards.c
index 6dbbd46315f313f67936e6839db181ad3ea6fa80..34ac5c7181978a740b621f015847e2f08aa7f432 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: cards.c,v 1.23 2008/02/24 03:56:48 christos Exp $      */
+/*     $NetBSD: cards.c,v 1.27 2014/12/29 10:38:52 jnemeth Exp $       */
 
 /*
  * Copyright (c) 1980, 1993
 #if 0
 static char sccsid[] = "@(#)cards.c    8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: cards.c,v 1.23 2008/02/24 03:56:48 christos Exp $");
+__RCSID("$NetBSD: cards.c,v 1.27 2014/12/29 10:38:52 jnemeth Exp $");
 #endif
 #endif /* not lint */
 
 #include <sys/types.h>
-#include <sys/endian.h>
+#include <sys/_endian.h>
 #include "monop.h"
 #include "deck.h"
 
@@ -132,7 +132,7 @@ static const struct cardinfo ch_cards[] = {
        { "MU",
                "Advance to the nearest Utility.\n"
                "If unowned, you may buy it from the bank.\n"
-               "If owned, throw dice and pay oner a total of ten times\n"
+               "If owned, throw dice and pay owner a total of ten times\n"
                "the amount thrown.\n"
        },
        { "MB3",
@@ -190,7 +190,7 @@ static const struct cardinfo ch_cards[] = {
  * This routine initializes the decks from the data above.
  */
 void
-init_decks()
+init_decks(void)
 {
        CC_D.info = cc_cards;
        CC_D.num_cards = sizeof(cc_cards) / sizeof(cc_cards[0]);
@@ -204,8 +204,7 @@ init_decks()
  *     This routine sets up the offset pointers for the given deck.
  */
 static void
-set_up(dp)
-       DECK *dp;
+set_up(DECK *dp)
 {
        int r1, r2;
        int i;
@@ -235,8 +234,7 @@ set_up(dp)
  *     This routine draws a card from the given deck
  */
 void
-get_card(dp)
-       DECK *dp;
+get_card(DECK *dp)
 {
        char type_maj, type_min;
        int num;
@@ -247,7 +245,7 @@ get_card(dp)
        do {
                thiscard = &dp->info[dp->top_card];
                type_maj = thiscard->actioncode[0];
-               dp->top_card = ++(dp->top_card) % dp->num_cards;
+               dp->top_card = (dp->top_card + 1) % dp->num_cards;
        } while (dp->gojf_used && type_maj == GOJF);
        type_min = thiscard->actioncode[1];
        num = atoi(thiscard->actioncode+2);
@@ -358,8 +356,7 @@ printmes(const char *text)
  * deck.
  */
 void
-ret_card(plr)
-       PLAY *plr;
+ret_card(PLAY *plr)
 {
        char type_maj;
        int gojfpos, last_card;