]> git.pond.sub.org Git - empserver/commitdiff
Use int instead of long for money
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Jan 2013 16:59:29 +0000 (17:59 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 May 2013 04:57:54 +0000 (06:57 +0200)
Code dealing with money mixes int and long pretty haphazardly.
Harmless, because practical amounts of money fit into int on any
machine capable of running the server.  Clean up anyway.

24 files changed:
include/budg.h
include/econfig-spec.h
include/loan.h
include/nat.h
include/prototypes.h
include/trade.h
src/lib/commands/budg.c
src/lib/commands/coll.c
src/lib/commands/cons.c
src/lib/commands/edit.c
src/lib/commands/fina.c
src/lib/commands/hard.c
src/lib/commands/repa.c
src/lib/commands/shark.c
src/lib/commands/trad.c
src/lib/commands/upgr.c
src/lib/common/nsc.c
src/lib/global/constants.c
src/lib/subs/caploss.c
src/lib/subs/disloan.c
src/lib/update/main.c
src/lib/update/nat.c
src/lib/update/sect.c
tests/smoke/smoke.out

index be130cd492c45c55c5c824337cd6ad4f26439a8c..e6ecf1446ab166ca4ef96412bd697f47fe86fb2e 100644 (file)
@@ -51,11 +51,11 @@ void bp_put_avail(struct bp *, struct sctstr *, int);
 
 int get_materials(struct sctstr *, struct bp *, int *, int);
 
-extern long money[MAXNOC];
+extern int money[MAXNOC];
 extern int pops[MAXNOC];
-extern long sea_money[MAXNOC];
-extern long lnd_money[MAXNOC];
-extern long air_money[MAXNOC];
+extern int sea_money[MAXNOC];
+extern int lnd_money[MAXNOC];
+extern int air_money[MAXNOC];
 extern int tpops[MAXNOC];
 extern float levels[MAXNOC][4];
 
index 5f665ed9a8abf5745739db2630883c06f4e67331..d00c9c1cdfd35d259e612d1feadb8064c29d7897 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Marc Olzheim, 2004
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2013
  */
 
 /*
@@ -208,7 +208,7 @@ EMPCFBOTH("players_at_00", players_at_00, int, NSC_INT, 0,
     "Players have their coordinate system at deity 0,0 (0 - no, 1 - yes)")
 EMPCFBOTH("at_least_one_100", at_least_one_100, int, NSC_INT, KM_INTERNAL,
     "Initialize new countries with at least one sector with 100 of all resource")
-EMPCFBOTH("start_cash", start_cash, long, NSC_LONG, KM_INTERNAL,
+EMPCFBOTH("start_cash", start_cash, int, NSC_INT, KM_INTERNAL,
     "Starting cash for new countries")
 
 EMPCF_COMMENT("\n\n### Technology/Research/Education/Happiness")
index fc5a01ce6a7d54ac575707aec0e00864ca8ae08f..ebed8ebb133037c56d9e78ab9933c0742951402a 100644 (file)
@@ -52,8 +52,8 @@ struct lonstr {
     signed char l_status;      /* loan status */
     int l_irate;               /* interest rate */
     int l_ldur;                        /* intended duration */
-    long l_amtpaid;            /* amount paid so far */
-    long l_amtdue;             /* amount still owed */
+    int l_amtpaid;             /* amount paid so far */
+    int l_amtdue;              /* amount still owed */
     time_t l_lastpay;          /* date of most recent payment */
     time_t l_duedate;          /* date after which interest doubles, etc */
 };
