Use int instead of long to count people
Code dealing with counting people mixes int and long pretty haphazardly. Harmless, because practical populations fit into int easily on any machine capable of running the server. Clean up anyway.
This commit is contained in:
parent
948757cb0c
commit
5d7f011900
6 changed files with 12 additions and 12 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* Known contributors to this file:
|
* Known contributors to this file:
|
||||||
* Ville Virrankoski, 1995
|
* Ville Virrankoski, 1995
|
||||||
* Markus Armbruster, 2004-2009
|
* Markus Armbruster, 2004-2013
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BUDG_H
|
#ifndef BUDG_H
|
||||||
|
@ -52,11 +52,11 @@ void bp_put_avail(struct bp *, struct sctstr *, int);
|
||||||
int get_materials(struct sctstr *, struct bp *, int *, int);
|
int get_materials(struct sctstr *, struct bp *, int *, int);
|
||||||
|
|
||||||
extern long money[MAXNOC];
|
extern long money[MAXNOC];
|
||||||
extern long pops[MAXNOC];
|
extern int pops[MAXNOC];
|
||||||
extern long sea_money[MAXNOC];
|
extern long sea_money[MAXNOC];
|
||||||
extern long lnd_money[MAXNOC];
|
extern long lnd_money[MAXNOC];
|
||||||
extern long air_money[MAXNOC];
|
extern long air_money[MAXNOC];
|
||||||
extern long tpops[MAXNOC];
|
extern int tpops[MAXNOC];
|
||||||
extern float levels[MAXNOC][4];
|
extern float levels[MAXNOC][4];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -708,7 +708,7 @@ extern int prod_plane(int, int, struct bp *, int);
|
||||||
extern void populace(struct natstr *, struct sctstr *, int);
|
extern void populace(struct natstr *, struct sctstr *, int);
|
||||||
extern int total_work(int, int, int, int, int, int);
|
extern int total_work(int, int, int, int, int, int);
|
||||||
/* prepare.c */
|
/* prepare.c */
|
||||||
extern void tax(struct sctstr *, struct natstr *, int, long *, int *,
|
extern void tax(struct sctstr *, struct natstr *, int, int *, int *,
|
||||||
int *, int *);
|
int *, int *);
|
||||||
extern int upd_slmilcosts(natid, int);
|
extern int upd_slmilcosts(natid, int);
|
||||||
extern void prepare_sects(int, struct bp *);
|
extern void prepare_sects(int, struct bp *);
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
* Thomas Ruschak, 1992
|
* Thomas Ruschak, 1992
|
||||||
* Ville Virrankoski, 1995
|
* Ville Virrankoski, 1995
|
||||||
* Steve McClure, 1997-2000
|
* Steve McClure, 1997-2000
|
||||||
* Markus Armbruster, 2004-2009
|
* Markus Armbruster, 2004-2013
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -180,7 +180,7 @@ calc_all(long p_sect[][2],
|
||||||
{
|
{
|
||||||
struct natstr *np;
|
struct natstr *np;
|
||||||
struct bp *bp;
|
struct bp *bp;
|
||||||
long pop = 0;
|
int pop = 0;
|
||||||
int n, civ_tax, uw_tax, mil_pay;
|
int n, civ_tax, uw_tax, mil_pay;
|
||||||
struct sctstr *sp;
|
struct sctstr *sp;
|
||||||
int etu = etu_per_update;
|
int etu = etu_per_update;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
* Dave Pare, 1994
|
* Dave Pare, 1994
|
||||||
* Steve McClure, 1996
|
* Steve McClure, 1996
|
||||||
* Doug Hay, 1998
|
* Doug Hay, 1998
|
||||||
* Markus Armbruster, 2006-2011
|
* Markus Armbruster, 2006-2013
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
@ -45,11 +45,11 @@
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
|
|
||||||
long money[MAXNOC];
|
long money[MAXNOC];
|
||||||
long pops[MAXNOC];
|
int pops[MAXNOC];
|
||||||
long sea_money[MAXNOC];
|
long sea_money[MAXNOC];
|
||||||
long lnd_money[MAXNOC];
|
long lnd_money[MAXNOC];
|
||||||
long air_money[MAXNOC];
|
long air_money[MAXNOC];
|
||||||
long tpops[MAXNOC];
|
int tpops[MAXNOC];
|
||||||
|
|
||||||
void
|
void
|
||||||
update_main(void)
|
update_main(void)
|
||||||
|
|
|
@ -122,7 +122,7 @@ prod_nat(int etu)
|
||||||
float hap;
|
float hap;
|
||||||
float edu;
|
float edu;
|
||||||
float hap_edu;
|
float hap_edu;
|
||||||
long pop;
|
int pop;
|
||||||
double rlev;
|
double rlev;
|
||||||
double tlev;
|
double tlev;
|
||||||
double tech[MAXNOC];
|
double tech[MAXNOC];
|
||||||
|
@ -173,7 +173,7 @@ prod_nat(int etu)
|
||||||
limit_level(levels[n][NAT_TLEV] / 1, NAT_TLEV, 0) * 1;
|
limit_level(levels[n][NAT_TLEV] / 1, NAT_TLEV, 0) * 1;
|
||||||
levels[n][NAT_RLEV] =
|
levels[n][NAT_RLEV] =
|
||||||
limit_level(levels[n][NAT_RLEV] / 1, NAT_RLEV, 0) * 1;
|
limit_level(levels[n][NAT_RLEV] / 1, NAT_RLEV, 0) * 1;
|
||||||
wu(0, n, "total pop was %ld, yielding %4.2f hap, %4.2f edu\n",
|
wu(0, n, "total pop was %d, yielding %4.2f hap, %4.2f edu\n",
|
||||||
pop - 1, hap, edu);
|
pop - 1, hap, edu);
|
||||||
}
|
}
|
||||||
if (ally_factor > 0.0)
|
if (ally_factor > 0.0)
|
||||||
|
|
|
@ -94,7 +94,7 @@ prepare_sects(int etu, struct bp *bp)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tax(struct sctstr *sp, struct natstr *np, int etu, long *pop, int *civ_tax,
|
tax(struct sctstr *sp, struct natstr *np, int etu, int *pop, int *civ_tax,
|
||||||
int *uw_tax, int *mil_pay)
|
int *uw_tax, int *mil_pay)
|
||||||
{
|
{
|
||||||
*civ_tax = 0;
|
*civ_tax = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue