diff --git a/include/nat.h b/include/nat.h index 3243d2ae..fc7f6aea 100644 --- a/include/nat.h +++ b/include/nat.h @@ -105,7 +105,7 @@ struct natstr { int nat_timeused; /* number of seconds used today */ short nat_btu; /* bureaucratic time units */ short nat_access; /* The tick when BTUs were last updated */ - long nat_reserve; /* military reserves */ + int nat_reserve; /* military reserves */ long 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 */ diff --git a/src/lib/commands/budg.c b/src/lib/commands/budg.c index df2b9d38..3f1dd758 100644 --- a/src/lib/commands/budg.c +++ b/src/lib/commands/budg.c @@ -144,7 +144,7 @@ budg(void) } if (mil) { n = (mil - np->nat_reserve * money_res * etu) / (etu * money_mil); - sprintf(in, "%d mil, %d res", n, (int)np->nat_reserve); + sprintf(in, "%d mil, %d res", n, np->nat_reserve); pr("Military payroll\t\t%-32s%8d\n", in, -mil); expenses -= mil; } diff --git a/src/lib/commands/demo.c b/src/lib/commands/demo.c index afb0fdaf..f4e430e9 100644 --- a/src/lib/commands/demo.c +++ b/src/lib/commands/demo.c @@ -105,7 +105,7 @@ demo(void) } pr("Total new civilians : %d\n", mil_demob); if (*p == 'y') - pr("Military reserve stands at %ld (up %d)\n", + pr("Military reserve stands at %d (up %d)\n", natp->nat_reserve + reserves, reserves); if (reserves > 0) { natp->nat_reserve += reserves; diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index 04f07371..1801c19a 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -291,7 +291,7 @@ prnat(struct natstr *np) pr("Name : %-20s\t", np->nat_cnam); pr("Representative : %-20s\n", np->nat_pnam); pr("BTUs : %3d\t\t\t", np->nat_btu); - pr("Reserves : %5ld\n", np->nat_reserve); + pr("Reserves : %5d\n", np->nat_reserve); pr("Capital : %s\t\t", xyas(np->nat_xcap, np->nat_ycap, player->cnum)); pr("Origin : %3s\n", @@ -674,10 +674,10 @@ docountry(char op, int arg, char *p, struct natstr *np) break; case 'm': benefit(nat, np->nat_reserve < arg); - pr("Military reserves changed from %ld to %d\n", + pr("Military reserves changed from %d to %d\n", np->nat_reserve, arg); wu(player->cnum, nat, - "Military reserves changed from %ld to %d by divine intervention.\n", + "Military reserves changed from %d to %d by divine intervention.\n", np->nat_reserve, arg); np->nat_reserve = arg; break; diff --git a/src/lib/commands/enli.c b/src/lib/commands/enli.c index 7986ed52..7e72549b 100644 --- a/src/lib/commands/enli.c +++ b/src/lib/commands/enli.c @@ -47,7 +47,7 @@ enli(void) int newmil; int milwant; int totalmil; - long reserve; + int reserve; char *p; int quota; char prompt[128]; @@ -123,7 +123,7 @@ enli(void) } } pr("Total new enlistment : %d\n", totalmil); - pr("Military reserves stand at %ld\n", reserve); + pr("Military reserves stand at %d\n", reserve); if (totalmil) { natp->nat_reserve -= totalmil; putnat(natp); diff --git a/src/lib/commands/nati.c b/src/lib/commands/nati.c index 8c9d63a7..f222e9ca 100644 --- a/src/lib/commands/nati.c +++ b/src/lib/commands/nati.c @@ -79,7 +79,7 @@ nati(void) } } pr(" The treasury has $%.2f", (double)natp->nat_money); - pr(" Military reserves: %ld\n", natp->nat_reserve); + pr(" Military reserves: %d\n", natp->nat_reserve); pr("Education..........%6.2f Happiness.......%6.2f\n", natp->nat_level[NAT_ELEV], natp->nat_level[NAT_HLEV]); pr("Technology.........%6.2f Research........%6.2f\n", diff --git a/src/lib/common/nsc.c b/src/lib/common/nsc.c index a03d573f..643d688d 100644 --- a/src/lib/common/nsc.c +++ b/src/lib/common/nsc.c @@ -574,7 +574,7 @@ struct castr cou_ca[] = { {"timeused", fldoff(nat_timeused), NSC_INT, 0, NULL, EF_BAD, 0}, {"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_LONG, 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}, {"login", fldoff(nat_last_login), NSC_TIME, 0, NULL, EF_BAD, 0}, {"logout", fldoff(nat_last_logout), NSC_TIME, 0, NULL, EF_BAD, 0}, diff --git a/tests/smoke/smoke.out b/tests/smoke/smoke.out index 0dfa98b6..835d4b6b 100644 --- a/tests/smoke/smoke.out +++ b/tests/smoke/smoke.out @@ -268,7 +268,7 @@ Player 00 Turn 00 starting "timeused" 8 1 0 -1 "btu" 6 1 0 -1 "access" 6 1 0 -1 -"milreserve" 1 1 0 -1 +"milreserve" 8 1 0 -1 "money" 1 1 0 -1 "login" 12 1 0 -1 "logout" 12 1 0 -1 @@ -757,7 +757,7 @@ Player 00 Turn 00 starting "timeused" 8 0 0 -1 "btu" 6 0 0 -1 "access" 6 0 0 -1 -"milreserve" 1 0 0 -1 +"milreserve" 8 0 0 -1 "money" 1 0 0 -1 "login" 12 0 0 -1 "logout" 12 0 0 -1 @@ -1644,7 +1644,7 @@ CENSUS del dst "timeused" 8 0 0 -1 "btu" 6 0 0 -1 "access" 6 0 0 -1 -"milreserve" 1 0 0 -1 +"milreserve" 8 0 0 -1 "money" 1 0 0 -1 "login" 12 0 0 -1 "logout" 12 0 0 -1