Use int instead of long for military reserves

Code dealing with reserves mixes int and long pretty haphazardly.
Harmless, because practical reserves fit easily on any machine capable
of running the server.  Clean up anyway.
This commit is contained in:
Markus Armbruster 2013-01-13 16:13:15 +01:00
parent 5d7f011900
commit 74b8b9932d
8 changed files with 13 additions and 13 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -291,7 +291,7 @@ prnat(struct natstr *np)
pr("Name <n>: %-20s\t", np->nat_cnam);
pr("Representative <r>: %-20s\n", np->nat_pnam);
pr("BTUs <b>: %3d\t\t\t", np->nat_btu);
pr("Reserves <m>: %5ld\n", np->nat_reserve);
pr("Reserves <m>: %5d\n", np->nat_reserve);
pr("Capital <c>: %s\t\t",
xyas(np->nat_xcap, np->nat_ycap, player->cnum));
pr("Origin <o>: %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;

View file

@ -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);

View file

@ -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",