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:
Marc Olzheim 2004-10-12 20:08:51 +00:00
parent 442803c30a
commit e9a040adb9
187 changed files with 246 additions and 435 deletions

View file

@ -37,7 +37,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "news.h"
#include "land.h"
#include "sect.h"
@ -61,7 +60,7 @@
static void getilist(struct emp_qelem *list, natid own,
struct emp_qelem *a, struct emp_qelem *b,
struct emp_qelem *c, struct emp_qelem *d);
static void ac_dog(register struct plist *ap, register struct plist *dp);
static void ac_dog(struct plist *ap, struct plist *dp);
#define FLAK_MAX 15
@ -460,7 +459,7 @@ void
ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
struct emp_qelem *def_list, natid def_own, coord x, coord y)
{
register struct plnstr *pp;
struct plnstr *pp;
struct plist *plp;
int icount;
struct emp_qelem *next;
@ -537,8 +536,8 @@ void
ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list,
natid def_own)
{
register struct plist *attacker;
register struct plist *interceptor;
struct plist *attacker;
struct plist *interceptor;
struct emp_qelem *att;
struct emp_qelem *in;
int nplanes;
@ -619,7 +618,7 @@ all_missiles(struct emp_qelem *att_list)
}
static void
ac_dog(register struct plist *ap, register struct plist *dp)
ac_dog(struct plist *ap, struct plist *dp)
{
int att, def;
double odds;
@ -715,7 +714,7 @@ void
ac_planedamage(struct plist *plp, natid from, int dam, natid other,
int checkabort, int show, s_char *mesg)
{
register struct plnstr *pp;
struct plnstr *pp;
int disp;
s_char dmess[255];
int eff;
@ -963,7 +962,7 @@ ac_landflak(struct emp_qelem *list, coord x, coord y)
void
ac_fireflak(struct emp_qelem *list, natid from, natid other, int guns)
{
register struct plnstr *pp;
struct plnstr *pp;
struct plist *plp;
int n;
float mult;
@ -1037,7 +1036,7 @@ static void
getilist(struct emp_qelem *list, natid own, struct emp_qelem *a,
struct emp_qelem *b, struct emp_qelem *c, struct emp_qelem *d)
{
register struct plchrstr *pcp;
struct plchrstr *pcp;
struct plnstr plane;
struct shpstr ship;
struct lndstr land;

View file

@ -40,7 +40,6 @@
#include "nat.h"
#include "tel.h"
#include "file.h"
#include "var.h"
#include "prototypes.h"
/*

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "ship.h"

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "nsc.h"
@ -46,7 +45,7 @@
void
bsanct(void)
{
register int count;
int count;
struct sctstr s;
struct nstr_sect nstr;

View file

@ -35,7 +35,6 @@
#include "misc.h"
#include "player.h"
#include "nat.h"
#include "var.h"
#include "sect.h"
#include "file.h"
#include "xy.h"

View file

@ -33,10 +33,8 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "nat.h"
#include "var.h"
#include "file.h"
#include "path.h"
#include "xy.h"

View file

@ -43,7 +43,6 @@
#include "news.h"
#include "plane.h"
#include "nsc.h"
#include "var.h"
#include "optlist.h"
#include "prototypes.h"

View file

@ -37,7 +37,6 @@
*/
#include "misc.h"
#include "var.h"
#include "xy.h"
#include "nat.h"
#include "sect.h"
@ -222,7 +221,7 @@ int
sb(natid att, natid def, struct sctstr *sp, coord tx, coord ty, int noisy,
int defending)
{
register int damage;
int damage;
natid own;
int shell;
double range;

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "file.h"
#include "land.h"
#include "ship.h"

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "news.h"
#include "ship.h"
#include "land.h"
@ -291,7 +290,7 @@ num_shipsatxy(coord x, coord y, int wantflags, int nowantflags)
int
islist(s_char *p)
{
register int x;
int x;
x = 0;

View file

@ -36,7 +36,6 @@
#include "misc.h"
#include "player.h"
#include "file.h"
#include "var.h"
#include "sect.h"
#include "path.h"
#include "news.h"
@ -633,8 +632,8 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
void
lnd_put(struct emp_qelem *list, natid actor)
{
register struct emp_qelem *qp;
register struct emp_qelem *newqp;
struct emp_qelem *qp;
struct emp_qelem *newqp;
struct llist *llp;
qp = list->q_back;

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "file.h"
#include "land.h"
#include "ship.h"

View file

@ -35,7 +35,6 @@
#include "options.h"
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "retreat.h"
@ -83,7 +82,7 @@ static int perform_mission(coord, coord, natid, struct emp_qelem *, int,
int
ground_interdict(coord x, coord y, natid victim, s_char *s)
{
register int cn;
int cn;
int dam = 0, newdam, rel;
struct genlist mi[MAXNOC];
int z;
@ -170,7 +169,7 @@ int
unit_interdict(coord x, coord y, natid victim, s_char *s, int hardtarget,
int mission)
{
register int cn;
int cn;
int dam = 0, newdam;
struct genlist mi[MAXNOC];
int z;
@ -263,7 +262,7 @@ def_support(coord x, coord y, natid victim, natid actee)
static int
dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee)
{
register int cn;
int cn;
int rel;
int dam = 0;
@ -1014,7 +1013,7 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
struct sctstr sect;
struct plchrstr *pcp;
struct plist *plp;
register int y, bad, bad1;
int y, bad, bad1;
unsigned int x;
for (qp = list->q_forw; qp != list; qp = next) {
@ -1258,7 +1257,7 @@ int
mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
s_char mission)
{
register struct plchrstr *pcp;
struct plchrstr *pcp;
struct plnstr *pp;
int needed;
struct lndstr land;

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "item.h"
#include "file.h"

View file

@ -35,7 +35,6 @@
#include "misc.h"
#include "queue.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "ship.h"
#include "optlist.h"
@ -176,7 +175,7 @@ void
msl_sel(struct emp_qelem *list, coord x, coord y, natid victim,
int wantflags, int nowantflags, int mission)
{
register struct plchrstr *pcp;
struct plchrstr *pcp;
struct plnstr plane;
struct plist *irv;
struct nstr_item ni;
@ -220,8 +219,8 @@ int
msl_intercept(coord x, coord y, natid bombown, int hardtarget,
int sublaunch, int wantflags, int nowantflags)
{
register struct plnstr *pp;
register struct plchrstr *pcp;
struct plnstr *pp;
struct plchrstr *pcp;
struct sctstr sect;
struct emp_qelem *irvlist;
struct emp_qelem foo;

View file

@ -34,7 +34,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "nuke.h"
#include "sect.h"
#include "xy.h"

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "plane.h"
#include "ship.h"

View file

@ -32,7 +32,6 @@
*/
#include "misc.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "nsc.h"
@ -45,7 +44,7 @@
* that matches the conditions.
*/
int
nxtsct(register struct nstr_sect *np, struct sctstr *sp)
nxtsct(struct nstr_sect *np, struct sctstr *sp)
{
while (1) {
np->dx++;

View file

@ -34,7 +34,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "plane.h"
#include "ship.h"
#include "land.h"

View file

@ -36,7 +36,6 @@
#include <math.h>
#include "misc.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "ship.h"
#include "land.h"
@ -337,8 +336,8 @@ pln_sel(struct nstr_item *ni, struct emp_qelem *list, struct sctstr *ap,
int range;
struct plchrstr *pcp;
struct plist *plp;
register int y;
register int bad, bad1;
int y;
int bad, bad1;
unsigned int x;
emp_initque(list);
@ -561,7 +560,7 @@ pln_arm(struct emp_qelem *list, int dist, int mission, struct ichrstr *ip,
static int
pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
{
register struct plchrstr *pcp;
struct plchrstr *pcp;
struct plnstr *pp;
int needed;
struct lndstr land;
@ -695,8 +694,8 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
void
pln_put(struct emp_qelem *list)
{
register struct emp_qelem *qp;
register struct emp_qelem *newqp;
struct emp_qelem *qp;
struct emp_qelem *newqp;
struct plist *plp;
struct plnstr *pp;
struct shpstr ship;

View file

@ -36,7 +36,6 @@
#include "misc.h"
#include "player.h"
#include "nat.h"
#include "var.h"
#include "retreat.h"
#include "ship.h"
#include "land.h"
@ -133,8 +132,8 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
/* Is this the originally scared ship, or a follower */
{
struct sctstr sect;
register int n;
register int m;
int n;
int m;
int max;
int dir;
coord newx;
@ -419,8 +418,8 @@ retreat_land1(struct lndstr *lp, s_char code, int orig)
/* Is this the originally scared unit, or a follower */
{
struct sctstr sect;
register int n;
register int m;
int n;
int m;
int max;
int dir;
coord newx;

View file

@ -39,7 +39,6 @@
#include "ship.h"
#include "land.h"
#include "plane.h"
#include "var.h"
#include "nsc.h"
#include "nat.h"
#include "file.h"

View file

@ -34,7 +34,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "file.h"
#include "nat.h"

View file

@ -45,7 +45,6 @@
#include "misc.h"
#include "player.h"
#include "nuke.h"
#include "var.h"
#include "ship.h"
#include "land.h"
#include "item.h"
@ -265,9 +264,9 @@ show_nuke_stats(int tlev)
void
show_nuke_build(int tlev)
{
register struct nchrstr *np;
register int n;
register int avail;
struct nchrstr *np;
int n;
int avail;
if (opt_DRNUKE)
pr("%13s lcm hcm oil rad avail tech res $\n", "");
@ -299,8 +298,8 @@ show_nuke_build(int tlev)
void
show_nuke_capab(int tlev)
{
register struct nchrstr *np;
register int i, j, n;
struct nchrstr *np;
int i, j, n;
s_char *p;
if (opt_DRNUKE)
@ -343,8 +342,8 @@ show_nuke_capab(int tlev)
void
show_ship_build(int tlev)
{
register struct mchrstr *mp;
register int n;
struct mchrstr *mp;
int n;
pr("%25s lcm hcm avail tech $\n", "");
make_new_list(tlev, EF_SHIP);
@ -363,7 +362,7 @@ show_ship_build(int tlev)
void
show_ship_stats(int tlev)
{
register struct mchrstr *mp;
struct mchrstr *mp;
int scount;
int techdiff;
@ -457,7 +456,7 @@ show_ship_capab(int tlev)
void
show_plane_stats(int tlev)
{
register struct plchrstr *pp;
struct plchrstr *pp;
int pcount;
pr("%25s acc load att def ran fuel stlth\n", "");
@ -480,8 +479,8 @@ show_plane_stats(int tlev)
void
show_plane_capab(int tlev)
{
register struct plchrstr *pp;
register int i;
struct plchrstr *pp;
int i;
int pcount;
int n;
s_char *p;
@ -508,8 +507,8 @@ show_plane_capab(int tlev)
void
show_plane_build(int tlev)
{
register struct plchrstr *pp;
register int pcount;
struct plchrstr *pp;
int pcount;
pr("%25s lcm hcm crew avail tech $\n", "");
make_new_list(tlev, EF_PLANE);
@ -525,8 +524,8 @@ show_plane_build(int tlev)
void
show_land_build(int tlev)
{
register struct lchrstr *lp;
register int n;
struct lchrstr *lp;
int n;
pr("%25s lcm hcm guns avail tech $\n", "");
make_new_list(tlev, EF_LAND);
@ -624,7 +623,7 @@ show_land_stats(int tlev)
void
show_sect_build(int foo)
{
register int x, first = 1;
int x, first = 1;
for (x = 0; x <= SCT_MAXDEF; x++) {
if (dchr[x].d_mnem == 0)
@ -653,7 +652,7 @@ show_sect_build(int foo)
void
show_sect_stats(int foo)
{
register int x, first = 1;
int x, first = 1;
struct sctstr sect;
struct natstr *natp;
@ -685,7 +684,7 @@ show_sect_stats(int foo)
void
show_sect_capab(int foo)
{
register int x, first = 1, i, j;
int x, first = 1, i, j;
char *tmpstr;
for (x = 0; x <= SCT_MAXDEF; x++) {

View file

@ -36,7 +36,6 @@
#include "misc.h"
#include "queue.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "ship.h"
#include "plane.h"
@ -191,8 +190,8 @@ shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
void
shp_put(struct emp_qelem *list, natid actor)
{
register struct emp_qelem *qp;
register struct emp_qelem *newqp;
struct emp_qelem *qp;
struct emp_qelem *newqp;
struct mlist *mlp;
qp = list->q_back;

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "nsc.h"
@ -48,7 +47,7 @@
* for arguments to compile into the nstr.
*/
int
snxtitem(register struct nstr_item *np, int type, s_char *str)
snxtitem(struct nstr_item *np, int type, s_char *str)
{
struct range range;
int list[NS_LSIZE];
@ -126,7 +125,7 @@ snxtitem(register struct nstr_item *np, int type, s_char *str)
}
void
snxtitem_area(register struct nstr_item *np, int type, struct range *range)
snxtitem_area(struct nstr_item *np, int type, struct range *range)
{
memset(np, 0, sizeof(*np));
np->cur = -1;
@ -141,7 +140,7 @@ snxtitem_area(register struct nstr_item *np, int type, struct range *range)
}
void
snxtitem_dist(register struct nstr_item *np, int type, int cx, int cy,
snxtitem_dist(struct nstr_item *np, int type, int cx, int cy,
int dist)
{
struct range range;
@ -167,7 +166,7 @@ snxtitem_dist(register struct nstr_item *np, int type, int cx, int cy,
}
void
snxtitem_xy(register struct nstr_item *np, int type, coord x, coord y)
snxtitem_xy(struct nstr_item *np, int type, coord x, coord y)
{
memset(np, 0, sizeof(*np));
np->cur = -1;
@ -183,7 +182,7 @@ snxtitem_xy(register struct nstr_item *np, int type, coord x, coord y)
}
void
snxtitem_all(register struct nstr_item *np, int type)
snxtitem_all(struct nstr_item *np, int type)
{
memset(np, 0, sizeof(*np));
np->cur = -1;
@ -197,7 +196,7 @@ snxtitem_all(register struct nstr_item *np, int type)
}
void
snxtitem_group(register struct nstr_item *np, int type, s_char group)
snxtitem_group(struct nstr_item *np, int type, s_char group)
{
if (group == '~')
group = ' ';
@ -222,7 +221,7 @@ snxtitem_rewind(struct nstr_item *np)
}
int
snxtitem_list(register struct nstr_item *np, int type, int *list, int len)
snxtitem_list(struct nstr_item *np, int type, int *list, int len)
{
int i;

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "xy.h"
#include "sect.h"
#include "nsc.h"
@ -49,7 +48,7 @@
* for arguments to compile into the nstr.
*/
int
snxtsct(register struct nstr_sect *np, s_char *str)
snxtsct(struct nstr_sect *np, s_char *str)
{
struct range range;
coord cx, cy;
@ -106,7 +105,7 @@ snxtsct_all(struct nstr_sect *np)
}
void
snxtsct_area(register struct nstr_sect *np, struct range *range)
snxtsct_area(struct nstr_sect *np, struct range *range)
{
memset(np, 0, sizeof(*np));
np->range = *range;
@ -133,7 +132,7 @@ snxtsct_rewind(struct nstr_sect *np)
}
void
snxtsct_dist(register struct nstr_sect *np, coord cx, coord cy, int dist)
snxtsct_dist(struct nstr_sect *np, coord cx, coord cy, int dist)
{
memset(np, 0, sizeof(*np));
xydist_range(cx, cy, dist, &np->range);
@ -156,7 +155,7 @@ snxtsct_dist(register struct nstr_sect *np, coord cx, coord cy, int dist)
}
void
xysize_range(register struct range *rp)
xysize_range(struct range *rp)
{
if (rp->lx >= rp->hx)
rp->width = WORLD_X + rp->hx - rp->lx;
@ -180,7 +179,7 @@ xysize_range(register struct range *rp)
/* This is called also called in snxtitem.c */
void
xydist_range(coord x, coord y, register int dist, struct range *rp)
xydist_range(coord x, coord y, int dist, struct range *rp)
{
if (dist < WORLD_X / 4) {
rp->lx = xnorm((coord)(x - 2 * dist));

View file

@ -33,7 +33,6 @@
#include "misc.h"
#include "nat.h"
#include "var.h"
#include "retreat.h"
#include "ship.h"
#include "land.h"

View file

@ -33,7 +33,6 @@
*/
#include "misc.h"
#include "var.h"
#include "sect.h"
#include "xy.h"
#include "nsc.h"
@ -46,7 +45,7 @@
#include "optlist.h"
void
takeover(register struct sctstr *sp, natid newown)
takeover(struct sctstr *sp, natid newown)
{
struct plnstr *pp;
struct lndstr *lp;
@ -165,7 +164,7 @@ takeover(register struct sctstr *sp, natid newown)
}
void
takeover_plane(register struct plnstr *pp, natid newown)
takeover_plane(struct plnstr *pp, natid newown)
{
int n;
@ -209,10 +208,10 @@ takeover_plane(register struct plnstr *pp, natid newown)
}
void
takeover_ship(register struct shpstr *sp, natid newown, int hostile)
takeover_ship(struct shpstr *sp, natid newown, int hostile)
{
register struct plnstr *pp;
register struct lndstr *lp;
struct plnstr *pp;
struct lndstr *lp;
struct nstr_item ni;
struct plnstr p;
struct lndstr llp;
@ -266,10 +265,10 @@ takeover_ship(register struct shpstr *sp, natid newown, int hostile)
}
void
takeover_land(register struct lndstr *landp, natid newown, int hostile)
takeover_land(struct lndstr *landp, natid newown, int hostile)
{
register struct plnstr *pp;
register struct lndstr *lp;
struct plnstr *pp;
struct lndstr *lp;
struct nstr_item ni;
struct plnstr p;
struct lndstr llp;

View file

@ -35,7 +35,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "nat.h"
#include "item.h"
@ -243,7 +242,7 @@ long
get_couval(int cnum)
{
struct sctstr *sp;
register int j, k, val;
int j, k, val;
long secttot = 0;
for (j = 0; NULL != (sp = getsectid(j)); j++) {