Declare all configuration variables in optlist.h. Include that
instead of declaring them all over the place. This uncovered type errors: (s_p_etu, adj_update): Defined long, sometimes declared int. Kills big endian machines where sizeof(long) != sizeof(int). Change to int. (set_option, delete_option, optstrset, intset, floatset, doubleset, longset, optionset, optiondel, worldxset): Change linkage to static.
This commit is contained in:
parent
80aae5b8e6
commit
8cd0160176
62 changed files with 143 additions and 258 deletions
|
@ -36,11 +36,11 @@
|
|||
#include "file.h"
|
||||
#include "update.h"
|
||||
#include "gen.h"
|
||||
#include "optlist.h"
|
||||
|
||||
void
|
||||
age_levels(int etu)
|
||||
{
|
||||
extern float level_age_rate;
|
||||
register float best_tech;
|
||||
register float best_res;
|
||||
register struct natstr *np;
|
||||
|
|
|
@ -65,7 +65,6 @@ int
|
|||
do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
|
||||
int *workp, int *bp, int etu)
|
||||
{
|
||||
extern double eatrate;
|
||||
int people;
|
||||
int work_avail;
|
||||
int starved, sctwork;
|
||||
|
@ -153,8 +152,6 @@ do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
|
|||
static int
|
||||
growfood(struct sctstr *sp, register int *vec, int work, int etu)
|
||||
{
|
||||
extern double fgrate;
|
||||
extern double fcrate;
|
||||
double food_fertil;
|
||||
double food_workers;
|
||||
double food;
|
||||
|
@ -189,7 +186,6 @@ growfood(struct sctstr *sp, register int *vec, int work, int etu)
|
|||
int
|
||||
feed_people(register int *vec, int etu, int *needed)
|
||||
{
|
||||
extern double eatrate;
|
||||
double food_eaten;
|
||||
double people_left;
|
||||
int can_eat;
|
||||
|
@ -281,9 +277,6 @@ grow_people(struct sctstr *sp, register int etu,
|
|||
register struct natstr *np, int *workp, int sctwork,
|
||||
register int *vec)
|
||||
{
|
||||
extern double obrate;
|
||||
extern double uwbrate;
|
||||
extern double babyeat;
|
||||
int newciv;
|
||||
int newuw;
|
||||
int new_birth;
|
||||
|
|
|
@ -116,14 +116,12 @@ upd_land(register struct lndstr *lp, int landno, register int etus,
|
|||
struct natstr *np, int *bp, int build)
|
||||
/* build = 1, maintain = 0 */
|
||||
{
|
||||
extern int morale_base;
|
||||
struct lchrstr *lcp;
|
||||
int vec[I_MAX + 1];
|
||||
int cvec[I_MAX + 1];
|
||||
int n;
|
||||
int min = morale_base - (int)np->nat_level[NAT_HLEV];
|
||||
int mult;
|
||||
extern double money_land;
|
||||
int needed;
|
||||
int cost;
|
||||
int eff;
|
||||
|
@ -244,7 +242,6 @@ static int
|
|||
landrepair(register struct lndstr *land, int *vec, struct natstr *np,
|
||||
int *bp, int etus)
|
||||
{
|
||||
extern int land_grow_scale;
|
||||
register int delta;
|
||||
struct sctstr *sp;
|
||||
struct lchrstr *lp;
|
||||
|
@ -369,7 +366,6 @@ int
|
|||
feed_land(struct lndstr *lp, register int *vec, int etus, int *needed,
|
||||
int doit)
|
||||
{
|
||||
extern double eatrate;
|
||||
double food_eaten, ship_eaten;
|
||||
double people_left;
|
||||
int can_eat, need, svec[I_MAX + 1];
|
||||
|
|
|
@ -68,8 +68,6 @@ static void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
|
|||
void
|
||||
update_main(void *argv)
|
||||
{
|
||||
extern int etu_per_update;
|
||||
extern double money_res;
|
||||
int etu = etu_per_update;
|
||||
int n;
|
||||
int x;
|
||||
|
@ -220,7 +218,6 @@ do_prod(int sector_type, int etu, int n, int *bp, long int (*p_sect)[2],
|
|||
int *ship_build, int *ship_maint, int *plane_build,
|
||||
int *plane_maint, int *land_build, int *land_maint)
|
||||
{
|
||||
extern double money_mil;
|
||||
struct natstr *np;
|
||||
|
||||
np = getnatp(n);
|
||||
|
|
|
@ -62,7 +62,6 @@ increase_mob(time_t * counter, float mult)
|
|||
time_t secs;
|
||||
time_t now;
|
||||
time_t left;
|
||||
extern long s_p_etu;
|
||||
extern int updating_mob;
|
||||
int newetus;
|
||||
float newmob;
|
||||
|
@ -156,7 +155,6 @@ update_all_mob(void)
|
|||
void
|
||||
sct_do_upd_mob(register struct sctstr *sp)
|
||||
{
|
||||
extern float sect_mob_scale;
|
||||
int etus;
|
||||
|
||||
if (do_upd_checking || timestamp_fixing || update_pending)
|
||||
|
@ -176,7 +174,6 @@ sct_do_upd_mob(register struct sctstr *sp)
|
|||
void
|
||||
shp_do_upd_mob(register struct shpstr *sp)
|
||||
{
|
||||
extern float ship_mob_scale;
|
||||
int etus;
|
||||
|
||||
if (do_upd_checking || timestamp_fixing || update_pending)
|
||||
|
@ -193,7 +190,6 @@ shp_do_upd_mob(register struct shpstr *sp)
|
|||
void
|
||||
lnd_do_upd_mob(register struct lndstr *lp)
|
||||
{
|
||||
extern float land_mob_scale;
|
||||
int etus;
|
||||
|
||||
if (do_upd_checking || timestamp_fixing || update_pending)
|
||||
|
@ -211,7 +207,6 @@ lnd_do_upd_mob(register struct lndstr *lp)
|
|||
void
|
||||
pln_do_upd_mob(register struct plnstr *pp)
|
||||
{
|
||||
extern float plane_mob_scale;
|
||||
int etus;
|
||||
|
||||
if (do_upd_checking || timestamp_fixing || update_pending)
|
||||
|
@ -246,8 +241,6 @@ mob_sect(register int etus)
|
|||
static void
|
||||
do_mob_sect(register struct sctstr *sp, register int etus)
|
||||
{
|
||||
extern float sect_mob_scale;
|
||||
extern int sect_mob_max;
|
||||
register int value;
|
||||
|
||||
if (sp->sct_own == 0)
|
||||
|
@ -286,13 +279,10 @@ mob_ship(register int etus)
|
|||
static void
|
||||
do_mob_ship(register struct shpstr *sp, register int etus)
|
||||
{
|
||||
extern int ship_mob_max;
|
||||
extern float ship_mob_scale;
|
||||
int newfuel = 0;
|
||||
register int value;
|
||||
int can_add, have_fuel_for, total_add;
|
||||
double d;
|
||||
extern int fuel_mult;
|
||||
|
||||
if (sp->shp_own == 0)
|
||||
return;
|
||||
|
@ -399,13 +389,10 @@ mob_land(register int etus)
|
|||
static void
|
||||
do_mob_land(register struct lndstr *lp, register int etus)
|
||||
{
|
||||
extern int land_mob_max;
|
||||
extern float land_mob_scale;
|
||||
int newfuel = 0;
|
||||
register int value;
|
||||
int can_add, have_fuel_for, total_add;
|
||||
double d;
|
||||
extern int fuel_mult;
|
||||
|
||||
if (lp->lnd_own == 0)
|
||||
return;
|
||||
|
@ -519,8 +506,6 @@ mob_plane(register int etus)
|
|||
static void
|
||||
do_mob_plane(register struct plnstr *pp, register int etus)
|
||||
{
|
||||
extern int plane_mob_max;
|
||||
extern float plane_mob_scale;
|
||||
register int value;
|
||||
|
||||
if (pp->pln_own == 0)
|
||||
|
|
|
@ -104,8 +104,6 @@ limit_level(double level, int type, int flag)
|
|||
/*
|
||||
* Begin ugly hack.
|
||||
*/
|
||||
extern float easy_tech, tech_log_base;
|
||||
|
||||
level_easy[0] = easy_tech;
|
||||
level_log[0] = tech_log_base;
|
||||
/*
|
||||
|
@ -132,7 +130,6 @@ prod_nat(int etu)
|
|||
{
|
||||
extern long money[MAXNOC];
|
||||
extern long pops[MAXNOC];
|
||||
extern double hap_cons, edu_cons;
|
||||
extern long sea_money[MAXNOC];
|
||||
extern long lnd_money[MAXNOC];
|
||||
extern long air_money[MAXNOC];
|
||||
|
|
|
@ -59,9 +59,6 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
|
|||
|
||||
/* Build = 1, maintain =0 */
|
||||
{
|
||||
extern double money_mil;
|
||||
extern double money_plane;
|
||||
extern int plane_grow_scale;
|
||||
extern long air_money[MAXNOC];
|
||||
register struct plnstr *pp;
|
||||
register struct plchrstr *plp;
|
||||
|
|
|
@ -121,7 +121,6 @@ tax(struct sctstr *sp, struct natstr *np, int etu, long *pop, int *civ_tax,
|
|||
int *uw_tax, int *mil_pay)
|
||||
{
|
||||
int vec[I_MAX + 1];
|
||||
extern double money_civ, money_mil, money_uw;
|
||||
|
||||
*civ_tax = 0;
|
||||
*uw_tax = 0;
|
||||
|
@ -152,7 +151,6 @@ tax(struct sctstr *sp, struct natstr *np, int etu, long *pop, int *civ_tax,
|
|||
int
|
||||
upd_slmilcosts(natid n, int etu)
|
||||
{
|
||||
extern double money_mil;
|
||||
struct shpstr *sp;
|
||||
struct lndstr *lp;
|
||||
int mil = 0;
|
||||
|
@ -179,7 +177,6 @@ upd_slmilcosts(natid n, int etu)
|
|||
int
|
||||
bank_income(struct sctstr *sp, int etu)
|
||||
{
|
||||
extern double bankint;
|
||||
int vec[I_MAX + 1];
|
||||
|
||||
if (getvec(VT_ITEM, vec, (s_char *)sp, EF_SECTOR) <= 0)
|
||||
|
|
|
@ -295,7 +295,6 @@ do_fallout(register struct sctstr *sp, register int etus)
|
|||
void
|
||||
spread_fallout(struct sctstr *sp, int etus)
|
||||
{
|
||||
extern double fallout_spread;
|
||||
struct sctstr *ap;
|
||||
int tvec[I_MAX + 1];
|
||||
int cvec[I_MAX + 1];
|
||||
|
@ -329,8 +328,6 @@ spread_fallout(struct sctstr *sp, int etus)
|
|||
void
|
||||
decay_fallout(struct sctstr *sp, int etus)
|
||||
{
|
||||
extern double decay_per_etu;
|
||||
extern double fallout_spread;
|
||||
int cvec[I_MAX + 1];
|
||||
int decay;
|
||||
|
||||
|
|
|
@ -126,7 +126,6 @@ upd_ship(register struct shpstr *sp, int shipno, register int etus,
|
|||
s_char *resource;
|
||||
int n;
|
||||
int mult;
|
||||
extern double money_ship;
|
||||
int needed;
|
||||
int cost;
|
||||
int eff;
|
||||
|
@ -267,7 +266,6 @@ static int
|
|||
shiprepair(register struct shpstr *ship, int *vec, struct natstr *np,
|
||||
int *bp, int etus)
|
||||
{
|
||||
extern int ship_grow_scale;
|
||||
register int delta;
|
||||
struct sctstr *sp;
|
||||
struct mchrstr *mp;
|
||||
|
@ -435,7 +433,6 @@ int
|
|||
feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
|
||||
int doit)
|
||||
{
|
||||
extern double eatrate;
|
||||
double food_eaten, land_eaten;
|
||||
double people_left;
|
||||
int ifood_eaten;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue