Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes.
This commit is contained in:
parent
442803c30a
commit
e9a040adb9
187 changed files with 246 additions and 435 deletions
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
|
@ -77,7 +76,7 @@ static s_char *ReversePath(s_char *path);
|
|||
void
|
||||
finish_sects(int etu)
|
||||
{
|
||||
register struct sctstr *sp;
|
||||
struct sctstr *sp;
|
||||
struct natstr *np;
|
||||
int n;
|
||||
struct distinfo *infptr;
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
|
@ -49,12 +48,12 @@
|
|||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
|
||||
static int grow_people(struct sctstr *, register int,
|
||||
register struct natstr *, int *, int,
|
||||
static int grow_people(struct sctstr *, int,
|
||||
struct natstr *, int *, int,
|
||||
short *);
|
||||
static int growfood(struct sctstr *, short *, int, int);
|
||||
static void starvation(struct sctstr *);
|
||||
static void trunc_people(struct sctstr *, register struct natstr *,
|
||||
static void trunc_people(struct sctstr *, struct natstr *,
|
||||
short *);
|
||||
|
||||
/*
|
||||
|
@ -241,7 +240,7 @@ feed_people(short *vec, int etu, int *needed)
|
|||
* Truncate any extra people that may be around
|
||||
*/
|
||||
static void
|
||||
trunc_people(struct sctstr *sp, register struct natstr *np,
|
||||
trunc_people(struct sctstr *sp, struct natstr *np,
|
||||
short *vec)
|
||||
{
|
||||
int maxpop = max_pop(np->nat_level[NAT_RLEV], sp);
|
||||
|
@ -259,8 +258,8 @@ trunc_people(struct sctstr *sp, register struct natstr *np,
|
|||
* production? Maybe with just high education?
|
||||
*/
|
||||
static int
|
||||
grow_people(struct sctstr *sp, register int etu,
|
||||
register struct natstr *np, int *workp, int sctwork,
|
||||
grow_people(struct sctstr *sp, int etu,
|
||||
struct natstr *np, int *workp, int sctwork,
|
||||
short *vec)
|
||||
{
|
||||
int newciv;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nat.h"
|
||||
#include "land.h"
|
||||
#include "ship.h"
|
||||
#include "var.h"
|
||||
#include "news.h"
|
||||
#include "file.h"
|
||||
#include "product.h"
|
||||
|
@ -59,16 +58,16 @@ int mil_dbl_pay;
|
|||
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
||||
#endif
|
||||
|
||||
static int landrepair(register struct lndstr *, struct natstr *,
|
||||
static int landrepair(struct lndstr *, struct natstr *,
|
||||
int *, int);
|
||||
static void upd_land(register struct lndstr *lp, register int etus,
|
||||
static void upd_land(struct lndstr *lp, int etus,
|
||||
struct natstr *np, int *bp, int build);
|
||||
|
||||
int
|
||||
prod_land(int etus, int natnum, int *bp, int build)
|
||||
/* build = 1, maintain = 0 */
|
||||
{
|
||||
register struct lndstr *lp;
|
||||
struct lndstr *lp;
|
||||
struct sctstr *sp;
|
||||
struct natstr *np;
|
||||
int n, k = 0;
|
||||
|
@ -111,7 +110,7 @@ prod_land(int etus, int natnum, int *bp, int build)
|
|||
}
|
||||
|
||||
static void
|
||||
upd_land(register struct lndstr *lp, register int etus,
|
||||
upd_land(struct lndstr *lp, int etus,
|
||||
struct natstr *np, int *bp, int build)
|
||||
/* build = 1, maintain = 0 */
|
||||
{
|
||||
|
@ -233,10 +232,10 @@ upd_land(register struct lndstr *lp, register int etus,
|
|||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
landrepair(register struct lndstr *land, struct natstr *np,
|
||||
landrepair(struct lndstr *land, struct natstr *np,
|
||||
int *bp, int etus)
|
||||
{
|
||||
register int delta;
|
||||
int delta;
|
||||
struct sctstr *sp;
|
||||
struct lchrstr *lp;
|
||||
float leftp, buildp;
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "sect.h"
|
||||
#include "player.h"
|
||||
#include "empthread.h"
|
||||
#include "var.h"
|
||||
#include "budg.h"
|
||||
#include "product.h"
|
||||
#include "player.h"
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "ship.h"
|
||||
#include "land.h"
|
||||
|
@ -54,10 +53,10 @@ int updating_mob = 1;
|
|||
static int timestamp_fixing;
|
||||
static int do_upd_checking = 0;
|
||||
|
||||
static void do_mob_land(register struct lndstr *, register int);
|
||||
static void do_mob_plane(register struct plnstr *, register int);
|
||||
static void do_mob_sect(register struct sctstr *sp, register int etus);
|
||||
static void do_mob_ship(register struct shpstr *, register int);
|
||||
static void do_mob_land(struct lndstr *, int);
|
||||
static void do_mob_plane(struct plnstr *, int);
|
||||
static void do_mob_sect(struct sctstr *sp, int etus);
|
||||
static void do_mob_ship(struct shpstr *, int);
|
||||
|
||||
static int
|
||||
increase_mob(time_t * counter, float mult)
|
||||
|
@ -155,7 +154,7 @@ update_all_mob(void)
|
|||
}
|
||||
|
||||
void
|
||||
sct_do_upd_mob(register struct sctstr *sp)
|
||||
sct_do_upd_mob(struct sctstr *sp)
|
||||
{
|
||||
int etus;
|
||||
|
||||
|
@ -174,7 +173,7 @@ sct_do_upd_mob(register struct sctstr *sp)
|
|||
}
|
||||
|
||||
void
|
||||
shp_do_upd_mob(register struct shpstr *sp)
|
||||
shp_do_upd_mob(struct shpstr *sp)
|
||||
{
|
||||
int etus;
|
||||
|
||||
|
@ -190,7 +189,7 @@ shp_do_upd_mob(register struct shpstr *sp)
|
|||
}
|
||||
|
||||
void
|
||||
lnd_do_upd_mob(register struct lndstr *lp)
|
||||
lnd_do_upd_mob(struct lndstr *lp)
|
||||
{
|
||||
int etus;
|
||||
|
||||
|
@ -207,7 +206,7 @@ lnd_do_upd_mob(register struct lndstr *lp)
|
|||
}
|
||||
|
||||
void
|
||||
pln_do_upd_mob(register struct plnstr *pp)
|
||||
pln_do_upd_mob(struct plnstr *pp)
|
||||
{
|
||||
int etus;
|
||||
|
||||
|
@ -224,10 +223,10 @@ pln_do_upd_mob(register struct plnstr *pp)
|
|||
}
|
||||
|
||||
void
|
||||
mob_sect(register int etus)
|
||||
mob_sect(int etus)
|
||||
{
|
||||
register struct sctstr *sp;
|
||||
register int n;
|
||||
struct sctstr *sp;
|
||||
int n;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
|
@ -241,9 +240,9 @@ mob_sect(register int etus)
|
|||
}
|
||||
|
||||
static void
|
||||
do_mob_sect(register struct sctstr *sp, register int etus)
|
||||
do_mob_sect(struct sctstr *sp, int etus)
|
||||
{
|
||||
register int value;
|
||||
int value;
|
||||
|
||||
if (sp->sct_own == 0)
|
||||
return;
|
||||
|
@ -262,10 +261,10 @@ do_mob_sect(register struct sctstr *sp, register int etus)
|
|||
}
|
||||
|
||||
void
|
||||
mob_ship(register int etus)
|
||||
mob_ship(int etus)
|
||||
{
|
||||
register struct shpstr *sp;
|
||||
register int n;
|
||||
struct shpstr *sp;
|
||||
int n;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
|
@ -279,10 +278,10 @@ mob_ship(register int etus)
|
|||
}
|
||||
|
||||
static void
|
||||
do_mob_ship(register struct shpstr *sp, register int etus)
|
||||
do_mob_ship(struct shpstr *sp, int etus)
|
||||
{
|
||||
int newfuel = 0;
|
||||
register int value;
|
||||
int value;
|
||||
int can_add, have_fuel_for, total_add;
|
||||
double d;
|
||||
|
||||
|
@ -372,10 +371,10 @@ do_mob_ship(register struct shpstr *sp, register int etus)
|
|||
}
|
||||
|
||||
void
|
||||
mob_land(register int etus)
|
||||
mob_land(int etus)
|
||||
{
|
||||
register struct lndstr *lp;
|
||||
register int n;
|
||||
struct lndstr *lp;
|
||||
int n;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
|
@ -389,10 +388,10 @@ mob_land(register int etus)
|
|||
}
|
||||
|
||||
static void
|
||||
do_mob_land(register struct lndstr *lp, register int etus)
|
||||
do_mob_land(struct lndstr *lp, int etus)
|
||||
{
|
||||
int newfuel = 0;
|
||||
register int value;
|
||||
int value;
|
||||
int can_add, have_fuel_for, total_add;
|
||||
double d;
|
||||
|
||||
|
@ -489,10 +488,10 @@ do_mob_land(register struct lndstr *lp, register int etus)
|
|||
}
|
||||
|
||||
void
|
||||
mob_plane(register int etus)
|
||||
mob_plane(int etus)
|
||||
{
|
||||
register struct plnstr *pp;
|
||||
register int n;
|
||||
struct plnstr *pp;
|
||||
int n;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
|
@ -506,9 +505,9 @@ mob_plane(register int etus)
|
|||
}
|
||||
|
||||
static void
|
||||
do_mob_plane(register struct plnstr *pp, register int etus)
|
||||
do_mob_plane(struct plnstr *pp, int etus)
|
||||
{
|
||||
register int value;
|
||||
int value;
|
||||
|
||||
if (pp->pln_own == 0)
|
||||
return;
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "plane.h"
|
||||
#include "sect.h"
|
||||
#include "xy.h"
|
||||
|
@ -50,7 +49,7 @@
|
|||
#endif
|
||||
|
||||
void
|
||||
move_sat(register struct plnstr *pp)
|
||||
move_sat(struct plnstr *pp)
|
||||
{
|
||||
coord x1, y1, x2, y2;
|
||||
coord dx, dy;
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
|
@ -57,7 +56,7 @@
|
|||
* level of 0 yields (1) 0.4, (6) 2.2, (12) 3.9, (18) 5.2.
|
||||
*/
|
||||
|
||||
static void share_incr(register double *, register double *);
|
||||
static void share_incr(double *, double *);
|
||||
|
||||
/*
|
||||
* for values below the "easy level" values, production is
|
||||
|
@ -233,12 +232,12 @@ prod_nat(int etu)
|
|||
* find out everyones increment
|
||||
*/
|
||||
static void
|
||||
share_incr(register double *res, register double *tech)
|
||||
share_incr(double *res, double *tech)
|
||||
{
|
||||
register struct natstr *np;
|
||||
register struct natstr *other;
|
||||
register natid i;
|
||||
register natid j;
|
||||
struct natstr *np;
|
||||
struct natstr *other;
|
||||
natid i;
|
||||
natid j;
|
||||
int rnc;
|
||||
int tnc;
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "misc.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include "var.h"
|
||||
#include "ship.h"
|
||||
#include "sect.h"
|
||||
#include "news.h"
|
||||
|
@ -55,7 +54,7 @@
|
|||
static void swap(struct shpstr *);
|
||||
|
||||
static void
|
||||
scuttle_it(register struct shpstr *sp)
|
||||
scuttle_it(struct shpstr *sp)
|
||||
{
|
||||
struct sctstr *sectp;
|
||||
|
||||
|
@ -86,7 +85,7 @@ scuttle_it(register struct shpstr *sp)
|
|||
}
|
||||
|
||||
static void
|
||||
nav_check_atdest(register struct shpstr *sp)
|
||||
nav_check_atdest(struct shpstr *sp)
|
||||
{
|
||||
if ((sp->shp_x == sp->shp_destx[0]) && (sp->shp_y == sp->shp_desty[0])) {
|
||||
if ((sp->shp_destx[0] == sp->shp_destx[1]) &&
|
||||
|
@ -155,7 +154,7 @@ swap(struct shpstr *sp)
|
|||
*/
|
||||
|
||||
static int
|
||||
nav_loadship(register struct shpstr *sp, natid cnum)
|
||||
nav_loadship(struct shpstr *sp, natid cnum)
|
||||
{
|
||||
struct sctstr *sectp;
|
||||
int i, landown, shipown, didsomething[TMAX], rel;
|
||||
|
@ -233,7 +232,7 @@ nav_loadship(register struct shpstr *sp, natid cnum)
|
|||
* Modified to use shp_nav by Ken Stevens 1995
|
||||
*/
|
||||
int
|
||||
nav_ship(register struct shpstr *sp)
|
||||
nav_ship(struct shpstr *sp)
|
||||
{
|
||||
struct sctstr *sectp;
|
||||
s_char *cp;
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "xy.h"
|
||||
#include "plane.h"
|
||||
#include "ship.h"
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "xy.h"
|
||||
#include "sect.h"
|
||||
#include "nsc.h"
|
||||
|
@ -46,7 +45,7 @@
|
|||
* that matches the conditions.
|
||||
*/
|
||||
struct sctstr *
|
||||
nxtsctp(register struct nstr_sect *np)
|
||||
nxtsctp(struct nstr_sect *np)
|
||||
{
|
||||
while (1) {
|
||||
np->dx++;
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "plane.h"
|
||||
#include "ship.h"
|
||||
|
@ -59,8 +58,8 @@ prod_plane(int etus, int natnum, int *bp, int buildem)
|
|||
|
||||
/* Build = 1, maintain =0 */
|
||||
{
|
||||
register struct plnstr *pp;
|
||||
register struct plchrstr *plp;
|
||||
struct plnstr *pp;
|
||||
struct plchrstr *plp;
|
||||
struct natstr *np;
|
||||
float leftp, buildp;
|
||||
int left, build;
|
||||
|
|
|
@ -32,11 +32,9 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "news.h"
|
||||
#include "var.h"
|
||||
#include "file.h"
|
||||
#include "path.h"
|
||||
#include "xy.h"
|
||||
|
@ -49,7 +47,7 @@
|
|||
#include "lost.h"
|
||||
|
||||
void
|
||||
populace(struct natstr *np, register struct sctstr *sp, int etu)
|
||||
populace(struct natstr *np, struct sctstr *sp, int etu)
|
||||
{
|
||||
float hap;
|
||||
float tech;
|
||||
|
@ -135,8 +133,8 @@ populace(struct natstr *np, register struct sctstr *sp, int etu)
|
|||
}
|
||||
|
||||
int
|
||||
total_work(register int sctwork, register int etu, register int civil,
|
||||
register int milit, register int uw)
|
||||
total_work(int sctwork, int etu, int civil,
|
||||
int milit, int uw)
|
||||
{
|
||||
return ((int)((((civil * sctwork) / 100.0 +
|
||||
(milit * 2 / 5.0) + uw)) * etu) / 100);
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
|
@ -55,7 +54,7 @@
|
|||
void
|
||||
prepare_sects(int etu, int *bp)
|
||||
{
|
||||
register struct sctstr *sp;
|
||||
struct sctstr *sp;
|
||||
struct natstr *np;
|
||||
int n, civ_tax, uw_tax, mil_pay;
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "product.h"
|
||||
#include "nat.h"
|
||||
|
@ -56,7 +55,7 @@ int
|
|||
produce(struct natstr *np, struct sctstr *sp, short *vec, int work,
|
||||
int desig, int neweff, int *cost, int *amount)
|
||||
{
|
||||
register struct pchrstr *product;
|
||||
struct pchrstr *product;
|
||||
double p_e;
|
||||
double prodeff;
|
||||
s_char *resource;
|
||||
|
|
|
@ -33,11 +33,9 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "news.h"
|
||||
#include "var.h"
|
||||
#include "file.h"
|
||||
#include "path.h"
|
||||
#include "xy.h"
|
||||
|
@ -323,7 +321,7 @@ guerrilla(struct sctstr *sp)
|
|||
}
|
||||
}
|
||||
if (convert && sp->sct_loyal >= 50) {
|
||||
register int n;
|
||||
int n;
|
||||
/* new owner gets to keep the mobility there */
|
||||
oldmob = sp->sct_mobil;
|
||||
/* che won, and sector converts. */
|
||||
|
|
|
@ -35,11 +35,9 @@
|
|||
*/
|
||||
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "path.h"
|
||||
#include "ship.h"
|
||||
#include "var.h"
|
||||
#include "news.h"
|
||||
#include "file.h"
|
||||
#include "nat.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "var.h"
|
||||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "item.h"
|
||||
|
@ -61,10 +60,10 @@
|
|||
* Return amount of work used.
|
||||
*/
|
||||
static int
|
||||
upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp,
|
||||
upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
|
||||
short *vec, int etu, int *desig, int sctwork, int *cost)
|
||||
{
|
||||
register int work_cost = 0;
|
||||
int work_cost = 0;
|
||||
int buildeff_work = *workp / 2;
|
||||
int n, hcms, lcms, neweff;
|
||||
u_char old_type = *desig;
|
||||
|
@ -204,7 +203,7 @@ meltitems(int etus, int fallout, int own, short *vec, int type, int x, int y,
|
|||
*/
|
||||
|
||||
void
|
||||
do_fallout(register struct sctstr *sp, register int etus)
|
||||
do_fallout(struct sctstr *sp, int etus)
|
||||
{
|
||||
struct shpstr *spp;
|
||||
struct lndstr *lp;
|
||||
|
@ -246,7 +245,7 @@ spread_fallout(struct sctstr *sp, int etus)
|
|||
{
|
||||
struct sctstr *ap;
|
||||
int n;
|
||||
register int inc;
|
||||
int inc;
|
||||
|
||||
if (etus > 24)
|
||||
etus = 24;
|
||||
|
@ -297,8 +296,8 @@ void
|
|||
produce_sect(int natnum, int etu, int *bp, long int (*p_sect)[2],
|
||||
int sector_type)
|
||||
{
|
||||
register struct sctstr *sp;
|
||||
register struct natstr *np;
|
||||
struct sctstr *sp;
|
||||
struct natstr *np;
|
||||
short buf[I_MAX + 1];
|
||||
short *vec;
|
||||
int work, cost, ecost, pcost, sctwork;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "sect.h"
|
||||
#include "nat.h"
|
||||
#include "ship.h"
|
||||
#include "var.h"
|
||||
#include "news.h"
|
||||
#include "file.h"
|
||||
#include "product.h"
|
||||
|
@ -57,16 +56,16 @@
|
|||
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
||||
#endif
|
||||
|
||||
static int shiprepair(register struct shpstr *, struct natstr *,
|
||||
static int shiprepair(struct shpstr *, struct natstr *,
|
||||
int *, int);
|
||||
static void upd_ship(register struct shpstr *, register int,
|
||||
static void upd_ship(struct shpstr *, int,
|
||||
struct natstr *, int *, int);
|
||||
|
||||
int
|
||||
prod_ship(int etus, int natnum, int *bp, int build)
|
||||
/* build = 1, maintain = 0 */
|
||||
{
|
||||
register struct shpstr *sp;
|
||||
struct shpstr *sp;
|
||||
struct natstr *np;
|
||||
int n, k = 0;
|
||||
int start_money;
|
||||
|
@ -110,7 +109,7 @@ prod_ship(int etus, int natnum, int *bp, int build)
|
|||
}
|
||||
|
||||
static void
|
||||
upd_ship(register struct shpstr *sp, register int etus,
|
||||
upd_ship(struct shpstr *sp, int etus,
|
||||
struct natstr *np, int *bp, int build)
|
||||
/* build = 1, maintain = 0 */
|
||||
{
|
||||
|
@ -267,10 +266,10 @@ upd_ship(register struct shpstr *sp, register int etus,
|
|||
* 8 * 8 * $40 = $2560!
|
||||
*/
|
||||
static int
|
||||
shiprepair(register struct shpstr *ship, struct natstr *np,
|
||||
shiprepair(struct shpstr *ship, struct natstr *np,
|
||||
int *bp, int etus)
|
||||
{
|
||||
register int delta;
|
||||
int delta;
|
||||
struct sctstr *sp;
|
||||
struct mchrstr *mp;
|
||||
float leftp, buildp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue