Use int instead of long for money
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.
This commit is contained in:
parent
5ed02791f5
commit
5f46ced826
24 changed files with 73 additions and 73 deletions
|
@ -44,11 +44,11 @@
|
|||
#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)))
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue