Purge the register keyword.

This commit is contained in:
Markus Armbruster 2006-05-21 13:18:57 +00:00
parent 4c4fdca42b
commit 0d842c47f7
15 changed files with 45 additions and 57 deletions

View file

@ -369,7 +369,7 @@ extern int onearg(char *, char *);
extern int parse(char *, char **, char **, char *, char **); extern int parse(char *, char **, char **, char *, char **);
extern int ldround(double, int); extern int ldround(double, int);
extern int roundintby(int, int); extern int roundintby(int, int);
extern int scthash(register int, register int, int); extern int scthash(int, int, int);
extern int tcp_listen(char *, char *, size_t *); extern int tcp_listen(char *, char *, size_t *);
extern char *numstr(char buf[], int n); extern char *numstr(char buf[], int n);
/* plur.c */ /* plur.c */
@ -450,9 +450,9 @@ extern int military_control(struct sctstr *);
/* detonate.c */ /* detonate.c */
extern int detonate(struct nukstr *, coord, coord, int); extern int detonate(struct nukstr *, coord, coord, int);
/* disloan.c */ /* disloan.c */
extern int disloan(int, register struct lonstr *); extern int disloan(int, struct lonstr *);
/* distrea.c */ /* distrea.c */
extern int distrea(int, register struct trtstr *); extern int distrea(int, struct trtstr *);
/* fileinit.c */ /* fileinit.c */
extern void ef_init_srv(void); extern void ef_init_srv(void);
extern void ef_fin_srv(void); extern void ef_fin_srv(void);
@ -618,9 +618,9 @@ extern int check_retreat_and_do_landdamage(struct lndstr *, int);
/* sarg.c */ /* sarg.c */
extern ns_seltype sarg_type(char *); extern ns_seltype sarg_type(char *);
extern int sarg_xy(char *, coord *, coord *); extern int sarg_xy(char *, coord *, coord *);
extern int sarg_area(char *, register struct range *); extern int sarg_area(char *, struct range *);
extern int sarg_range(char *, coord *, coord *, int *); extern int sarg_range(char *, coord *, coord *, int *);
extern int sarg_list(char *, register int *, int); extern int sarg_list(char *, int *, int);
/* satmap.c */ /* satmap.c */
extern void satdisp(struct sctstr *, int, int); extern void satdisp(struct sctstr *, int, int);
extern void satmap(int, int, int, int, int, int); extern void satmap(int, int, int, int, int, int);
@ -682,7 +682,7 @@ extern void snxtitem_group(struct nstr_item *, int, char);
extern void snxtitem_rewind(struct nstr_item *); extern void snxtitem_rewind(struct nstr_item *);
extern int snxtitem_list(struct nstr_item *, int, int *, int); extern int snxtitem_list(struct nstr_item *, int, int *, int);
/* snxtsct.c */ /* snxtsct.c */
extern int snxtsct(register struct nstr_sect *, char *); extern int snxtsct(struct nstr_sect *, char *);
extern void snxtsct_area(struct nstr_sect *, struct range *); extern void snxtsct_area(struct nstr_sect *, struct range *);
extern void xydist_range(coord, coord, int, struct range *); extern void xydist_range(coord, coord, int, struct range *);
extern void xysize_range(struct range *); extern void xysize_range(struct range *);
@ -703,7 +703,7 @@ extern void takeover_ship(struct shpstr *, natid, int);
extern void takeover_plane(struct plnstr *, natid); extern void takeover_plane(struct plnstr *, natid);
/* trdsub.c */ /* trdsub.c */
/* trechk.c */ /* trechk.c */
extern int trechk(register natid, register natid, int); extern int trechk(natid, natid, int);
/* whatitem.c */ /* whatitem.c */
/* in item.h */ /* in item.h */
/* wu.c */ /* wu.c */
@ -728,7 +728,7 @@ extern int dodistribute(struct sctstr *, int, char *, double, double);
extern void finish_sects(int); extern void finish_sects(int);
/* human.c */ /* human.c */
extern int new_work(struct sctstr *, int); extern int new_work(struct sctstr *, int);
extern int do_feed(register struct sctstr *, register struct natstr *, extern int do_feed(struct sctstr *, struct natstr *,
short *, int *, int *, int); short *, int *, int *, int);
extern int feed_people(short *, int, int *); extern int feed_people(short *, int, int *);
/* land.c */ /* land.c */
@ -755,7 +755,7 @@ extern void move_sat(struct plnstr *);
extern double logx(double, double); extern double logx(double, double);
extern void prod_nat(int); extern void prod_nat(int);
/* nav_ship.c */ /* nav_ship.c */
extern int nav_ship(register struct shpstr *); extern int nav_ship(struct shpstr *);
/* nav_util.c */ /* nav_util.c */
extern int load_it(struct shpstr *, struct sctstr *, extern int load_it(struct shpstr *, struct sctstr *,
int); int);
@ -769,7 +769,7 @@ extern int plague_people(struct natstr *, short *, int *, int *, int);
/* plane.c */ /* plane.c */
extern int prod_plane(int, int, int *, int); extern int prod_plane(int, int, int *, int);
/* populace.c */ /* populace.c */
extern void populace(struct natstr *, register 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, long *, int *,
@ -789,7 +789,7 @@ extern void guerrilla(struct sctstr *);
/* sail.c */ /* sail.c */
extern void sail_ship(natid); extern void sail_ship(natid);
/* sect.c */ /* sect.c */
extern void do_fallout(register struct sctstr *, register int); extern void do_fallout(struct sctstr *, int);
extern void spread_fallout(struct sctstr *, int); extern void spread_fallout(struct sctstr *, int);
extern void decay_fallout(struct sctstr *, int); extern void decay_fallout(struct sctstr *, int);
extern void produce_sect(int natnum, int etu, int *bp, extern void produce_sect(int natnum, int etu, int *bp,

View file

@ -52,14 +52,13 @@ static void head_describe(struct histstr *, int, char *, char *);
static int head_printscoop(struct histstr (*hist)[MAXNOC], natid ano, static int head_printscoop(struct histstr (*hist)[MAXNOC], natid ano,
natid vno); natid vno);
static int head_findscoop(struct histstr (*hist)[MAXNOC], static int head_findscoop(struct histstr (*hist)[MAXNOC],
register natid maxcnum, natid *ano, natid *vno); natid maxcnum, natid *ano, natid *vno);
int int
head(void) head(void)
{ {
register int i; struct histstr *hp;
register struct histstr *hp; natid maxcnum;
register natid maxcnum;
time_t now; time_t now;
int severity; int severity;
int scoop; int scoop;
@ -71,7 +70,7 @@ head(void)
natid actor; natid actor;
natid victim; natid victim;
struct nstr_item nstr; struct nstr_item nstr;
int n; int i, n;
(void)time(&now); (void)time(&now);
natp = getnatp(player->cnum); natp = getnatp(player->cnum);
@ -126,7 +125,7 @@ head(void)
static int static int
head_printscoop(struct histstr (*hist)[MAXNOC], natid ano, natid vno) head_printscoop(struct histstr (*hist)[MAXNOC], natid ano, natid vno)
{ {
register struct histstr *hp; struct histstr *hp;
int severity; int severity;
hp = &hist[ano][vno]; hp = &hist[ano][vno];
@ -220,16 +219,12 @@ head_describe(struct histstr *hp, int what, char *aname, char *vname)
* Pretty strange. * Pretty strange.
*/ */
static int static int
head_findscoop(struct histstr (*hist)[MAXNOC], register natid maxcnum, head_findscoop(struct histstr (*hist)[MAXNOC], natid maxcnum,
natid *ano, natid *vno) natid *ano, natid *vno)
{ {
register struct histstr *hp; struct histstr *hp;
register int i; int i, j, k, scoop;
register int j; natid actor, victim;
register int k;
int scoop;
natid actor;
natid victim;
scoop = 9; scoop = 9;
actor = 0; actor = 0;

View file

@ -43,7 +43,7 @@
#include "commands.h" #include "commands.h"
#include "optlist.h" #include "optlist.h"
static void preport(register struct nwsstr *np); static void preport(struct nwsstr *np);
int int
news(void) news(void)
@ -174,10 +174,10 @@ news(void)
} }
static void static void
preport(register struct nwsstr *np) preport(struct nwsstr *np)
{ {
char *cp; char *cp;
register int i; int i;
char buf[255]; char buf[255];
char num[128]; char num[128];
char *ptr; char *ptr;

View file

@ -80,15 +80,13 @@ static int
do_treaty(void) do_treaty(void)
{ {
char *cp; char *cp;
register int ourcond; int ourcond, theircond;
register int theircond;
register int j;
struct symbol *tfp; struct symbol *tfp;
struct trtstr trty; struct trtstr trty;
struct nstr_item nstr; struct nstr_item nstr;
natid recipient; natid recipient;
time_t now; time_t now;
int n; int j, n;
struct natstr *natp; struct natstr *natp;
char prompt[128]; char prompt[128];
char buf[1024]; char buf[1024];
@ -163,7 +161,7 @@ do_treaty(void)
static int static int
do_loan(void) do_loan(void)
{ {
register int amt, irate, dur, maxloan; int amt, irate, dur, maxloan;
struct nstr_item nstr; struct nstr_item nstr;
struct natstr *natp; struct natstr *natp;
struct lonstr loan; struct lonstr loan;

View file

@ -38,7 +38,7 @@
int int
roundintby(int n, int m) roundintby(int n, int m)
{ {
register int r11; int r11;
r11 = (m >> 1) + n; r11 = (m >> 1) + n;
return r11 / m * m; return r11 / m * m;

View file

@ -48,7 +48,7 @@ lwpGetFirst(struct lwpQueue *q)
} }
void void
lwpAddTail(register struct lwpQueue *q, register struct lwpProc *p) lwpAddTail(struct lwpQueue *q, struct lwpProc *p)
{ {
if (!q->tail) if (!q->tail)
q->head = p; q->head = p;

View file

@ -167,7 +167,7 @@ getplayer(natid cnum)
void void
player_wakeup_all(natid cnum) player_wakeup_all(natid cnum)
{ {
register struct player *lp; struct player *lp;
if (NULL != (lp = getplayer(cnum))) if (NULL != (lp = getplayer(cnum)))
player_wakeup(lp); player_wakeup(lp);

View file

@ -44,9 +44,7 @@ border(struct range *rp, char *prefstr, char *sep)
/* prefixes each line */ /* prefixes each line */
/* separates the numbers */ /* separates the numbers */
{ {
register int posi; int posi, n, x;
register int n;
register int x;
if ((WORLD_X / 2) >= 100) { if ((WORLD_X / 2) >= 100) {
if (rp->lx + rp->width > 99 || rp->hx - rp->width < -99) { if (rp->lx + rp->width > 99 || rp->hx - rp->width < -99) {

View file

@ -41,12 +41,10 @@
#include "prototypes.h" #include "prototypes.h"
int int
distrea(int n, register struct trtstr *tp) distrea(int n, struct trtstr *tp)
{ {
register int i; int i;
int acond; int acond, bcond, cond;
int bcond;
int cond;
time_t now; time_t now;
if (tp->trt_status == TS_FREE) if (tp->trt_status == TS_FREE)

View file

@ -136,7 +136,7 @@ emp_getbit(int x, int y, unsigned char *bitmap)
void void
emp_setbit(int x, int y, unsigned char *bitmap) emp_setbit(int x, int y, unsigned char *bitmap)
{ {
register int id; int id;
id = (GCFy(y)) * WORLD_X / 2 + GCFx(x) / 2; id = (GCFy(y)) * WORLD_X / 2 + GCFx(x) / 2;
bitmap[id / 8] |= bit(id & 07); bitmap[id / 8] |= bit(id & 07);
@ -145,9 +145,9 @@ emp_setbit(int x, int y, unsigned char *bitmap)
static void static void
emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps) emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps)
{ {
register int *mp; int *mp;
register int id; int id;
register int dx, dy; int dx, dy;
for (mp = bitmaps; *mp != 9999;) { for (mp = bitmaps; *mp != 9999;) {
dx = x + *mp++; dx = x + *mp++;

View file

@ -48,8 +48,8 @@
int int
comtch(char *command, struct cmndstr *coms, int comstat) comtch(char *command, struct cmndstr *coms, int comstat)
{ {
register struct cmndstr *com; struct cmndstr *com;
register int status; int status;
if (command == 0 || *command == 0) if (command == 0 || *command == 0)
return M_IGNORE; return M_IGNORE;

View file

@ -43,7 +43,7 @@
int int
neigh(coord x, coord y, natid own) neigh(coord x, coord y, natid own)
{ {
register int i; int i;
struct sctstr sect; struct sctstr sect;
for (i = DIR_FIRST; i <= DIR_LAST; i++) { for (i = DIR_FIRST; i <= DIR_LAST; i++) {

View file

@ -154,7 +154,7 @@ init_nreport(void)
static struct newscache * static struct newscache *
ncache(int actor, int event, int victim, int times) ncache(int actor, int event, int victim, int times)
{ {
register struct newscache *np; struct newscache *np;
int i; int i;
int oldslot; int oldslot;
time_t oldtime; time_t oldtime;

View file

@ -52,9 +52,9 @@
#include "optlist.h" #include "optlist.h"
int int
trechk(register natid actor, register natid victim, int provision) trechk(natid actor, natid victim, int provision)
{ {
register natid cn; natid cn;
char buf[1024]; char buf[1024];
int news_verb; int news_verb;
int involved[MAXNOC]; int involved[MAXNOC];

View file

@ -43,9 +43,8 @@
void void
age_levels(int etu) age_levels(int etu)
{ {
register float best_tech; float best_tech, best_res;
register float best_res; struct natstr *np;
register struct natstr *np;
int i; int i;
double level; double level;
double delta; double delta;