index fc7f6aeab3b0ca15923ee799eea5bfba31a958c9..90336c4b2b2ed44144a199a1431f73aed16e079b 100644 (file)
@@ -106,7 +106,7 @@ struct natstr {
     short nat_btu;             /* bureaucratic time units */
     short nat_access;          /* The tick when BTUs were last updated */
     int nat_reserve;           /* military reserves */
-    long nat_money;            /* moola */
+    int nat_money;             /* moola */
     time_t nat_last_login;     /* time of last login, 0 menas never */
     time_t nat_last_logout;    /* time of last logout, 0 means never */
     time_t nat_newstim;                /* date news last read */
index 8d4866663168e3c82db16edc0677b2602582a291..0291f5e0bc0004dfd9bd9c013cfcd2ab3c811943 100644 (file)
@@ -728,7 +728,7 @@ extern void sail_ship(natid);
 extern void do_fallout(struct sctstr *, int);
 extern void spread_fallout(struct sctstr *, int);
 extern void decay_fallout(struct sctstr *, int);
-extern void produce_sect(int, int, struct bp *, long [][2]);
+extern void produce_sect(int, int, struct bp *, int[][2]);
 /* ship.c */
 extern int prod_ship(int, int, struct bp *, int);
 
index 4b4012ed16b4bd7c2c8b2a0d171f81a62b4e06da..3681eb58305433dcf52ef2d21bf0c3ff5fec433f 100644 (file)
@@ -50,7 +50,7 @@ struct trdstr {
     /* end of part matching struct empobj */
     short trd_type;
     int trd_unitid;
-    long trd_price;
+    int trd_price;
     int trd_maxbidder;
     time_t trd_markettime;
     coord trd_x;               /* destination for teleporting trade */
index 3f1dd758eb6c1c3988636e0f63b70b37723d43ce..461a9122c96cbc0c14b3cb7433968c4a229b91de 100644 (file)
@@ -42,7 +42,7 @@
 #include "optlist.h"
 #include "product.h"
 
-static void calc_all(long (*p_sect)[2], int *taxes, int *Ncivs,
+static void calc_all(int (*p_sect)[2], int *taxes, int *Ncivs,
                     int *Nuws, int *bars, int *Nbars, int *mil,
                     int *ships, int *sbuild, int *nsbuild, int *smaint,
                     int *units, int *lbuild, int *nlbuild, int *lmaint,
@@ -53,7 +53,7 @@ int
 budg(void)
 {
     int i;
-    long p_sect[SCT_BUDG_MAX+1][2];
+    int p_sect[SCT_BUDG_MAX+1][2];
     int taxes, Ncivs, Nuws, bars, Nbars, mil;
     int ships, sbuild, nsbuild, smaint;
     int units, lbuild, nlbuild, lmaint;
@@ -84,12 +84,12 @@ budg(void)
            continue;
        pr("%-17s\t\t", dchr[i].d_name);
        if (i == SCT_ENLIST)
-           pr("%ld mil    \t", p_sect[i][0]);
+           pr("%d mil    \t", p_sect[i][0]);
        else if (dchr[i].d_prd >= 0)
-           pr("%ld %-7s\t", p_sect[i][0], pchr[dchr[i].d_prd].p_sname);
+           pr("%d %-7s\t", p_sect[i][0], pchr[dchr[i].d_prd].p_sname);
        else
            pr("\t\t");
-       pr("\t\t%8ld\n", p_sect[i][1]);
+       pr("\t\t%8d\n", p_sect[i][1]);
        expenses += p_sect[i][1];
     }
 
@@ -129,16 +129,16 @@ budg(void)
     }
 
     if (p_sect[SCT_EFFIC][1]) {
-       sprintf(buf, "%ld sector%s",
+       sprintf(buf, "%d sector%s",
                p_sect[SCT_EFFIC][0], splur(p_sect[SCT_EFFIC][0]));
-       pr("Sector building\t\t\t%-16s\t\t%8ld\n",
+       pr("Sector building\t\t\t%-16s\t\t%8d\n",
           buf, p_sect[SCT_EFFIC][1]);
        expenses += p_sect[SCT_EFFIC][1];
     }
     if (p_sect[SCT_MAINT][0]) {
-       sprintf(buf, "%ld sector%s",
+       sprintf(buf, "%d sector%s",
                p_sect[SCT_MAINT][0], splur(p_sect[SCT_MAINT][0]));
-       pr("Sector maintenance\t\t%-16s\t\t%8ld\n",
+       pr("Sector maintenance\t\t%-16s\t\t%8d\n",
           buf, p_sect[SCT_MAINT][1]);
        expenses += p_sect[SCT_MAINT][1];
     }
@@ -159,7 +159,7 @@ budg(void)
        pr("Income from bars\t\t%-32s%+8d\n", in, bars);
     }
     pr("Total income%s\n", dotsprintf(buf, "%+60d", income));
-    pr("Balance forward\t\t\t\t\t\t      %10ld\n", np->nat_money);
+    pr("Balance forward\t\t\t\t\t\t      %10d\n", np->nat_money);
     pr("Estimated delta\t\t\t\t\t\t      %+10d\n", income - expenses);
     pr("Estimated new treasury%s\n",
        dotsprintf(buf, "%50d", np->nat_money + income - expenses));
@@ -172,7 +172,7 @@ budg(void)
 }
 
 static void
-calc_all(long p_sect[][2],
+calc_all(int p_sect[][2],
         int *taxes, int *Ncivs, int *Nuws, int *bars, int *Nbars, int *mil,
         int *ships, int *sbuild, int *nsbuild, int *smaint,
         int *units, int *lbuild, int *nlbuild, int *lmaint,
index 70810ee9a02d0625958059307875ea89023c8c5c..6c9cc57556a9e637a5c3fd4ccabe7b33a47123f8 100644 (file)
@@ -136,9 +136,9 @@ coll(void)
     } else {
        (void)time(&loan.l_lastpay);
        owed -= pay;
-       loan.l_amtdue = (long)owed;
+       loan.l_amtdue = (int)owed;
        pay += loan.l_amtpaid;
-       loan.l_amtpaid = pay;
+       loan.l_amtpaid = (int)pay;
        wu(0, loan.l_lonee,
           "%s seized %s in partial payment of loan %d.\n",
           cname(player->cnum),
index 712fee4c13b63a0fcac465797c43b5973bc9dec3..27725ce344f8cc19ad7ce7b1076b345da7d0fceb 100644 (file)
@@ -222,7 +222,7 @@ loan_accept(struct ltcomstr *ltcp)
        pr("%s no longer has the funds.\n", cname(ltcp->proposer));
        if (lp->l_amtdue <= 0)
            return RET_FAIL;
-       pr("You may borrow $%ld at the same terms.\n", lp->l_amtdue);
+       pr("You may borrow $%d at the same terms.\n", lp->l_amtdue);
     }
     lender->nat_money -= lp->l_amtdue;
     putnat(lender);
@@ -236,7 +236,7 @@ loan_accept(struct ltcomstr *ltcp)
        return RET_FAIL;
     }
     accpt(ltcp);
-    pr("You are now $%ld richer (sort of).\n", lp->l_amtdue);
+    pr("You are now $%d richer (sort of).\n", lp->l_amtdue);
     return RET_OK;
 }
 
index 1801c19af75917fae122204a5b6453a0ec79155f..ff941085d2be3f752f06190618fc44e9e664e606 100644 (file)
@@ -31,7 +31,7 @@
  *     Chad Zabel, 1994
  *     Steve McClure, 1998-2000
  *     Ron Koenderink, 2003-2009
- *     Markus Armbruster, 2003-2011
+ *     Markus Armbruster, 2003-2013
  */
 
 #include <config.h>
@@ -302,7 +302,7 @@ prnat(struct natstr *np)
     pr("Research <R>: %.2f\n", np->nat_level[NAT_RLEV]);
     pr("Education <E>: %.2f\t\t", np->nat_level[NAT_ELEV]);
     pr("Happiness <H>: %.2f\n", np->nat_level[NAT_HLEV]);
-    pr("Money <M>: $%6ld\n", np->nat_money);
+    pr("Money <M>: $%6d\n", np->nat_money);
     pr("Telegrams <t>: %6d\n", np->nat_tgms);
     if (opt_HIDDEN) {
        pr("Countries contacted: ");
@@ -709,9 +709,9 @@ docountry(char op, int arg, char *p, struct natstr *np)
        np->nat_timeused = arg;
        break;
     case 'M':
-       pr("Money changed from %ld to %d\n", np->nat_money, arg);
+       pr("Money changed from %d to %d\n", np->nat_money, arg);
        wu(player->cnum, nat,
-          "Money changed from %ld to %d by divine intervention.\n",
+          "Money changed from %d to %d by divine intervention.\n",
           np->nat_money, arg);
        np->nat_money = arg;
        break;
index 240fea718934add09a479cd20361ce52281b874d..45725dccf6dfd53f869c2642e956478c6a3259e8 100644 (file)
@@ -66,7 +66,7 @@ fina(void)
        pr(" %-2d  (%3d) %-8.8s  (%3d) %-8.8s  ", ni.cur,
           loan.l_loner, cname(loan.l_loner),
           loan.l_lonee, cname(loan.l_lonee));
-       pr("%3d%%   %3d    %5ld    %7.0f",
+       pr("%3d%%   %3d    %5d    %7.0f",
           loan.l_irate, loan.l_ldur, loan.l_amtpaid,
           ceil(loan_owed(&loan, now)));
        if (now > loan.l_duedate)
index 97885424c38628e75d5ea99b6e4b9dc6f93349e3..a8a9644f2cee728f0fdea8a27d0b8ce6a248ec5e 100644 (file)
@@ -51,7 +51,7 @@ hard(void)
     struct nstr_item ni;
     struct sctstr sect;
     char buf[1024];
-    long cash;
+    int cash;
     struct natstr *natp;
 
     if (!snxtitem(&ni, EF_PLANE, player->argp[1], NULL))
index 0d40d0b91f49f0f1bc18db1f54a493acfece7a4e..e97addc325903db0194e98c297634a50aff377ce 100644 (file)
@@ -46,7 +46,7 @@ repa(void)
     struct natstr *loaner;
     int loan_num;
     int payment;
-    long newdue;
+    int newdue;
     char *cp;
     time_t now;
     char buf[1024];
@@ -75,13 +75,13 @@ repa(void)
     if (payment <= 0)
        return RET_SYN;
 
-    newdue = (long)ceil(loan_owed(&loan, time(&now)) - payment);
+    newdue = (int)ceil(loan_owed(&loan, time(&now)) - payment);
     if (newdue < 0) {
        pr("You don't owe that much.\n");
        return RET_FAIL;
     }
     if (natp->nat_money < payment) {
-       pr("You only have $%ld.\n", natp->nat_money);
+       pr("You only have $%d.\n", natp->nat_money);
        return RET_FAIL;
     }
     player->dolcost += payment;
index 29a52d14b43962d29d57f6f86ee77ef7a6184368..11a796f17d31a602913658112be04405770d07d4 100644 (file)
@@ -48,7 +48,7 @@ shark(void)
     struct natstr *natp;
     struct natstr *oldie;
     double owed;
-    long payment;
+    int payment;
     char buf[1024];
 
     if (!opt_LOANS) {
@@ -78,7 +78,7 @@ shark(void)
     }
     pr("That loan is worth $%.2f.\n", owed);
     natp = getnatp(player->cnum);
-    payment = (long)ceil(owed * (1.0 + loan.l_irate / 100.0));
+    payment = (int)ceil(owed * (1.0 + loan.l_irate / 100.0));
     if (payment > natp->nat_money - 100.0) {
        pr("You do not have enough to cover that loan\n");
        return RET_FAIL;
@@ -87,7 +87,7 @@ shark(void)
           "%s bought loan #%d.  You now owe him!\n",
           cname(player->cnum), arg);
        wu(0, loan.l_loner,
-          "%s bought loan #%d out from under you for %ld\n",
+          "%s bought loan #%d out from under you for %d\n",
           cname(player->cnum), arg, payment);
        pr("You now own loan #%d.  Go break some legs.\n", arg);
     }
index ed5879629fbb0cd8bbbac88837194b40d377ed06..a53da4d1ec12f15e1f919d5cdddd3daaeeee00c6 100644 (file)
@@ -30,6 +30,7 @@
  *     Dave Pare, 1986
  *     Pat Loney, 1992
  *     Steve McClure, 1996-2000
+ *     Markus Armbruster, 2004-2013
  */
 
 #include <config.h>
@@ -102,7 +103,7 @@ trad(void)
            TRADE_DELAY / 3600.0 - (now - trade.trd_markettime) / 3600.0;
        if (tleft < 0.0)
            tleft = 0.0;
-       pr("$%7ld  %2d %5.2f hrs ",
+       pr("$%7d  %2d %5.2f hrs ",
           trade.trd_price, trade.trd_maxbidder, tleft);
        trade_desc(&tg.gen);    /* XXX */
        pr("\n");
index 161525ff53ad202a0c4ac4adf453747ec6139072..7f4aedbfcf971e7f22274192095521939bcec596 100644 (file)
@@ -83,7 +83,7 @@ lupgr(void)
     int n;
     int tlev;
     int avail, cost;
-    long cash;
+    int cash;
 
     if (!snxtitem(&ni, EF_LAND, player->argp[2], NULL))
        return RET_SYN;
@@ -163,7 +163,7 @@ supgr(void)
     int n;
     int tlev;
     int avail, cost;
-    long cash;
+    int cash;
 
     if (!snxtitem(&ni, EF_SHIP, player->argp[2], NULL))
        return RET_SYN;
@@ -242,7 +242,7 @@ pupgr(void)
     int n;
     int tlev;
     int avail, cost;
-    long cash;
+    int cash;
 
     if (!snxtitem(&ni, EF_PLANE, player->argp[2], NULL))
        return RET_SYN;
index 643d688d3ba8417aa1f1327601973d5a7b7b34e3..bc50dcb1734afee580dc599b854cea4a8d2e9dac 100644 (file)
@@ -460,8 +460,8 @@ struct castr loan_ca[] = {
      EF_AGREEMENT_STATUS, 0},
     {"irate", fldoff(l_irate), NSC_INT, 0, NULL, EF_BAD, 0},
     {"ldur", fldoff(l_ldur), NSC_INT, 0, NULL, EF_BAD, 0},
-    {"amtpaid", fldoff(l_amtpaid), NSC_LONG, 0, NULL, EF_BAD, 0},
-    {"amtdue", fldoff(l_amtdue), NSC_LONG, 0, NULL, EF_BAD, 0},
+    {"amtpaid", fldoff(l_amtpaid), NSC_INT, 0, NULL, EF_BAD, 0},
+    {"amtdue", fldoff(l_amtdue), NSC_INT, 0, NULL, EF_BAD, 0},
     {"lastpay", fldoff(l_lastpay), NSC_TIME, 0, NULL, EF_BAD, 0},
     {"duedate", fldoff(l_duedate), NSC_TIME, 0, NULL, EF_BAD, 0},
     {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0}
@@ -526,7 +526,7 @@ struct castr trade_ca[] = {
     {"type", fldoff(trd_type), NSC_CHAR, 0, NULL, EF_TABLE, 0},
     /* unitid's ca_table given by type, but can't express that: */
     {"unitid", fldoff(trd_unitid), NSC_INT, 0, NULL, EF_BAD, 0},
-    {"price", fldoff(trd_price), NSC_LONG, 0, NULL, EF_BAD, 0},
+    {"price", fldoff(trd_price), NSC_INT, 0, NULL, EF_BAD, 0},
     {"maxbidder", fldoff(trd_maxbidder), NSC_INT, 0, NULL, EF_NATION, 0},
     {"markettime", fldoff(trd_markettime), NSC_TIME, 0, NULL, EF_BAD, 0},
     /* should let maxbidder access xloc, yloc, but can't express that: */
@@ -575,7 +575,7 @@ struct castr cou_ca[] = {
     {"btu", fldoff(nat_btu), NSC_SHORT, 0, NULL, EF_BAD, 0},
     {"access", fldoff(nat_access), NSC_SHORT, 0, NULL, EF_BAD, 0},
     {"milreserve", fldoff(nat_reserve), NSC_INT, 0, NULL, EF_BAD, 0},
-    {"money", fldoff(nat_money), NSC_LONG, 0, NULL, EF_BAD, 0},
+    {"money", fldoff(nat_money), NSC_INT, 0, NULL, EF_BAD, 0},
     {"login", fldoff(nat_last_login), NSC_TIME, 0, NULL, EF_BAD, 0},
     {"logout", fldoff(nat_last_logout), NSC_TIME, 0, NULL, EF_BAD, 0},
     {"newstim", fldoff(nat_newstim), NSC_TIME, 0, NULL, EF_BAD, 0},
index f818a9ac46f48feb0bdbd923a439882145e7076b..c7cbb431dc8b0cf5c219c6098d5bfb05c882d959 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Ken Stevens, 1995
  *     Steve McClure, 1996
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2013
  */
 
 #include <config.h>
@@ -209,7 +209,7 @@ float trade_ally_cut = 0.10;        /* 10% bonus for ally you trade with */
 
 int torpedo_damage = 40;       /* damage is X + 1dX + 1dX, so 40+1d40+1d40 */
 
-long start_cash = 25000;
+int start_cash = 25000;
 
 /* initial levels */
 float start_education = 0.0;
index 53d1568d80d1ab2cf1e291e7bef051f814c56b30..1bcb6e71594586cbedf9003f900488475d031ffd 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 2000
- *     Markus Armbruster, 2007-2008
+ *     Markus Armbruster, 2007-2013
  */
 
 #include <config.h>
@@ -49,8 +49,7 @@ caploss(struct sctstr *sp, natid coun, char *msg)
     struct natstr *natp;
     struct lonstr loan;
     struct comstr comm;
-    long lose;
-    long gain;
+    int lose, gain;
     char *verb;
     int loan_num, comm_num;
 
@@ -81,9 +80,9 @@ caploss(struct sctstr *sp, natid coun, char *msg)
     verb = sp->sct_own ? "sacked" : "obliterated";
     wu(0, coun, "* %s just %s your capital! *\n",
        cname(player->cnum), verb);
-    wu(0, coun, "You lost $%ld and they gained $%ld\n", lose, gain);
+    wu(0, coun, "You lost $%d and they gained $%d\n", lose, gain);
     wu(0, coun, "You need to use 'capital' to activate a new capital.\n");
-    wu(0, 0, "%s just %s %s's capital and gained $%ld\n",
+    wu(0, 0, "%s just %s %s's capital and gained $%d\n",
        cname(player->cnum), verb, cname(coun), gain);
 
     if (opt_LOANS && sp->sct_own) {
index 050c083c494a799df187ca44d00183a7bb6802be..524487cf71930592b7bc101601b75a74afc8d3cc 100644 (file)
@@ -67,7 +67,7 @@ disloan(int n, struct lonstr *loan)
     pr("\nLoan #%d from %s to", n, cname(loan->l_loner));
     pr(" %s\n", cname(loan->l_lonee));
     if (loan->l_status == LS_PROPOSED) {
-       pr("(proposed) principal=$%ld interest rate=%d%%",
+       pr("(proposed) principal=$%d interest rate=%d%%",
           loan->l_amtdue, loan->l_irate);
        pr(" duration(days)=%d\n", loan->l_ldur);
        if (loan->l_duedate < now) {
@@ -81,7 +81,7 @@ disloan(int n, struct lonstr *loan)
        return 1;
     }
 
-    pr("Amount paid to date $%ld\n", loan->l_amtpaid);
+    pr("Amount paid to date $%d\n", loan->l_amtpaid);
     pr("Amount due (if paid now) $%.2f", loan_owed(loan, now));
     if (now <= loan->l_duedate) {
        pr(" (if paid on due date) $%.2f\n",
index 7f1d026f41c03e4b245ab1c0acbc5a4ba6efb204..1de77666fb46adf00574dfd915941a4366b8a06d 100644 (file)
 #include "unit.h"
 #include "update.h"
 
-long money[MAXNOC];
+int money[MAXNOC];
 int pops[MAXNOC];
-long sea_money[MAXNOC];
-long lnd_money[MAXNOC];
-long air_money[MAXNOC];
+int sea_money[MAXNOC];
+int lnd_money[MAXNOC];
+int air_money[MAXNOC];
 int tpops[MAXNOC];
 
 void
@@ -103,7 +103,7 @@ update_main(void)
     logerror("done preparing sectors.");
     logerror("producing for countries...");
     for (i = 0; i < MAXNOC; i++) {
-       long p_sect[SCT_BUDG_MAX+1][2];
+       int p_sect[SCT_BUDG_MAX+1][2];
 
        memset(p_sect, 0, sizeof(p_sect));
        if (!(np = getnatp(i)))
index e735db3fb642832dfc0d3119c4ed8364912cbc3d..dff485d5ce042828b1186bd60845e6ba6cc5a933 100644 (file)
@@ -203,9 +203,9 @@ prod_nat(int etu)
        if ((sea_money[n] != 0) || (air_money[n] != 0) ||
            (lnd_money[n] != 0))
            wu(0, n,
-              "Army delta $%ld, Navy delta $%ld, Air force delta $%ld\n",
+              "Army delta $%d, Navy delta $%d, Air force delta $%d\n",
               lnd_money[n], sea_money[n], air_money[n]);
-       wu(0, n, "money delta was $%ld for this update\n",
+       wu(0, n, "money delta was $%d for this update\n",
           np->nat_money - money[n]);
        if (opt_LOSE_CONTACT) {
            for (cn = 1; cn < MAXNOC; cn++) {
index 0bf31bf7e3d262e3f097d95eabe1f4ab195c469d..d36aa255f993222d2455006324b58dafd5519b24 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Dave Pare, 1986
  *     Steve McClure, 1996
- *     Markus Armbruster, 2004-2010
+ *     Markus Armbruster, 2004-2013
  */
 
 #include <config.h>
@@ -257,7 +257,7 @@ decay_fallout(struct sctstr *sp, int etus)
  * Produce for a specific nation
  */
 void
-produce_sect(int natnum, int etu, struct bp *bp, long p_sect[][2])
+produce_sect(int natnum, int etu, struct bp *bp, int p_sect[][2])
 {
     struct sctstr *sp;
     struct natstr *np;
index 835d4b6b0d314412bb59734c7b8c4edbb3c70153..6cc169fa0d65cc843f20d7f57ed982b164f0757f 100644 (file)
@@ -242,7 +242,7 @@ Player 00 Turn 00 starting
 "owner" 5 0 0 9
 "type" 4 0 0 27
 "unitid" 8 0 0 -1
-"price" 1 0 0 -1
+"price" 8 0 0 -1
 "maxbidder" 8 0 0 9
 "markettime" 12 0 0 -1
 "xloc" 9 1 0 -1
@@ -269,7 +269,7 @@ Player 00 Turn 00 starting
 "btu" 6 1 0 -1
 "access" 6 1 0 -1
 "milreserve" 8 1 0 -1
-"money" 1 1 0 -1
+"money" 8 1 0 -1
 "login" 12 1 0 -1
 "logout" 12 1 0 -1
 "newstim" 12 1 0 -1
@@ -290,8 +290,8 @@ Player 00 Turn 00 starting
 "status" 4 0 0 30
 "irate" 8 0 0 -1
 "ldur" 8 0 0 -1
-"amtpaid" 1 0 0 -1
-"amtdue" 1 0 0 -1
+"amtpaid" 8 0 0 -1
+"amtdue" 8 0 0 -1
 "lastpay" 12 0 0 -1
 "duedate" 12 0 0 -1
 /10
@@ -758,7 +758,7 @@ Player 00 Turn 00 starting
 "btu" 6 0 0 -1
 "access" 6 0 0 -1
 "milreserve" 8 0 0 -1
-"money" 1 0 0 -1
+"money" 8 0 0 -1
 "login" 12 0 0 -1
 "logout" 12 0 0 -1
 "newstim" 12 0 0 -1
@@ -1163,7 +1163,7 @@ CENSUS                   del dst
 "owner" 5 0 0 9
 "type" 4 0 0 27
 "unitid" 8 0 0 -1
-"price" 1 0 0 -1
+"price" 8 0 0 -1
 "maxbidder" 8 0 0 9
 "markettime" 12 0 0 -1
 /7
@@ -1183,8 +1183,8 @@ CENSUS                   del dst
 "status" 4 0 0 30
 "irate" 8 0 0 -1
 "ldur" 8 0 0 -1
-"amtpaid" 1 0 0 -1
-"amtdue" 1 0 0 -1
+"amtpaid" 8 0 0 -1
+"amtdue" 8 0 0 -1
 "lastpay" 12 0 0 -1
 "duedate" 12 0 0 -1
 /10
@@ -1645,7 +1645,7 @@ CENSUS                   del dst
 "btu" 6 0 0 -1
 "access" 6 0 0 -1
 "milreserve" 8 0 0 -1
-"money" 1 0 0 -1
+"money" 8 0 0 -1
 "login" 12 0 0 -1
 "logout" 12 0 0 -1
 "newstim" 12 0 0 -1