diff --git a/Makefile b/Makefile index e2b8eddf52..6c4f22b584 100644 --- a/Makefile +++ b/Makefile @@ -35,11 +35,9 @@ BUILDDIR ?= $(ACK_TEMP_DIR)/ack-build CFLAGS ?= -g \ -Werror=return-type \ -Werror=implicit-function-declaration \ - -Werror=strict-prototypes \ - -fsanitize=unreachable + -Werror=strict-prototypes -LDFLAGS ?= -g \ - -fsanitize=unreachable +LDFLAGS ?= -g # Various commands. diff --git a/doc/em/even.c b/doc/em/even.c index 645d9b6b0c..de7ca5a0a2 100644 --- a/doc/em/even.c +++ b/doc/em/even.c @@ -1,5 +1,5 @@ main() { - register int l,j ; + int l,j ; for ( j=0 ; (l=getchar()) != -1 ; j++ ) { if ( j%16 == 15 ) printf("%3d\n",l&0377 ) ; diff --git a/doc/em/int/emdmp.c b/doc/em/int/emdmp.c index f6e3ab6e5a..408d3ae138 100644 --- a/doc/em/int/emdmp.c +++ b/doc/em/int/emdmp.c @@ -71,7 +71,7 @@ long getaddr(); main(argc,argv) char **argv; { - register i ; + i ; long line,fileaddr; char tok ; @@ -168,7 +168,7 @@ int read2() { long readaddr() { long res ; - register int i ; + int i ; res=0 ; for (i=0 ; i 0) { - register char *f; + char *f; sys_basename(file = *argvec++, BASE); ext = extension(file); @@ -977,8 +977,8 @@ static char * alloc(unsigned int u) static char * expand_string(char *s, struct system_information *sysinfo) { char buf[1024]; - register char *p = s; - register char *q = &buf[0]; + char *p = s; + char *q = &buf[0]; int expanded = 0; if (!p) @@ -1024,7 +1024,7 @@ static char * expand_string(char *s, struct system_information *sysinfo) return strcpy(p, buf); } -static void append(register struct arglist *al, char *arg) +static void append(struct arglist *al, char *arg) { if (!arg || !*arg) return; @@ -1033,10 +1033,10 @@ static void append(register struct arglist *al, char *arg) al->al_argv[(al->al_argc)++] = arg; } -static void expand(register struct arglist *al, struct system_information *sysinfo) +static void expand(struct arglist *al, struct system_information *sysinfo) { - register int i = al->al_argc; - register char **p = &(al->al_argv[0]); + int i = al->al_argc; + char **p = &(al->al_argv[0]); while (i-- > 0) { @@ -1047,9 +1047,9 @@ static void expand(register struct arglist *al, struct system_information *sysin static void concat(struct arglist *al1, struct arglist *al2) { - register int i = al2->al_argc; - register char **p = &(al1->al_argv[al1->al_argc]); - register char **q = &(al2->al_argv[0]); + int i = al2->al_argc; + char **p = &(al1->al_argv[al1->al_argc]); + char **q = &(al2->al_argv[0]); if ((al1->al_argc += i) >= MAXARGC) panic("argument list overflow"); @@ -1065,8 +1065,8 @@ char *mkstr(char *dst, ...) va_start(ap, dst); { - register char *p; - register char *q; + char *p; + char *q; q = dst; p = va_arg(ap, char *); @@ -1086,7 +1086,7 @@ char *mkstr(char *dst, ...) static char *extension(char *fn) { - register char *c = fn; + char *c = fn; while (*c++) ; diff --git a/fcc/driver/fcc.c b/fcc/driver/fcc.c index 101fa3fced..b7c1331ab8 100644 --- a/fcc/driver/fcc.c +++ b/fcc/driver/fcc.c @@ -174,7 +174,7 @@ main(argc, argv) char **argvec; int count; char *ext; - register struct arglist *call = &CALL_VEC; + struct arglist *call = &CALL_VEC; char *file; char *ldfile; int compile_cnt = 0; @@ -302,7 +302,7 @@ main(argc, argv) count = SRCFILES.al_argc; argvec = &(SRCFILES.al_argv[0]); while (count-- > 0) { - register char *f; + char *f; basename(file = *argvec++, BASE); ext = extension(file); @@ -423,8 +423,8 @@ expand_string(s) char *s; { char buf[1024]; - register char *p = s; - register char *q = &buf[0]; + char *p = s; + char *q = &buf[0]; int expanded = 0; if (!p) return p; @@ -457,7 +457,7 @@ expand_string(s) } append(al, arg) - register struct arglist *al; + struct arglist *al; char *arg; { if (!arg || !*arg) return; @@ -467,10 +467,10 @@ append(al, arg) } expand(al) - register struct arglist *al; + struct arglist *al; { - register int i = al->al_argc; - register char **p = &(al->al_argv[0]); + int i = al->al_argc; + char **p = &(al->al_argv[0]); while (i-- > 0) { *p = expand_string(*p); @@ -481,9 +481,9 @@ expand(al) concat(al1, al2) struct arglist *al1, *al2; { - register i = al2->al_argc; - register char **p = &(al1->al_argv[al1->al_argc]); - register char **q = &(al2->al_argv[0]); + i = al2->al_argc; + char **p = &(al1->al_argv[al1->al_argc]); + char **q = &(al2->al_argv[0]); if ((al1->al_argc += i) >= MAXARGC) panic("argument list overflow"); @@ -501,8 +501,8 @@ mkstr(char *dst, ...) va_start(ap, dst); { - register char *p; - register char *q; + char *p; + char *q; q = dst; p = va_arg(ap, char *); @@ -528,8 +528,8 @@ mkstr(va_alist) va_start(ap); { - register char *p; - register char *q; + char *p; + char *q; dst = q = va_arg(ap, char *); p = va_arg(ap, char *); @@ -548,10 +548,10 @@ mkstr(va_alist) basename(str, dst) char *str; - register char *dst; + char *dst; { - register char *p1 = str; - register char *p2 = p1; + char *p1 = str; + char *p2 = p1; while (*p1) if (*p1++ == '/') @@ -571,7 +571,7 @@ char * extension(fn) char *fn; { - register char *c = fn; + char *c = fn; while (*c++) ; while (*--c != '.' && c >= fn) { } @@ -642,9 +642,9 @@ panic(str) } pr_vec(vec) - register struct arglist *vec; + struct arglist *vec; { - register char **ap = &vec->al_argv[1]; + char **ap = &vec->al_argv[1]; vec->al_argv[vec->al_argc] = 0; fprintf(stderr, "%s", *ap); @@ -656,7 +656,7 @@ pr_vec(vec) extern int errno; ex_vec(vec) - register struct arglist *vec; + struct arglist *vec; { if (noexec) exit(0); diff --git a/lang/a68s/liba68s/entier.c b/lang/a68s/liba68s/entier.c index 474ad4778c..b359c1d694 100644 --- a/lang/a68s/liba68s/entier.c +++ b/lang/a68s/liba68s/entier.c @@ -1,6 +1,6 @@ int ENTIER(statlink, a) int *statlink ; - register double a ; + double a ; { int n ; n = ( int ) a ; @@ -8,6 +8,6 @@ int ENTIER(statlink, a) } int ROUN(statlink,a) int *statlink ; - register double a ; + double a ; { return(ENTIER(statlink, a+0.5)) ; } diff --git a/lang/a68s/liba68s/exit.c b/lang/a68s/liba68s/exit.c index b1f73107fb..ef5d7dced7 100644 --- a/lang/a68s/liba68s/exit.c +++ b/lang/a68s/liba68s/exit.c @@ -2,7 +2,7 @@ cleenup() { - register FILE *iop ; + FILE *iop ; extern FILE *_lastbuf ; for ( iop = _iob ; iop < _lastbuf ; iop ++ ) diff --git a/lang/a68s/liba68s/powr.c b/lang/a68s/liba68s/powr.c index e93648dfa9..2007a920ac 100644 --- a/lang/a68s/liba68s/powr.c +++ b/lang/a68s/liba68s/powr.c @@ -4,7 +4,7 @@ double POWR(statlink, pow, num) double num ; { int p ; - register double n, r; + double n, r; if (pow < 0) { p = -pow; n = 1.0/num; diff --git a/lang/a68s/liba68s/signr.c b/lang/a68s/liba68s/signr.c index 1c2b7df875..d8143d1955 100644 --- a/lang/a68s/liba68s/signr.c +++ b/lang/a68s/liba68s/signr.c @@ -1,4 +1,4 @@ SIGNR(statlink, n) int *statlink ; - register double n ; + double n ; { return( n < 0.0 ? - 1 : n == 0.0 ? 0 : 1 ) ; } diff --git a/lang/a68s/liba68s/timesten.c b/lang/a68s/liba68s/timesten.c index 8da4de998a..4ecbebbafe 100644 --- a/lang/a68s/liba68s/timesten.c +++ b/lang/a68s/liba68s/timesten.c @@ -3,7 +3,7 @@ double TIMESTE(pow, a) double a; int pow; { int p ; - register double n, t, r, s; + double n, t, r, s; p = pow < 0 ? -pow : pow; n = 5.0; t = 2.0; diff --git a/lang/a68s/util/xref.c b/lang/a68s/util/xref.c index cc93b5abdb..71f175572d 100644 --- a/lang/a68s/util/xref.c +++ b/lang/a68s/util/xref.c @@ -118,9 +118,9 @@ int narg; exit(0); } -flags(s,ftype) register char *s; +flags(s,ftype) char *s; { - register c; + int c; s++; /* skip - */ switch (c = *s++) { @@ -165,9 +165,9 @@ flags(s,ftype) register char *s; } char *tail(s) -register char *s; +char *s; { - register char *t; + char *t; t = s; while (*s) @@ -178,7 +178,7 @@ register char *s; scan(s) char *s; { - register lastc; + lastc; linecount = 0; nflag = 0; @@ -238,7 +238,7 @@ scan(s) char *s; } suffix(s) -register char *s; +char *s; { while (*s) s++; if (*(s-2) == '.') @@ -269,8 +269,8 @@ struct link { buildhash() { - register struct link *p,*q; - register char *s; + struct link *p,*q; + char *s; int i; for (i=0; i= 0) { diff --git a/lang/basic/lib/read.c b/lang/basic/lib/read.c index 33a119a96c..796d3d5c3a 100644 --- a/lang/basic/lib/read.c +++ b/lang/basic/lib/read.c @@ -4,14 +4,14 @@ void _readln(void) { - register int c; + int c; while ((c = fgetc(_chanrd)) != EOF && c != '\n') ; } void readskip(void) { - register int c; + int c; #ifdef DEBUG printf("readskip\n"); #endif @@ -82,7 +82,7 @@ void _readflt(double* addr) void _readstr(String** s) { char buffer[1024]; - register int kar; + int kar; char* c; #ifdef DEBUG diff --git a/lang/basic/src/initialize.c b/lang/basic/src/initialize.c index d8838551e5..48f5363056 100644 --- a/lang/basic/src/initialize.c +++ b/lang/basic/src/initialize.c @@ -19,7 +19,7 @@ extern void fillkex(void); void initialize(void) { - register char *cindex, *cptr; + char *cindex, *cptr; int result1, result2; /* Find the basename */ diff --git a/lang/basic/src/parsepar.c b/lang/basic/src/parsepar.c index 32ee177db6..acfeb512fa 100644 --- a/lang/basic/src/parsepar.c +++ b/lang/basic/src/parsepar.c @@ -28,7 +28,7 @@ void parseparams(int argc,char **argv) { int files=0 ; int i; - register char *p; + char *p; if(argc< 4) { diff --git a/lang/cem/cemcom.ansi/LLlex.c b/lang/cem/cemcom.ansi/LLlex.c index 5ad20040ac..5a24464ac9 100644 --- a/lang/cem/cemcom.ansi/LLlex.c +++ b/lang/cem/cemcom.ansi/LLlex.c @@ -47,8 +47,8 @@ extern int lint_skip_comment; /* Internal function declarations */ static arith char_constant(char*); static char* string_token(char *, int , int *); -static int quoted(register int); -static int hex_val(register int); +static int quoted(int); +static int hex_val(int); static void strflt2tok(char [], struct token *); static void strint2tok(char [], struct token *); @@ -84,7 +84,7 @@ int LLlex(void) } -int GetToken(register struct token* ptok) +int GetToken(struct token* ptok) { /* GetToken() is the actual token recognizer. It calls the control line interpreter if it encounters a "\n{w}*#" @@ -92,7 +92,7 @@ int GetToken(register struct token* ptok) needed. */ char buf[(IDFSIZE > NUMSIZE ? IDFSIZE : NUMSIZE) + 1]; - register int ch, nch; + int ch, nch; token_nmb++; @@ -269,9 +269,9 @@ int GetToken(register struct token* ptok) /* fallthrough */ case STIDF: { - register char* tg = &buf[0]; - register int pos = -1; - register struct idf* idef; + char* tg = &buf[0]; + int pos = -1; + struct idf* idef; extern int idfsize; /* ??? */ do { /* read the identifier */ @@ -298,8 +298,8 @@ int GetToken(register struct token* ptok) } case STNUM: /* a numeric constant */ { - register int siz_left = NUMSIZE - 1; - register char* np = &buf[0]; + int siz_left = NUMSIZE - 1; + char* np = &buf[0]; int flags = 0; #define store(ch) \ @@ -390,8 +390,8 @@ int GetToken(register struct token* ptok) static arith char_constant(char* nm) { - register arith val = 0; - register int ch; + arith val = 0; + int ch; int size = 0; ch = GetChar(); @@ -424,10 +424,10 @@ static arith char_constant(char* nm) static char* string_token(char *nm, int stop_char, int *plen) { - register int ch; - register int str_size; - register char* str = Malloc((unsigned)(str_size = ISTRSIZE)); - register int pos = 0; + int ch; + int str_size; + char* str = Malloc((unsigned)(str_size = ISTRSIZE)); + int pos = 0; ch = GetChar(); while (ch != stop_char) @@ -455,7 +455,7 @@ static char* string_token(char *nm, int stop_char, int *plen) return str; } -static int quoted(register int ch) +static int quoted(int ch) { /* quoted() replaces an escaped character sequence by the character meant. @@ -488,8 +488,8 @@ static int quoted(register int ch) break; case 'x': /* quoted hex */ { - register int hex = 0; - register int vch; + int hex = 0; + int vch; for (;;) { @@ -505,7 +505,7 @@ static int quoted(register int ch) } else { /* a quoted octal */ - register int oct = 0, cnt = 0; + int oct = 0, cnt = 0; do { @@ -518,7 +518,7 @@ static int quoted(register int ch) return ch & 0377; } -static int hex_val(register int ch) +static int hex_val(int ch) { return is_dig(ch) ? ch - '0' : is_hex(ch) ? (ch - 'a' + 10) & 017 : -1; } @@ -528,7 +528,7 @@ int GetChar(void) /* The routines GetChar and trigraph parses the trigraph sequences and removes occurences of \\\n. */ - register int ch; + int ch; LoadChar(ch); return (LexSave = ch); @@ -539,7 +539,7 @@ int GetChar(void) */ static void strflt2tok(char fltbuf[], struct token* ptok) { - register char* cp = fltbuf; + char* cp = fltbuf; int malformed = 0; while (is_dig(*cp)) @@ -593,7 +593,7 @@ static void strflt2tok(char fltbuf[], struct token* ptok) static void strint2tok(char intbuf[], struct token* ptok) { - register char* cp = intbuf; + char* cp = intbuf; int base = 10, dig; unsigned writh val = 0, ubound; int uns_flg = 0, lng_flg = 0, lnglng_flg = 0; diff --git a/lang/cem/cemcom.ansi/LLlex.h b/lang/cem/cemcom.ansi/LLlex.h index a7c1e0e81b..7c9102b3e8 100644 --- a/lang/cem/cemcom.ansi/LLlex.h +++ b/lang/cem/cemcom.ansi/LLlex.h @@ -61,7 +61,7 @@ extern int err_occurred; /* "error.c" */ extern int GetChar(void); extern int LLlex(void); -extern int GetToken(register struct token* ptok); +extern int GetToken(struct token* ptok); extern char* symbol2str(int tok); #endif /* LLLEX_H_ */ diff --git a/lang/cem/cemcom.ansi/arith.c b/lang/cem/cemcom.ansi/arith.c index 0516e419a6..8016abfc11 100644 --- a/lang/cem/cemcom.ansi/arith.c +++ b/lang/cem/cemcom.ansi/arith.c @@ -36,7 +36,7 @@ extern char options[]; /* 3.1.2.5 */ -void arithbalance(register struct expr **e1p, int oper, register struct expr **e2p) +void arithbalance(struct expr **e1p, int oper, struct expr **e2p) { /* The expressions *e1p and *e2p are balanced to be operands of the arithmetic operator oper. @@ -209,7 +209,7 @@ void arithbalance(register struct expr **e1p, int oper, register struct expr **e } } -void relbalance(register struct expr **e1p, int oper, register struct expr **e2p) +void relbalance(struct expr **e1p, int oper, struct expr **e2p) { /* The expressions *e1p and *e2p are balanced to be operands of the relational operator oper, or the ':'. @@ -218,7 +218,7 @@ void relbalance(register struct expr **e1p, int oper, register struct expr **e2p allows assignments of a null-pointer to a function pointer. */ - register struct expr *e1 = *e1p, *e2 = *e2p; + struct expr *e1 = *e1p, *e2 = *e2p; struct expr *tmpexpr; if (e1->ex_type->tp_fund == POINTER @@ -241,13 +241,13 @@ void relbalance(register struct expr **e1p, int oper, register struct expr **e2p arithbalance(e1p, oper, e2p); } -void ch3pointer(struct expr **expp, int oper, register struct type *tp) +void ch3pointer(struct expr **expp, int oper, struct type *tp) { /* Checks whether *expp may be compared to tp using oper, as described in chapter 3.3.8 and 3.3.9. tp is known to be a pointer. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; if (exp->ex_type->tp_fund == POINTER) { if (exp->ex_type != tp) @@ -273,7 +273,7 @@ void ch3pointer(struct expr **expp, int oper, register struct type *tp) } int -any2arith(register struct expr **expp, register int oper) +any2arith(struct expr **expp, int oper) { /* Turns any expression into int_type, long_type, float_type, double_type or lngdbl_type. @@ -334,7 +334,7 @@ void erroneous2int(struct expr **expp) /* the (erroneous) expression *expp is replaced by an int expression */ - register struct expr *exp = *expp; + struct expr *exp = *expp; int flags = exp->ex_flags; free_expression(exp); @@ -343,12 +343,12 @@ void erroneous2int(struct expr **expp) *expp = exp; } -struct expr *arith2arith(struct type *tp, int oper, register struct expr *expr) +struct expr *arith2arith(struct type *tp, int oper, struct expr *expr) { /* arith2arith constructs a new expression containing a run-time conversion between some arithmetic types. */ - register struct expr *new = new_expr(); + struct expr *new = new_expr(); new->ex_file = expr->ex_file; new->ex_line = expr->ex_line; @@ -357,15 +357,15 @@ struct expr *arith2arith(struct type *tp, int oper, register struct expr *expr) return new_oper(tp, new, oper, expr); } -int int2int(struct expr **expp, register struct type *tp) +int int2int(struct expr **expp, struct type *tp) { /* The expression *expp, which is of some integral type, is converted to the integral type tp. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; if (is_cp_cst(exp)) { - register struct type *tp1 = exp->ex_type; + struct type *tp1 = exp->ex_type; exp->ex_type = tp; if (! tp1->tp_unsigned && tp->tp_unsigned) { @@ -404,12 +404,12 @@ static int fit4(writh val, int uns) /* With compile-time constants, we don't set fp_used, since this is done * only when necessary in eval.c. */ -void int2float(register struct expr **expp, struct type *tp) +void int2float(struct expr **expp, struct type *tp) { /* The expression *expp, which is of some integral type, is converted to the floating type tp. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; int uns = exp->ex_type->tp_unsigned; if (is_cp_cst(exp) && fit4(exp->VL_VALUE, uns)) { @@ -428,7 +428,7 @@ void float2int(struct expr **expp, struct type *tp) /* The expression *expp, which is of some floating type, is converted to the integral type tp. */ - register struct expr *ex = *expp; + struct expr *ex = *expp; if (is_fp_cst(ex)) { arith ar = flt_flt2arith(&ex->FL_ARITH, tp->tp_unsigned); @@ -460,7 +460,7 @@ void float2int(struct expr **expp, struct type *tp) *expp = arith2arith(tp, FLOAT2INT, ex); } -void float2float(register struct expr **expp, struct type *tp) +void float2float(struct expr **expp, struct type *tp) { /* The expression *expp, which is of some floating type, is converted to the floating type tp. @@ -476,7 +476,7 @@ void float2float(register struct expr **expp, struct type *tp) } } -void array2pointer(register struct expr *exp) +void array2pointer(struct expr *exp) { /* The expression, which must be an array, is converted to a pointer. @@ -486,7 +486,7 @@ void array2pointer(register struct expr *exp) , (arith)0, NO_PROTO); } -void function2pointer(register struct expr *exp) +void function2pointer(struct expr *exp) { /* The expression, which must be a function, is converted to a pointer to the function. @@ -495,7 +495,7 @@ void function2pointer(register struct expr *exp) (arith)0, NO_PROTO); } -void string2pointer(register struct expr *ex) +void string2pointer(struct expr *ex) { /* The expression, which must be a string constant, is converted to a pointer to the string-containing area. @@ -509,9 +509,9 @@ void string2pointer(register struct expr *ex) ex->VL_VALUE = (arith)0; } -void opnd2integral(register struct expr **expp, int oper) +void opnd2integral(struct expr **expp, int oper) { - register int fund = (*expp)->ex_type->tp_fund; + int fund = (*expp)->ex_type->tp_fund; if (fund != INT && fund != LONG && fund != LNGLNG) { expr_error(*expp, "%s operand to %s", @@ -521,7 +521,7 @@ void opnd2integral(register struct expr **expp, int oper) } } -void opnd2logical(register struct expr **expp, int oper) +void opnd2logical(struct expr **expp, int oper) { int fund = (*expp)->ex_type->tp_fund; @@ -559,7 +559,7 @@ void opnd2logical(register struct expr **expp, int oper) } void -opnd2test(register struct expr **expp, int oper) +opnd2test(struct expr **expp, int oper) { opnd2logical(expp, oper); if ((*expp)->ex_class == Oper) { @@ -583,7 +583,7 @@ opnd2test(register struct expr **expp, int oper) ch3bin(expp, NOTEQUAL, intexpr((arith)0, INT)); } -void any2opnd(register struct expr **expp, int oper) +void any2opnd(struct expr **expp, int oper) { if (!*expp) return; @@ -615,7 +615,7 @@ void any2opnd(register struct expr **expp, int oper) } } -void any2parameter(register struct expr **expp) +void any2parameter(struct expr **expp) { /* To handle default argument promotions */ @@ -628,13 +628,13 @@ void any2parameter(register struct expr **expp) } #ifndef NOBITFIELD -void field2arith(register struct expr **expp) +void field2arith(struct expr **expp) { /* The expression to extract the bitfield value from the memory word is put in the tree. */ - register struct type *tp = (*expp)->ex_type->tp_up; - register struct field *fd = (*expp)->ex_type->tp_field; + struct type *tp = (*expp)->ex_type->tp_up; + struct field *fd = (*expp)->ex_type->tp_field; (*expp)->ex_type = word_type; @@ -659,7 +659,7 @@ void field2arith(register struct expr **expp) /* switch_sign_fp() negates the given floating constant expression, * and frees the string representing the old value. */ -void switch_sign_fp(register struct expr *expr) +void switch_sign_fp(struct expr *expr) { flt_umin(&(expr->FL_ARITH)); } diff --git a/lang/cem/cemcom.ansi/arith.h b/lang/cem/cemcom.ansi/arith.h index bf2bcbd612..6491bc0eb2 100644 --- a/lang/cem/cemcom.ansi/arith.h +++ b/lang/cem/cemcom.ansi/arith.h @@ -35,26 +35,26 @@ struct type; extern writh full_mask[]; /* cstoper.c */ -void arithbalance(register struct expr **e1p, int oper, register struct expr **e2p); -void relbalance(register struct expr **e1p, int oper, register struct expr **e2p); -void ch3pointer(struct expr **expp, int oper, register struct type *tp); -int any2arith(register struct expr **expp, register int oper); +void arithbalance(struct expr **e1p, int oper, struct expr **e2p); +void relbalance(struct expr **e1p, int oper, struct expr **e2p); +void ch3pointer(struct expr **expp, int oper, struct type *tp); +int any2arith(struct expr **expp, int oper); void erroneous2int(struct expr **expp); -struct expr *arith2arith(struct type *tp, int oper, register struct expr *expr); -int int2int(struct expr **expp, register struct type *tp); -void int2float(register struct expr **expp, struct type *tp); +struct expr *arith2arith(struct type *tp, int oper, struct expr *expr); +int int2int(struct expr **expp, struct type *tp); +void int2float(struct expr **expp, struct type *tp); void float2int(struct expr **expp, struct type *tp); -void float2float(register struct expr **expp, struct type *tp); -void array2pointer(register struct expr *exp); -void function2pointer(register struct expr *exp); -void string2pointer(register struct expr *ex); -void opnd2integral(register struct expr **expp, int oper); -void opnd2logical(register struct expr **expp, int oper); -void opnd2test(register struct expr **expp, int oper); -void any2opnd(register struct expr **expp, int oper); -void any2parameter(register struct expr **expp); -void field2arith(register struct expr **expp); -void switch_sign_fp(register struct expr *expr); +void float2float(struct expr **expp, struct type *tp); +void array2pointer(struct expr *exp); +void function2pointer(struct expr *exp); +void string2pointer(struct expr *ex); +void opnd2integral(struct expr **expp, int oper); +void opnd2logical(struct expr **expp, int oper); +void opnd2test(struct expr **expp, int oper); +void any2opnd(struct expr **expp, int oper); +void any2parameter(struct expr **expp); +void field2arith(struct expr **expp); +void switch_sign_fp(struct expr *expr); char *writh2str(writh val, int uns); label code_string(char * val, int len); diff --git a/lang/cem/cemcom.ansi/ch3.c b/lang/cem/cemcom.ansi/ch3.c index 4db7565c14..14635c7df6 100644 --- a/lang/cem/cemcom.ansi/ch3.c +++ b/lang/cem/cemcom.ansi/ch3.c @@ -36,9 +36,9 @@ void ch3sel(struct expr **expp, int oper, struct idf *idf) /* The selector idf is applied to *expp; oper may be '.' or ARROW. */ - register struct expr *exp; - register struct type *tp; - register struct sdef *sd; + struct expr *exp; + struct type *tp; + struct sdef *sd; any2opnd(expp, oper); exp = *expp; @@ -171,15 +171,15 @@ void ch3incr(struct expr **expp, int oper) ch3asgn(expp, oper, intexpr((arith)1, INT)); } -void ch3cast(register struct expr **expp, int oper, register struct type *tp) +void ch3cast(struct expr **expp, int oper, struct type *tp) { /* The expression *expp is cast to type tp; the cast is caused by the operator oper. If the cast has to be passed on to run time, its left operand will be an expression of class Type. */ - register struct type *oldtp; - register struct expr *exp = *expp; + struct type *oldtp; + struct expr *exp = *expp; int qual_lev, ascompat = 0; if (oper == RETURN && tp->tp_fund == VOID) { @@ -408,7 +408,7 @@ void ch3cast(register struct expr **expp, int oper, register struct type *tp) /* Determine whether two types are equal. */ -int equal_type(register struct type *tp,register struct type *otp, int qual_lev, int diag) +int equal_type(struct type *tp,struct type *otp, int qual_lev, int diag) { if (tp == otp) return 1; @@ -469,7 +469,7 @@ int equal_type(register struct type *tp,register struct type *otp, int qual_lev, } } -int check_pseudoproto(register struct proto *pl,register struct proto *opl, int diag) +int check_pseudoproto(struct proto *pl,struct proto *opl, int diag) { int retval = 1; @@ -516,7 +516,7 @@ int legal_mixture(struct type *tp, struct type *otp, int diag) { struct proto *pl = tp->tp_proto, *opl = otp->tp_proto; int retval = 1; - register struct proto *prot; + struct proto *prot; int fund; assert( (pl != 0) ^ (opl != 0)); @@ -553,7 +553,7 @@ int legal_mixture(struct type *tp, struct type *otp, int diag) return retval; } -int equal_proto(register struct proto *pl, register struct proto *opl, int diag) +int equal_proto(struct proto *pl, struct proto *opl, int diag) { if (pl == opl) return 1; @@ -577,7 +577,7 @@ int equal_proto(register struct proto *pl, register struct proto *opl, int diag) /* check if a type has a consqualified member */ int recurqual(struct type *tp, int qual) { - register struct sdef *sdf; + struct sdef *sdf; assert(tp); @@ -612,7 +612,7 @@ void ch3asgn(struct expr **expp, int oper, struct expr *expr) f (typeof (f op e))e EVAL should however take care of evaluating (typeof (f op e))f */ - register struct expr *exp = *expp; + struct expr *exp = *expp; int fund = exp->ex_type->tp_fund; struct type *tp; char *oper_string = symbol2str(oper); @@ -672,7 +672,7 @@ void ch3asgn(struct expr **expp, int oper, struct expr *expr) /* Some interesting (?) questions answered. */ -int is_integral_type(register struct type *tp) +int is_integral_type(struct type *tp) { switch (tp->tp_fund) { case CHAR: @@ -691,7 +691,7 @@ int is_integral_type(register struct type *tp) } } -int is_arith_type(register struct type *tp) +int is_arith_type(struct type *tp) { switch (tp->tp_fund) { case CHAR: diff --git a/lang/cem/cemcom.ansi/ch3.h b/lang/cem/cemcom.ansi/ch3.h index a8970f75eb..c5d0bd2299 100644 --- a/lang/cem/cemcom.ansi/ch3.h +++ b/lang/cem/cemcom.ansi/ch3.h @@ -16,14 +16,14 @@ struct idf; void ch3sel(struct expr **expp, int oper, struct idf *idf); void ch3incr(struct expr **expp, int oper); -void ch3cast(register struct expr **expp, int oper, register struct type *tp); -int equal_type(register struct type *tp,register struct type *otp, int qual_lev, int diag); -int check_pseudoproto(register struct proto *pl,register struct proto *opl, int diag); +void ch3cast(struct expr **expp, int oper, struct type *tp); +int equal_type(struct type *tp,struct type *otp, int qual_lev, int diag); +int check_pseudoproto(struct proto *pl,struct proto *opl, int diag); int legal_mixture(struct type *tp, struct type *otp, int diag); -int equal_proto(register struct proto *pl, register struct proto *opl, int diag); +int equal_proto(struct proto *pl, struct proto *opl, int diag); int recurqual(struct type *tp, int qual); void ch3asgn(struct expr **expp, int oper, struct expr *expr); -int is_integral_type(register struct type *tp); -int is_arith_type(register struct type *tp); +int is_integral_type(struct type *tp); +int is_arith_type(struct type *tp); #endif /* CH3_H_ */ diff --git a/lang/cem/cemcom.ansi/ch3bin.c b/lang/cem/cemcom.ansi/ch3bin.c index fce82dd8b6..0f502255dc 100644 --- a/lang/cem/cemcom.ansi/ch3bin.c +++ b/lang/cem/cemcom.ansi/ch3bin.c @@ -38,12 +38,12 @@ extern char options[]; #define commutative_binop(expp, oper, expr) mk_binop(expp, oper, expr, 1) #define non_commutative_relop(expp, oper, expr) mk_binop(expp, oper, expr, 1) -void ch3bin(register struct expr **expp, int oper, struct expr *expr) +void ch3bin(struct expr **expp, int oper, struct expr *expr) { /* apply binary operator oper between *expp and expr. NB: don't swap operands if op is one of the op= operators!!! */ - register struct type *expp_tp; + struct type *expp_tp; any2opnd(expp, oper); expp_tp = (*expp)->ex_type; @@ -197,7 +197,7 @@ void ch3bin(register struct expr **expp, int oper, struct expr *expr) opnd2test(expp, oper); opnd2test(&expr, oper); if (is_cp_cst(*expp)) { - register struct expr *ex = *expp; + struct expr *ex = *expp; /* the following condition is a short-hand for ((oper == AND) && o1) || ((oper == OR) && !o1) @@ -296,7 +296,7 @@ void ch3bin(register struct expr **expp, int oper, struct expr *expr) } } -void pntminuspnt(register struct expr **expp, int oper, register struct expr *expr) +void pntminuspnt(struct expr **expp, int oper, struct expr *expr) { /* Subtracting two pointers is so complicated it merits a routine of its own. @@ -338,13 +338,13 @@ int arg_switched(int oper) } } -void mk_binop(struct expr **expp, int oper, register struct expr *expr, int commutative) +void mk_binop(struct expr **expp, int oper, struct expr *expr, int commutative) { /* Constructs in *expp the operation indicated by the operands. "commutative" indicates whether "oper" is a commutative operator. */ - register struct expr *ex = *expp; + struct expr *ex = *expp; if (is_cp_cst(expr) && is_cp_cst(ex)) cstbin(expp, oper, expr); @@ -362,7 +362,7 @@ void mk_binop(struct expr **expp, int oper, register struct expr *expr, int comm } } -void pointer_arithmetic(register struct expr **expp1, int oper, register struct expr **expp2) +void pointer_arithmetic(struct expr **expp1, int oper, struct expr **expp2) { int typ; /* prepares the integral expression expp2 in order to @@ -382,7 +382,7 @@ void pointer_arithmetic(register struct expr **expp1, int oper, register struct ); } -void pointer_binary(register struct expr **expp, int oper, register struct expr *expr) +void pointer_binary(struct expr **expp, int oper, struct expr *expr) { /* constructs the pointer arithmetic expression out of a pointer expression, a binary operator and an integral diff --git a/lang/cem/cemcom.ansi/ch3bin.h b/lang/cem/cemcom.ansi/ch3bin.h index bc6ea2d200..ce9cf9fd05 100644 --- a/lang/cem/cemcom.ansi/ch3bin.h +++ b/lang/cem/cemcom.ansi/ch3bin.h @@ -10,12 +10,12 @@ struct expr; -void ch3bin(register struct expr **expp, int oper, struct expr *expr); -void pntminuspnt(register struct expr **expp, int oper, register struct expr *expr); +void ch3bin(struct expr **expp, int oper, struct expr *expr); +void pntminuspnt(struct expr **expp, int oper, struct expr *expr); int arg_switched(int oper); -void mk_binop(struct expr **expp, int oper, register struct expr *expr, int commutative); -void pointer_arithmetic(register struct expr **expp1, int oper, register struct expr **expp2); -void pointer_binary(register struct expr **expp, int oper, register struct expr *expr); +void mk_binop(struct expr **expp, int oper, struct expr *expr, int commutative); +void pointer_arithmetic(struct expr **expp1, int oper, struct expr **expp2); +void pointer_binary(struct expr **expp, int oper, struct expr *expr); #endif /* CH3BIN_H_ */ diff --git a/lang/cem/cemcom.ansi/ch3mon.c b/lang/cem/cemcom.ansi/ch3mon.c index 5c199a6d5b..3185df7676 100644 --- a/lang/cem/cemcom.ansi/ch3mon.c +++ b/lang/cem/cemcom.ansi/ch3mon.c @@ -24,11 +24,11 @@ extern char options[]; -void ch3mon(int oper, register struct expr **expp) +void ch3mon(int oper, struct expr **expp) { /* The monadic prefix operator oper is applied to *expp. */ - register struct expr *expr; + struct expr *expr; if (oper != PLUSPLUS && oper != MINMIN) any2opnd(expp, oper); @@ -86,7 +86,7 @@ void ch3mon(int oper, register struct expr **expp) else { /* assume that enums are already filtered out */ if (ISNAME(*expp)) { - register struct def *def = + struct def *def = (*expp)->VL_IDF->id_def; /* & indicates that diff --git a/lang/cem/cemcom.ansi/ch3mon.h b/lang/cem/cemcom.ansi/ch3mon.h index 354738c42d..e269f137d0 100644 --- a/lang/cem/cemcom.ansi/ch3mon.h +++ b/lang/cem/cemcom.ansi/ch3mon.h @@ -10,13 +10,13 @@ struct expr; -void ch3mon(int oper, register struct expr **expp); -void ch3bin(register struct expr **expp, int oper, struct expr *expr); -void pntminuspnt(register struct expr **expp, int oper, register struct expr *expr); +void ch3mon(int oper, struct expr **expp); +void ch3bin(struct expr **expp, int oper, struct expr *expr); +void pntminuspnt(struct expr **expp, int oper, struct expr *expr); int arg_switched(int oper); -void mk_binop(struct expr **expp, int oper, register struct expr *expr, int commutative); -void pointer_arithmetic(register struct expr **expp1, int oper, register struct expr **expp2); -void pointer_binary(register struct expr **expp, int oper, register struct expr *expr); +void mk_binop(struct expr **expp, int oper, struct expr *expr, int commutative); +void pointer_arithmetic(struct expr **expp1, int oper, struct expr **expp2); +void pointer_binary(struct expr **expp, int oper, struct expr *expr); #endif /* CH3MON_H_ */ diff --git a/lang/cem/cemcom.ansi/code.c b/lang/cem/cemcom.ansi/code.c index dbe9a433e0..9975d268a0 100644 --- a/lang/cem/cemcom.ansi/code.c +++ b/lang/cem/cemcom.ansi/code.c @@ -57,7 +57,7 @@ label datlab_count = 1; int fp_used; -extern void str_cst(register char *, register int, int); /* ival.c */ +extern void str_cst(char *, int, int); /* ival.c */ @@ -121,7 +121,7 @@ struct string_cst *str_list = 0; label code_string(char* val, int len) { - register struct string_cst *sc = new_string_cst(); + struct string_cst *sc = new_string_cst(); label dlb = data_label(); C_ina_dlb(dlb); @@ -133,7 +133,7 @@ label code_string(char* val, int len) return dlb; } -void def_strings(register struct string_cst *sc) +void def_strings(struct string_cst *sc) { while (sc) { struct string_cst *sc1 = sc; @@ -176,13 +176,13 @@ void prepend_scopes(void) and generates those exa's, exp's, ina's and inp's that superior hindsight has provided. */ - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; #ifdef USE_TMP C_beginpart(tmp_id); #endif /* USE_TMP */ while (se != 0) { - register struct def *df = se->se_idf->id_def; + struct def *df = se->se_idf->id_def; if (df && (df->df_initialized || df->df_used || df->df_alloc)) { code_scope(se->se_idf->id_text, df); @@ -195,7 +195,7 @@ void prepend_scopes(void) } #endif /* PREPEND_SCOPES */ -void code_scope(char* text, register struct def *def) +void code_scope(char* text, struct def *def) { /* generates code for one name, text, of the storage class as given by def, if meaningful. @@ -236,8 +236,8 @@ void begin_proc(struct decspecs *ds, struct idf *idf) /* to be called when ente does not fit in the return area - a fil pseudo instruction */ - register char *name = idf->id_text; - register struct def *def = idf->id_def; + char *name = idf->id_text; + struct def *def = idf->id_def; /* idf->id_def does not indicate the right def structure * when the function being defined has a parameter of the @@ -423,7 +423,7 @@ void do_return_expr(struct expr *expr) void code_declaration( - register struct idf *idf, /* idf to be declared */ + struct idf *idf, /* idf to be declared */ struct expr *expr, /* initialisation; NULL if absent */ int lvl, /* declaration level */ int sc) /* storage class, as in the declaration */ @@ -447,8 +447,8 @@ code_declaration( The sc is the actual storage class, as given in the declaration. */ - register struct def *def = idf->id_def; - register arith size = def->df_type->tp_size; + struct def *def = idf->id_def; + arith size = def->df_type->tp_size; int fund = def->df_type->tp_fund; int def_sc = def->df_sc; @@ -540,9 +540,9 @@ void loc_init(struct expr *expr, struct idf *id) expression expr to the local variable described by id. It frees the expression afterwards. */ - register struct expr *e = expr; - register struct def *df = id->id_def; - register struct type *tp = df->df_type; + struct expr *e = expr; + struct def *df = id->id_def; + struct type *tp = df->df_type; static arith tmpoffset = 0; static arith unknownsize = 0; @@ -610,11 +610,11 @@ void loc_init(struct expr *expr, struct idf *id) } } -void bss(register struct idf *idf) +void bss(struct idf *idf) { /* bss() allocates bss space for the global idf. */ - register struct def *df = idf->id_def; + struct def *df = idf->id_def; #ifndef PREPEND_SCOPES code_scope(idf->id_text, df); @@ -640,13 +640,13 @@ void bss(register struct idf *idf) } } -void formal_cvt(int hasproto, register struct def *df) +void formal_cvt(int hasproto, struct def *df) { /* formal_cvt() converts a formal parameter of type char or short from int to that type. It also converts a formal parameter of type float from a double to a float. */ - register struct type *tp = df->df_type; + struct type *tp = df->df_type; if (tp->tp_size != int_size && (tp->tp_fund == CHAR || tp->tp_fund == SHORT) @@ -705,7 +705,7 @@ static struct stmt_block *stmt_stack; /* top of statement stack */ */ void code_break(void) { - register struct stmt_block *stmt_block = stmt_stack; + struct stmt_block *stmt_block = stmt_stack; #ifdef DBSYMTAB if (options['g']) db_line(dot.tk_file, dot.tk_line); @@ -724,7 +724,7 @@ void code_break(void) void code_continue(void) { - register struct stmt_block *stmt_block = stmt_stack; + struct stmt_block *stmt_block = stmt_stack; while (stmt_block) { if (stmt_block->st_continue) { @@ -741,7 +741,7 @@ code_continue(void) void stack_stmt(label break_label, label cont_label) { - register struct stmt_block *stmt_block = new_stmt_block(); + struct stmt_block *stmt_block = new_stmt_block(); stmt_block->next = stmt_stack; stmt_block->st_break = break_label; @@ -754,7 +754,7 @@ void unstack_stmt(void) /* unstack_stmt() unstacks the data of a statement which may contain break or continue */ - register struct stmt_block *sbp = stmt_stack; + struct stmt_block *sbp = stmt_stack; stmt_stack = sbp->next; free_stmt_block(sbp); } diff --git a/lang/cem/cemcom.ansi/conversion.c b/lang/cem/cemcom.ansi/conversion.c index b4da2ae62f..22986ef13b 100644 --- a/lang/cem/cemcom.ansi/conversion.c +++ b/lang/cem/cemcom.ansi/conversion.c @@ -31,12 +31,12 @@ C?? */ -static int convtype(register struct type *); +static int convtype(struct type *); -void conversion(register struct type *from_type, register struct type *to_type) +void conversion(struct type *from_type, struct type *to_type) { - register arith from_size = from_type->tp_size; - register arith to_size = to_type->tp_size; + arith from_size = from_type->tp_size; + arith to_size = to_type->tp_size; int from_cnvtype = convtype(from_type); int to_cnvtype = convtype(to_type); @@ -127,7 +127,7 @@ void conversion(register struct type *from_type, register struct type *to_type) /* convtype() returns in which category a given type falls: signed, unsigned or floating */ -static int convtype(register struct type *tp) +static int convtype(struct type *tp) { switch (tp->tp_fund) { case CHAR: diff --git a/lang/cem/cemcom.ansi/conversion.h b/lang/cem/cemcom.ansi/conversion.h index 25756a94d3..3c201109c0 100644 --- a/lang/cem/cemcom.ansi/conversion.h +++ b/lang/cem/cemcom.ansi/conversion.h @@ -10,6 +10,6 @@ struct type; -void conversion(register struct type *from_type, register struct type *to_type); +void conversion(struct type *from_type, struct type *to_type); #endif /* CONVERSION_H_ */ diff --git a/lang/cem/cemcom.ansi/cstoper.c b/lang/cem/cemcom.ansi/cstoper.c index 769c6940bf..d0e0818cf2 100644 --- a/lang/cem/cemcom.ansi/cstoper.c +++ b/lang/cem/cemcom.ansi/cstoper.c @@ -25,7 +25,7 @@ arith max_unsigned; /* maximum unsigned on target machine */ #endif /* NOCROSS */ extern int ResultKnown; -void cstbin(register struct expr **expp, int oper, register struct expr *expr) +void cstbin(struct expr **expp, int oper, struct expr *expr) { /* The operation oper is performed on the constant expressions *expp(ld) and expr(ct), and the result restored in @@ -134,7 +134,7 @@ void cstbin(register struct expr **expp, int oper, register struct expr *expr) free_expression(expr); } -void cut_size(register struct expr *expr) +void cut_size(struct expr *expr) { /* The constant value of the expression expr is made to conform to the size of the type of the expression. @@ -171,7 +171,7 @@ void cut_size(register struct expr *expr) void init_cst(void) { - register int i = 0; + int i = 0; unsigned writh bt = 0; while (!((writh)bt < 0)) { diff --git a/lang/cem/cemcom.ansi/cstoper.h b/lang/cem/cemcom.ansi/cstoper.h index 4d0d971f18..68065b6e32 100644 --- a/lang/cem/cemcom.ansi/cstoper.h +++ b/lang/cem/cemcom.ansi/cstoper.h @@ -10,8 +10,8 @@ struct expr; -void cstbin(register struct expr **expp, int oper, register struct expr *expr); -void cut_size(register struct expr *expr); +void cstbin(struct expr **expp, int oper, struct expr *expr); +void cut_size(struct expr *expr); void init_cst(void); #endif /* CSTOPER_H_ */ diff --git a/lang/cem/cemcom.ansi/declar.g b/lang/cem/cemcom.ansi/declar.g index 56d8596eb1..bcf3877ab6 100644 --- a/lang/cem/cemcom.ansi/declar.g +++ b/lang/cem/cemcom.ansi/declar.g @@ -85,7 +85,7 @@ declaration an erroneous type-identifier. */ -decl_specifiers /* non-empty */ (register struct decspecs *ds;) +decl_specifiers /* non-empty */ (struct decspecs *ds;) /* Reads a non-empty decl_specifiers and fills the struct decspecs *ds. */ @@ -101,7 +101,7 @@ decl_specifiers /* non-empty */ (register struct decspecs *ds;) {do_decspecs(ds);} ; -single_decl_specifier /* non_empty */ (register struct decspecs *ds;) +single_decl_specifier /* non_empty */ (struct decspecs *ds;) : [ AUTO | STATIC | EXTERN | TYPEDEF | REGISTER ] { if (ds->ds_sc_given) @@ -192,7 +192,7 @@ init_declarator_list(struct decspecs *ds;): [ ',' init_declarator(ds) ]* ; -init_declarator(register struct decspecs *ds;) +init_declarator(struct decspecs *ds;) { struct declarator Dc; } @@ -298,7 +298,7 @@ initializer(struct idf *idf; int sc;) description list dc. */ /* 3.5.4 */ -declarator(register struct declarator *dc;) +declarator(struct declarator *dc;) { struct formal *fm = NO_PARAMS; struct proto *pl = NO_PROTO; arith count; @@ -328,7 +328,7 @@ declarator(register struct declarator *dc;) {add_decl_unary(dc, POINTER, qual, (arith)0, NO_PARAMS, NO_PROTO);} ; -primary_declarator(register struct declarator *dc;) : +primary_declarator(struct declarator *dc;) : identifier(&dc->dc_idf) | '(' declarator(dc) ')' @@ -360,7 +360,7 @@ formal(struct formal **fmp;) : identifier(&idf) { - register struct formal *new = new_formal(); + struct formal *new = new_formal(); new->fm_idf = idf; new->next = *fmp; @@ -372,7 +372,7 @@ formal(struct formal **fmp;) ; /* Change 2 */ -enum_specifier(register struct type **tpp;) +enum_specifier(struct type **tpp;) { struct idf *idf; arith l = (arith)0; @@ -402,7 +402,7 @@ enum_specifier(register struct type **tpp;) ] ; -enumerator_pack(register struct type *tp; arith *lp;) : +enumerator_pack(struct type *tp; arith *lp;) : '{' enumerator(tp, lp) [%while (AHEAD != '}') @@ -438,11 +438,11 @@ enumerator(struct type *tp; arith *lp;) ; /* 8.5 */ -struct_or_union_specifier(register struct type **tpp;) +struct_or_union_specifier(struct type **tpp;) { int fund; struct idf *idfX; - register struct idf *idf; + struct idf *idf; } : {if (*tpp) error("multiple types in declaration");} @@ -487,7 +487,7 @@ struct_or_union_specifier(register struct type **tpp;) ] ; -struct_declaration_pack(register struct type *stp;) +struct_declaration_pack(struct type *stp;) { struct sdef **sdefp = &stp->tp_sdef; arith size = (arith)0; @@ -572,7 +572,7 @@ cast(struct type **tpp;) /* This code is an abject copy of that of 'declarator', for lack of a two-level grammar. */ -abstract_declarator(register struct declarator *dc;) +abstract_declarator(struct declarator *dc;) { struct proto *pl = NO_PROTO; arith count; int qual; @@ -621,7 +621,7 @@ parameter_type_list(struct proto **plp;) parameter_decl_list(plp) [ ',' ELLIPSIS - { register struct proto *new = new_proto(); + { struct proto *new = new_proto(); new->next = *plp; new->pl_flag = PL_ELLIPSIS; @@ -646,7 +646,7 @@ parameter_decl_list(struct proto **plp;) ; parameter_decl(struct proto **plp;) - { register struct proto *new = new_proto(); + { struct proto *new = new_proto(); struct declarator Dc; struct decspecs Ds; } @@ -685,7 +685,7 @@ parameter_decl(struct proto **plp;) since this is the only place where they don't give conflicts. However, this makes the grammar messy. */ -parameter_declarator(register struct declarator *dc;) +parameter_declarator(struct declarator *dc;) { struct formal *fm = NO_PARAMS; struct proto *pl = NO_PROTO; arith count; @@ -715,7 +715,7 @@ parameter_declarator(register struct declarator *dc;) {add_decl_unary(dc, POINTER, qual, (arith)0, NO_PARAMS, NO_PROTO);} ; -primary_parameter_declarator(register struct declarator *dc;) +primary_parameter_declarator(struct declarator *dc;) : [%if (AHEAD == ')' || first_of_parameter_type_list(AHEAD) && (AHEAD != IDENTIFIER)) diff --git a/lang/cem/cemcom.ansi/declarator.c b/lang/cem/cemcom.ansi/declarator.c index c1ce2d88fa..9e967be258 100644 --- a/lang/cem/cemcom.ansi/declarator.c +++ b/lang/cem/cemcom.ansi/declarator.c @@ -36,7 +36,7 @@ declare_type( are purely prototypes. Simply add the type list to the function node. */ - register struct decl_unary *du = dc->dc_decl_unary; + struct decl_unary *du = dc->dc_decl_unary; while (du) { tp = construct_type(du->du_fund, tp, du->du_typequal, @@ -46,13 +46,13 @@ declare_type( return tp; } -void add_decl_unary(register struct declarator *dc, int fund, int qual, arith count, struct formal *fm, struct proto *pl) +void add_decl_unary(struct declarator *dc, int fund, int qual, arith count, struct formal *fm, struct proto *pl) { /* A decl_unary describing a constructor with fundamental type fund and with size count is inserted in front of the declarator dc. */ - register struct decl_unary *new = new_decl_unary(); + struct decl_unary *new = new_decl_unary(); new->next = dc->dc_decl_unary; new->du_fund = fund; @@ -78,7 +78,7 @@ void remove_declarator(struct declarator *dc) /* The decl_unary list starting at dc->dc_decl_unary is removed. */ - register struct decl_unary *du = dc->dc_decl_unary; + struct decl_unary *du = dc->dc_decl_unary; while (du) { struct decl_unary *old_du = du; @@ -88,14 +88,14 @@ void remove_declarator(struct declarator *dc) } } -void reject_params(register struct declarator *dc) +void reject_params(struct declarator *dc) { /* The declarator is checked to have no parameters, if it is an old-style function. If it is a new-style function, the identifiers are removed. The function is not called in case of a function definition. */ - register struct decl_unary *du = dc->dc_decl_unary; + struct decl_unary *du = dc->dc_decl_unary; int err_given = 0; if (dc->dc_formal) { @@ -116,7 +116,7 @@ void reject_params(register struct declarator *dc) } } -void check_array_subscript(register struct expr *expr) +void check_array_subscript(struct expr *expr) { writh size = expr->VL_VALUE; diff --git a/lang/cem/cemcom.ansi/declarator.h b/lang/cem/cemcom.ansi/declarator.h index abda9de1f1..c5eb51198d 100644 --- a/lang/cem/cemcom.ansi/declarator.h +++ b/lang/cem/cemcom.ansi/declarator.h @@ -19,10 +19,10 @@ struct expr; struct type * declare_type(struct type *tp, struct declarator *dc); -void add_decl_unary(register struct declarator *dc, int fund, int qual, +void add_decl_unary(struct declarator *dc, int fund, int qual, arith count, struct formal *fm, struct proto *pl); void remove_declarator(struct declarator *dc); -void reject_params(register struct declarator *dc); -void check_array_subscript(register struct expr *expr); +void reject_params(struct declarator *dc); +void check_array_subscript(struct expr *expr); #endif /* DECLARATOR_H_ */ diff --git a/lang/cem/cemcom.ansi/decspecs.c b/lang/cem/cemcom.ansi/decspecs.c index c34fb1b557..99d6380c74 100644 --- a/lang/cem/cemcom.ansi/decspecs.c +++ b/lang/cem/cemcom.ansi/decspecs.c @@ -20,12 +20,12 @@ extern int level; struct decspecs null_decspecs; -void do_decspecs(register struct decspecs *ds) +void do_decspecs(struct decspecs *ds) { /* The provisional decspecs ds as obtained from the program is turned into a legal consistent decspecs. */ - register struct type *tp = ds->ds_type; + struct type *tp = ds->ds_type; assert(level != L_FORMAL1); @@ -101,7 +101,7 @@ void do_decspecs(register struct decspecs *ds) } if (ds->ds_unsigned) { - register int ds_isunsigned = (ds->ds_unsigned == UNSIGNED); + int ds_isunsigned = (ds->ds_unsigned == UNSIGNED); if (ds->ds_typedef) goto SIGN_ERROR; @@ -151,10 +151,10 @@ void do_decspecs(register struct decspecs *ds) In case of a complex type the top of the type list will be replaced by a qualified version. */ -struct type *qualifier_type(register struct type *tp, int typequal) +struct type *qualifier_type(struct type *tp, int typequal) { - register struct type *dtp = tp; - register int fund = tp->tp_fund; + struct type *dtp = tp; + int fund = tp->tp_fund; while (dtp && dtp->tp_typequal != typequal) dtp = dtp->next; diff --git a/lang/cem/cemcom.ansi/decspecs.h b/lang/cem/cemcom.ansi/decspecs.h index 3f89e7148f..24ac7f0616 100644 --- a/lang/cem/cemcom.ansi/decspecs.h +++ b/lang/cem/cemcom.ansi/decspecs.h @@ -25,7 +25,7 @@ extern struct decspecs null_decspecs; struct type; -void do_decspecs(register struct decspecs *ds); -struct type *qualifier_type(register struct type *tp, int typequal); +void do_decspecs(struct decspecs *ds); +struct type *qualifier_type(struct type *tp, int typequal); #endif diff --git a/lang/cem/cemcom.ansi/dumpidf.c b/lang/cem/cemcom.ansi/dumpidf.c index 7d11ef90f0..e9d799fbcf 100644 --- a/lang/cem/cemcom.ansi/dumpidf.c +++ b/lang/cem/cemcom.ansi/dumpidf.c @@ -50,18 +50,18 @@ static int dumplevel; static void dumpstack(void); static char *next_transient(void); static char *qual2str(int); -static char *type2str(register struct type *); -static void p1_indent(register int); -static void dumpdefs(register struct def *, int); -void dumpidf(register struct idf *, int); -void dumptags(register struct tag *); -void dumptype(register struct type *); -void dumpsdefs(register struct sdef *, enum sdef_kind); -static void p1_expr(int, register struct expr *); +static char *type2str(struct type *); +static void p1_indent(int); +static void dumpdefs(struct def *, int); +void dumpidf(struct idf *, int); +void dumptags(struct tag *); +void dumptype(struct type *); +void dumpsdefs(struct sdef *, enum sdef_kind); +static void p1_expr(int, struct expr *); void newline(void) { - register int dl = dumplevel; + int dl = dumplevel; print("\n"); while (dl >= 2) { @@ -94,10 +94,10 @@ static void dumpstack(void) { /* Dumps the identifier stack, starting at the top. */ - register struct stack_level *stl = local_level; + struct stack_level *stl = local_level; while (stl) { - register struct stack_entry *se = stl->sl_entry; + struct stack_entry *se = stl->sl_entry; newline(); print("%3d: ", stl->sl_level); @@ -110,7 +110,7 @@ static void dumpstack(void) print("\n"); } -void dumpidf(register struct idf *idf, int opt) +void dumpidf(struct idf *idf, int opt) { /* All information about the identifier idf is divulged in a hopefully readable format. @@ -149,7 +149,7 @@ void dumpidf(register struct idf *idf, int opt) } } -void dumpdefs(register struct def *def, int opt) +void dumpdefs(struct def *def, int opt) { dumplevel++; while (def && ((opt&4) || def->df_level)) { @@ -170,12 +170,12 @@ void dumpdefs(register struct def *def, int opt) dumplevel--; } -void dumptags(register struct tag *tag) +void dumptags(struct tag *tag) { dumplevel++; while (tag) { - register struct type *tp = tag->tg_type; - register int fund = tp->tp_fund; + struct type *tp = tag->tg_type; + int fund = tp->tp_fund; newline(); print("L%d: %s %s", @@ -197,7 +197,7 @@ void dumptags(register struct tag *tag) dumplevel--; } -void dumpsdefs(register struct sdef *sdef, enum sdef_kind sdk) +void dumpsdefs(struct sdef *sdef, enum sdef_kind sdk) { /* Since sdef's are members of two chains, there are actually two dumpsdefs's, one following the chain of all selectors @@ -227,10 +227,10 @@ void dumpsdefs(register struct sdef *sdef, enum sdef_kind sdk) dumplevel--; } -void dumpproto(register struct proto *pl) +void dumpproto(struct proto *pl) { - register struct type *type; - register int argcnt = 0; + struct type *type; + int argcnt = 0; newline(); print("dump proto type list (start)"); @@ -258,7 +258,7 @@ void dumpproto(register struct proto *pl) print("dump proto type list (end)\n"); } -void dumptype(register struct type *tp) +void dumptype(struct type *tp) { int ops = 1; @@ -315,7 +315,7 @@ void dumptype(register struct type *tp) dumplevel--; } -static char *type2str(register struct type *tp) +static char *type2str(struct type *tp) { /* Yields a pointer to a one-line description of the type tp. */ @@ -406,7 +406,7 @@ void print_expr(char msg[], struct expr *expr) } } -static void p1_expr(int lvl, register struct expr *expr) +static void p1_expr(int lvl, struct expr *expr) { p1_indent(lvl); if (!expr) { @@ -481,7 +481,7 @@ static void p1_expr(int lvl, register struct expr *expr) } } -static void p1_indent(register int lvl) +static void p1_indent(int lvl) { while (lvl--) print(" "); diff --git a/lang/cem/cemcom.ansi/error.c b/lang/cem/cemcom.ansi/error.c index 778895e35c..65d4a2ab63 100644 --- a/lang/cem/cemcom.ansi/error.c +++ b/lang/cem/cemcom.ansi/error.c @@ -295,7 +295,7 @@ void expr_error(va_alist) /* expr, fmt, args */ va_start(ap); { - register struct expr *expr = va_arg(ap, struct expr *); + struct expr *expr = va_arg(ap, struct expr *); char *fmt = va_arg(ap, char *); if (!(expr->ex_flags & EX_ERROR)) { @@ -413,7 +413,7 @@ void def_warning(va_alist) /* def, fmt, args */ va_start(ap); { - register struct def *def = va_arg(ap, struct def *); + struct def *def = va_arg(ap, struct def *); char *fmt = va_arg(ap, char *); _error(WARNING, def->df_file, def->df_line, fmt, ap); diff --git a/lang/cem/cemcom.ansi/eval.c b/lang/cem/cemcom.ansi/eval.c index 357729f3fd..cf4900d225 100644 --- a/lang/cem/cemcom.ansi/eval.c +++ b/lang/cem/cemcom.ansi/eval.c @@ -48,7 +48,7 @@ extern int err_occurred; /* error.c */ /* Forward internal declarations */ -static void operands(register struct expr *, int); +static void operands(struct expr *, int); static void ptr_add(arith size); static void truthvalue(int relop); static void compare(int relop, label lbl); @@ -79,10 +79,10 @@ static void compare(int relop, label lbl); labels, in case they are specified (i.e. are non-zero) */ -void EVAL(register struct expr *expr, int val, int code, label true_label, label false_label) +void EVAL(struct expr *expr, int val, int code, label true_label, label false_label) { int vol = (code != TRUE && recurqual(expr->ex_type, TQ_VOLATILE)); - register int gencode = code == TRUE; + int gencode = code == TRUE; if (err_occurred) return; switch (expr->ex_class) { @@ -124,9 +124,9 @@ void EVAL(register struct expr *expr, int val, int code, label true_label, label case Oper: /* compound expression */ { int oper = expr->OP_OPER; - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; - register struct type *tp = expr->OP_TYPE; + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; + struct type *tp = expr->OP_TYPE; switch (oper) { case '+': @@ -491,7 +491,7 @@ void EVAL(register struct expr *expr, int val, int code, label true_label, label } case '(': { - register struct expr *ex; + struct expr *ex; arith ParSize = (arith)0; label setjmp_label = 0; arith retspace = 0; @@ -732,10 +732,10 @@ static void truthvalue(int relop) /* assop() generates the opcode of an assignment operators op= */ -void assop(register struct type *type, int oper) +void assop(struct type *type, int oper) { - register arith size; - register int uns = type->tp_unsigned; + arith size; + int uns = type->tp_unsigned; if ((int)(size = type->tp_size) < (int)word_size) size = word_size; @@ -853,10 +853,10 @@ static void ptr_add(arith size) - into a local static variable - absolute addressing */ -void store_val(register struct value *vl, register struct type *tp) +void store_val(struct value *vl, struct type *tp) { - register int inword = 0; - register int indword = 0; + int inword = 0; + int indword = 0; writh wval = vl->vl_value; arith val = (arith)wval; @@ -870,8 +870,8 @@ void store_val(register struct value *vl, register struct type *tp) else if (tp->tp_size == dword_size) indword = 1; } if (vl->vl_class == Name) { - register struct idf *id = vl->vl_data.vl_idf; - register struct def *df = id->id_def; + struct idf *id = vl->vl_data.vl_idf; + struct def *df = id->id_def; /* if (df->df_level == L_GLOBAL) { // } ??? re-examine */ if (df->df_sc == GLOBAL @@ -925,11 +925,11 @@ void store_val(register struct value *vl, register struct type *tp) rlval generate rlval or lval */ -void load_val(register struct expr *expr, int rlval) +void load_val(struct expr *expr, int rlval) { - register struct type *tp = expr->ex_type; + struct type *tp = expr->ex_type; int rvalue = (rlval == RVAL && expr->ex_lvalue != 0); - register int inword = 0, indword = 0; + int inword = 0, indword = 0; writh wval = expr->VL_VALUE; arith val = (arith)wval; @@ -971,8 +971,8 @@ void load_val(register struct expr *expr, int rlval) } } else { - register struct idf *id = expr->VL_IDF; - register struct def *df = id->id_def; + struct idf *id = expr->VL_IDF; + struct def *df = id->id_def; int fund = df->df_type->tp_fund; assert(ISNAME(expr)); @@ -1043,7 +1043,7 @@ void load_cst(writh val, arith siz) } } -static void operands(register struct expr *expr, int gencode) +static void operands(struct expr *expr, int gencode) { EVAL(expr->OP_LEFT, RVAL, gencode, NO_LABEL, NO_LABEL); EVAL(expr->OP_RIGHT, RVAL, gencode, NO_LABEL, NO_LABEL); diff --git a/lang/cem/cemcom.ansi/eval.h b/lang/cem/cemcom.ansi/eval.h index 53a7f8d12b..4bbea2bbe6 100644 --- a/lang/cem/cemcom.ansi/eval.h +++ b/lang/cem/cemcom.ansi/eval.h @@ -18,10 +18,10 @@ struct expr; struct value; struct type; -void EVAL(register struct expr *expr, int val, int code, label true_label, label false_label); +void EVAL(struct expr *expr, int val, int code, label true_label, label false_label); /* assop() generates the opcode of an assignment operators op= */ -void assop(register struct type *type, int oper); +void assop(struct type *type, int oper); /* store_val() generates code for a store operation. There are four ways of storing data: - into a global variable @@ -29,8 +29,8 @@ void assop(register struct type *type, int oper); - into a local static variable - absolute addressing */ -void store_val(register struct value *vl, register struct type *tp); -void load_val(register struct expr *expr, int rlval); +void store_val(struct value *vl, struct type *tp); +void load_val(struct expr *expr, int rlval); void load_cst(writh val, arith siz); #endif /* LINT */ diff --git a/lang/cem/cemcom.ansi/expr.c b/lang/cem/cemcom.ansi/expr.c index fda491b188..fddfabbf83 100644 --- a/lang/cem/cemcom.ansi/expr.c +++ b/lang/cem/cemcom.ansi/expr.c @@ -105,7 +105,7 @@ void dot2expr(struct expr **expp) /* The token in dot is converted into an expression, a pointer to which is stored in *expp. */ - register struct expr *ex = new_expr(); + struct expr *ex = new_expr(); *expp = ex; ex->ex_file = dot.tk_file; @@ -127,15 +127,15 @@ void dot2expr(struct expr **expp) } } -void idf2expr(register struct expr *expr) +void idf2expr(struct expr *expr) { /* Dot contains an identifier which is turned into an expression. Note that this constitutes an applied occurrence of the identifier. */ - register struct idf *idf = dot.tk_idf; /* != 0*/ - register struct def *def = idf->id_def; + struct idf *idf = dot.tk_idf; /* != 0*/ + struct def *def = idf->id_def; if (def == 0) { @@ -202,13 +202,13 @@ void idf2expr(register struct expr *expr) } } -void string2expr(register struct expr **expp, char *str, int len) +void string2expr(struct expr **expp, char *str, int len) { /* The string in the argument is converted into an expression, a pointer to which is stored in *expp. */ - register struct expr *ex = new_expr(); + struct expr *ex = new_expr(); *expp = ex; ex->ex_file = dot.tk_file; @@ -230,12 +230,12 @@ void int2expr(struct expr *expr) fill_int_expr(expr, dot.tk_ival, dot.tk_fund); } -void float2expr(register struct expr *expr) +void float2expr(struct expr *expr) { /* Dot contains a floating point constant which is turned into an expression. */ - register int fund; + int fund; fund = dot.tk_fund; switch (fund) @@ -266,7 +266,7 @@ arith ivalue, int fund) /* The value ivalue is turned into an integer expression of the size indicated by fund. */ - register struct expr *expr = new_expr(); + struct expr *expr = new_expr(); expr->ex_file = dot.tk_file; expr->ex_line = dot.tk_line; @@ -274,7 +274,7 @@ arith ivalue, int fund) return expr; } -void fill_int_expr(register struct expr *ex, +void fill_int_expr(struct expr *ex, writh ivalue, int fund) { /* Details derived from ivalue and fund are put into the @@ -314,8 +314,8 @@ writh ivalue, int fund) cut_size(ex); } -struct expr *new_oper(struct type *tp, register struct expr *e1, int oper, - register struct expr *e2) +struct expr *new_oper(struct type *tp, struct expr *e1, int oper, + struct expr *e2) { /* A new expression is constructed which consists of the operator oper which has e1 and e2 as operands; for a @@ -323,12 +323,12 @@ struct expr *new_oper(struct type *tp, register struct expr *e1, int oper, During the construction of the right recursive initialisation tree it is possible for e2 to be NILEXPR. */ - register struct expr *expr = new_expr(); - register struct oper *op; + struct expr *expr = new_expr(); + struct oper *op; if (e2) { - register struct expr *e = e2; + struct expr *e = e2; while (e->ex_class == Oper && e->OP_LEFT) e = e->OP_LEFT; @@ -337,7 +337,7 @@ struct expr *new_oper(struct type *tp, register struct expr *e1, int oper, } else if (e1) { - register struct expr *e = e1; + struct expr *e = e1; while (e->ex_class == Oper && e->OP_RIGHT) e = e->OP_RIGHT; @@ -404,7 +404,7 @@ void chk_cst_expr(struct expr **expp) Special problems (of which there is only one, sizeof in Preprocessor #if) have to be dealt with locally */ - register struct expr *expr = *expp; + struct expr *expr = *expp; #ifdef DEBUG print_expr("constant_expression", expr); @@ -430,7 +430,7 @@ void chk_cst_expr(struct expr **expp) erroneous2int(expp); } -void init_expression(register struct expr ***eppp, struct expr *expr) +void init_expression(struct expr ***eppp, struct expr *expr) { /* The expression expr is added to the tree designated indirectly by **eppp. @@ -448,7 +448,7 @@ void init_expression(register struct expr ***eppp, struct expr *expr) *eppp = &(**eppp)->OP_RIGHT; } -int is_ld_cst(register struct expr *expr) +int is_ld_cst(struct expr *expr) { /* An expression is a `load-time constant' if it is of the form +/- or . @@ -476,7 +476,7 @@ int is_fp_cst(struct expr *expr) return expr->ex_class == Float; } -int is_zero_cst(register struct expr *expr) +int is_zero_cst(struct expr *expr) { flt_arith var; @@ -491,7 +491,7 @@ int is_zero_cst(register struct expr *expr) UNREACHABLE_CODE; } -void free_expression(register struct expr *expr) +void free_expression(struct expr *expr) { /* The expression expr is freed recursively. */ diff --git a/lang/cem/cemcom.ansi/expression.g b/lang/cem/cemcom.ansi/expression.g index 8ee1463336..594c51a5e9 100644 --- a/lang/cem/cemcom.ansi/expression.g +++ b/lang/cem/cemcom.ansi/expression.g @@ -33,7 +33,7 @@ int ResultKnown = 0; /* result of the expression is already known */ } /* 3.3.1 */ -primary(register struct expr **expp;) : +primary(struct expr **expp;) : IDENTIFIER {dot2expr(expp);} | @@ -50,10 +50,10 @@ primary(register struct expr **expp;) : * are concatenated into a single character string * literal. */ -string(register struct expr **expp;) - { register int i, len; - register char *str; - register int fund; +string(struct expr **expp;) + { int i, len; + char *str; + int fund; } : STRING @@ -80,7 +80,7 @@ string(register struct expr **expp;) ; /* 3.3.2 */ -postfix_expression(register struct expr **expp;) +postfix_expression(struct expr **expp;) { int oper; struct expr *e1 = 0; struct idf *idf; @@ -122,7 +122,7 @@ parameter_list(struct expr **expp;) %first first_of_type_specifier, type_specifier; /* 3.3.3 & 3.3.4 */ -unary(register struct expr **expp;) +unary(struct expr **expp;) {struct type *tp; int oper;} : %if (first_of_type_specifier(AHEAD) && AHEAD != IDENTIFIER) @@ -145,7 +145,7 @@ unary(register struct expr **expp;) * mark it as used. * extern int i; .... sizeof(i) .... need not have a definition for i */ -size_of(register struct expr **expp;) +size_of(struct expr **expp;) {struct type *tp;} : SIZEOF { InSizeof++; } /* handle (sizeof(sizeof(int))) too */ @@ -324,7 +324,7 @@ binop(int *oper;) : {*oper = DOT;} ; -asgnop(register int *oper;): +asgnop(int *oper;): [ '=' | PLUSAB | MINAB | TIMESAB | DIVAB | MODAB | LEFTAB | RIGHTAB | ANDAB | XORAB | ORAB ] { *oper = DOT; } diff --git a/lang/cem/cemcom.ansi/field.c b/lang/cem/cemcom.ansi/field.c index 7d7f277266..0f19030768 100644 --- a/lang/cem/cemcom.ansi/field.c +++ b/lang/cem/cemcom.ansi/field.c @@ -45,9 +45,9 @@ void eval_field( int code) { int op = expr->OP_OPER; - register struct expr *leftop = expr->OP_LEFT; - register struct expr *rightop = expr->OP_RIGHT; - register struct field *fd = leftop->ex_type->tp_field; + struct expr *leftop = expr->OP_LEFT; + struct expr *rightop = expr->OP_RIGHT; + struct field *fd = leftop->ex_type->tp_field; struct type *tp = leftop->ex_type->tp_up; arith tmpvar = 0; struct type *atype = ( tp->tp_unsigned @@ -116,7 +116,7 @@ void eval_field( retrieval) is on top of stack. */ if (tp->tp_unsigned == 0) { /* sign extension */ - register arith shift = (int)word_size * 8 - fd->fd_width; + arith shift = (int)word_size * 8 - fd->fd_width; C_loc(shift); C_sli(word_size); @@ -128,10 +128,10 @@ void eval_field( } void store_field( - register struct field *fd, + struct field *fd, int uns, int code, - register struct expr *leftop, + struct expr *leftop, arith tmpvar) { arith high_mask; diff --git a/lang/cem/cemcom.ansi/fltcstoper.c b/lang/cem/cemcom.ansi/fltcstoper.c index 9d12cdb3f0..f029a425dc 100644 --- a/lang/cem/cemcom.ansi/fltcstoper.c +++ b/lang/cem/cemcom.ansi/fltcstoper.c @@ -23,7 +23,7 @@ extern int ResultKnown; -void fltcstbin(register struct expr **expp, int oper, register struct expr *expr) +void fltcstbin(struct expr **expp, int oper, struct expr *expr) { /* The operation oper is performed on the constant expressions *expp(ld) and expr(ct), and the result restored in diff --git a/lang/cem/cemcom.ansi/fltcstoper.h b/lang/cem/cemcom.ansi/fltcstoper.h index 4b65618f69..0506aac395 100644 --- a/lang/cem/cemcom.ansi/fltcstoper.h +++ b/lang/cem/cemcom.ansi/fltcstoper.h @@ -10,6 +10,6 @@ struct expr; -void fltcstbin(register struct expr **expp, int oper, register struct expr *expr); +void fltcstbin(struct expr **expp, int oper, struct expr *expr); #endif /* FLTCSTOPER_H_ */ diff --git a/lang/cem/cemcom.ansi/idf.c b/lang/cem/cemcom.ansi/idf.c index c34dfe45b4..82b02c86e1 100644 --- a/lang/cem/cemcom.ansi/idf.c +++ b/lang/cem/cemcom.ansi/idf.c @@ -73,14 +73,14 @@ void declare_idf(struct decspecs *ds, struct declarator *dc, int lvl) This routine implements the rich semantics of C declarations. */ - register struct idf *idf = dc->dc_idf; - register int sc = ds->ds_sc; + struct idf *idf = dc->dc_idf; + int sc = ds->ds_sc; /* This local copy is essential: char b(), c; makes b GLOBAL and c AUTO. */ - register struct def *def = idf->id_def; /* may be NULL */ - register struct type *type; + struct def *def = idf->id_def; /* may be NULL */ + struct type *type; struct stack_level *stl = stack_level_of(lvl); char formal_array = 0; @@ -213,7 +213,7 @@ void declare_idf(struct decspecs *ds, struct declarator *dc, int lvl) } else { /* fill in the def block */ - register struct def *newdef = new_def(); + struct def *newdef = new_def(); newdef->next = def; newdef->df_level = lvl; @@ -265,7 +265,7 @@ int actual_declaration(int sc, struct type *tp) { /* An actual_declaration needs space, right here and now. */ - register int fund = tp->tp_fund; + int fund = tp->tp_fund; if (sc == ENUM || sc == TYPEDEF) /* virtual declarations */ return 0; @@ -281,7 +281,7 @@ int actual_declaration(int sc, struct type *tp) return 1; } -void global_redecl(register struct idf *idf, int new_sc, struct type *tp) +void global_redecl(struct idf *idf, int new_sc, struct type *tp) { /* A global identifier may be declared several times, provided the declarations do not conflict; they might @@ -289,7 +289,7 @@ void global_redecl(register struct idf *idf, int new_sc, struct type *tp) an array) or they might conflict or supplement each other in storage class. */ - register struct def *def = idf->id_def; + struct def *def = idf->id_def; while (def->df_level != L_GLOBAL) def = def->next; @@ -386,7 +386,7 @@ void global_redecl(register struct idf *idf, int new_sc, struct type *tp) } } -int good_formal(register struct def *def, register struct idf *idf) +int good_formal(struct def *def, struct idf *idf) { /* Succeeds if def is a proper L_FORMAL1 definition and gives an error message otherwise. @@ -405,7 +405,7 @@ void declare_params(struct declarator *dc) { /* Declares the formal parameters if they exist. */ - register struct formal *fm = dc->dc_formal; + struct formal *fm = dc->dc_formal; while (fm) { @@ -414,11 +414,11 @@ void declare_params(struct declarator *dc) } } -void idf_initialized(register struct idf *idf) +void idf_initialized(struct idf *idf) { /* The topmost definition of idf is set to initialized. */ - register struct def *def = idf->id_def; /* the topmost */ + struct def *def = idf->id_def; /* the topmost */ while (def->df_level <= L_PROTO) def = def->next; @@ -449,9 +449,9 @@ void declare_enum(struct type *tp, struct idf *idf, arith l) void check_formals(struct idf *idf, struct declarator *dc) { - register struct formal *fm = dc->dc_formal; - register struct proto *pl = idf->id_def->df_type->tp_proto; - register struct decl_unary *du = dc->dc_decl_unary; + struct formal *fm = dc->dc_formal; + struct proto *pl = idf->id_def->df_type->tp_proto; + struct decl_unary *du = dc->dc_decl_unary; if (!du) { /* error or typdef'ed function */ @@ -505,7 +505,7 @@ void check_formals(struct idf *idf, struct declarator *dc) } else { /* make a pseudo-prototype */ - register struct proto *lpl = new_proto(); + struct proto *lpl = new_proto(); if (!options['o']) warning("'%s' old-fashioned function definition", @@ -544,9 +544,9 @@ void declare_formals(struct idf *idf, arith *fp) An address is assigned to each formal parameter. The total size of the formals is returned in *fp; */ - register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; + struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; arith f_offset = (arith) 0; - register int nparams = 0; + int nparams = 0; int hasproto; struct def *df = idf->id_def; @@ -654,12 +654,12 @@ void add_def(struct idf *idf, int sc, struct type *tp, int lvl) declare_idf(&Ds, &Dc, lvl); } -void update_ahead(register struct idf *idf) +void update_ahead(struct idf *idf) { /* The tk_symb of the token ahead is updated in the light of new information about the identifier idf. */ - register int tk_symb = AHEAD; + int tk_symb = AHEAD; if ((tk_symb == IDENTIFIER || tk_symb == TYPE_IDENTIFIER) && ahead.tk_idf == idf) @@ -668,7 +668,7 @@ void update_ahead(register struct idf *idf) IDENTIFIER; } -void free_formals(register struct formal *fm) +void free_formals(struct formal *fm) { while (fm) { diff --git a/lang/cem/cemcom.ansi/interface.h b/lang/cem/cemcom.ansi/interface.h index 72c1064635..155cbe1acc 100644 --- a/lang/cem/cemcom.ansi/interface.h +++ b/lang/cem/cemcom.ansi/interface.h @@ -3,7 +3,7 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ -#define PRIVATE static /* or not */ +#define static static /* or not */ #define IMPORT extern #define EXPORT diff --git a/lang/cem/cemcom.ansi/ival.g b/lang/cem/cemcom.ansi/ival.g index 2e9d3d8781..6b9447b69d 100644 --- a/lang/cem/cemcom.ansi/ival.g +++ b/lang/cem/cemcom.ansi/ival.g @@ -50,23 +50,23 @@ struct e_stack *p_stack; void gen_tpcheck(struct type **); void gen_simple_exp(struct type **, struct expr **); struct type **arr_elem(struct type **, struct e_stack *); -struct sdef *next_field(register struct sdef *,register struct e_stack *); +struct sdef *next_field(struct sdef *,struct e_stack *); struct type **gen_tphead(struct type **, int); struct type **gen_tpmiddle(void); -struct sdef *gen_align_to_next(register struct e_stack *); +struct sdef *gen_align_to_next(struct e_stack *); void gen_tpend(void); void check_and_pad(struct expr **, struct type **); void pad(struct type *); -void check_ival(struct expr **, register struct type *); +void check_ival(struct expr **, struct type *); void ch_array(struct type **, /* type tp = array of characters */ struct expr *); -void str_cst(register char *, register int, int); +void str_cst(char *, int, int); #ifndef NOBITFIELD void put_bf(struct type *, arith ); #endif /* NOBITFIELD */ -int zero_bytes(register struct sdef *); +int zero_bytes(struct sdef *); int valid_type(struct type *, char *); -void con_int(register struct expr *); +void con_int(struct expr *); void illegal_init_cst(struct expr *); void too_many_initialisers(void); @@ -76,7 +76,7 @@ void too_many_initialisers(void); */ /* 3.5 */ -initial_value(register struct type **tpp; register struct expr **expp;) : +initial_value(struct type **tpp; struct expr **expp;) : { if (tpp) gen_tpcheck(tpp); } [ { if (pack_level == 0) gen_error = 0; } @@ -126,9 +126,9 @@ initial_value_pack(struct type **tpp; struct expr **expp;) '}' ; -initial_value_list(register struct type **tpp; struct expr **expp;) +initial_value_list(struct type **tpp; struct expr **expp;) { struct expr *e1; - register struct type **tpp2 = 0; + struct type **tpp2 = 0; int err_flag = gen_error; } : @@ -148,7 +148,7 @@ initial_value_list(register struct type **tpp; struct expr **expp;) { void gen_tpcheck(struct type **tpp) { - register struct type *tp; + struct type *tp; if (gen_error) return; switch((tp = *tpp)->tp_fund) { @@ -172,7 +172,7 @@ void gen_tpcheck(struct type **tpp) void gen_simple_exp(struct type **tpp, struct expr **expp) { - register struct type *tp; + struct type *tp; if (gen_error) return; tp = *tpp; @@ -200,7 +200,7 @@ void gen_simple_exp(struct type **tpp, struct expr **expp) struct type **arr_elem(struct type **tpp, struct e_stack *p) { - register struct type *tp = *tpp; + struct type *tp = *tpp; if (tp->tp_up->tp_fund == CHAR && AHEAD == STRING && p->elem_count == 1) { p->nelem = 1; @@ -211,8 +211,8 @@ struct type **arr_elem(struct type **tpp, struct e_stack *p) return gen_tphead(&(tp->tp_up), 1); } -struct sdef *next_field(register struct sdef *sd, - register struct e_stack *p) +struct sdef *next_field(struct sdef *sd, + struct e_stack *p) { if (sd->sd_sdef) p->bytes_upto_here += zero_bytes(sd); @@ -224,9 +224,9 @@ struct sdef *next_field(register struct sdef *sd, struct type **gen_tphead(struct type **tpp, int nest) { - register struct type *tp = *tpp; - register struct e_stack *p; - register struct sdef *sd; + struct type *tp = *tpp; + struct e_stack *p; + struct sdef *sd; if (tpp && *tpp == error_type) { gen_error = pack_level; @@ -299,9 +299,9 @@ struct type **gen_tphead(struct type **tpp, int nest) struct type **gen_tpmiddle(void) { - register struct type *tp; - register struct sdef *sd; - register struct e_stack *p = p_stack; + struct type *tp; + struct sdef *sd; + struct e_stack *p = p_stack; if (gen_error) { if (p) return p->s_tpp; @@ -355,9 +355,9 @@ again: } } -struct sdef *gen_align_to_next(register struct e_stack *p) +struct sdef *gen_align_to_next(struct e_stack *p) { - register struct sdef *sd = p->s_def; + struct sdef *sd = p->s_def; if (! sd) return sd; #ifndef NOBITFIELD @@ -374,9 +374,9 @@ struct sdef *gen_align_to_next(register struct e_stack *p) void gen_tpend(void) { - register struct e_stack *p = p_stack; - register struct type *tp; - register struct sdef *sd; + struct e_stack *p = p_stack; + struct type *tp; + struct sdef *sd; int getout = 0; while (!getout && p) { @@ -430,7 +430,7 @@ void gen_tpend(void) */ void check_and_pad(struct expr **expp, struct type **tpp) { - register struct type *tp = *tpp; + struct type *tp = *tpp; if (tp->tp_fund == ARRAY) { check_and_pad(expp, &(tp->tp_up)); /* first member */ @@ -441,7 +441,7 @@ void check_and_pad(struct expr **expp, struct type **tpp) tp = *tpp = construct_type(ARRAY, tp->tp_up, 0, (arith)1, NO_PROTO); else { - register int dim = tp->tp_size / tp->tp_up->tp_size; + int dim = tp->tp_size / tp->tp_up->tp_size; /* pad remaining members with zeroes */ while (--dim > 0) pad(tp->tp_up); @@ -449,7 +449,7 @@ void check_and_pad(struct expr **expp, struct type **tpp) } else if (tp->tp_fund == STRUCT) { - register struct sdef *sd = tp->tp_sdef; + struct sdef *sd = tp->tp_sdef; check_and_pad(expp, &(sd->sd_type)); /* next selector is aligned by adding extra zeroes */ @@ -463,7 +463,7 @@ void check_and_pad(struct expr **expp, struct type **tpp) } else if (tp->tp_fund == UNION) { /* only the first selector can be initialized */ - register struct sdef *sd = tp->tp_sdef; + struct sdef *sd = tp->tp_sdef; check_and_pad(expp, &(sd->sd_type)); } @@ -476,8 +476,8 @@ void check_and_pad(struct expr **expp, struct type **tpp) */ void pad(struct type *tpx) { - register struct type *tp = tpx; - register arith sz = tp->tp_size; + struct type *tp = tpx; + arith sz = tp->tp_size; gen_tpcheck(&tpx); if (gen_error) return; @@ -504,14 +504,14 @@ void pad(struct type *tpx) No further comment is needed to explain the internal structure of this straightforward function. */ -void check_ival(struct expr **expp, register struct type *tp) +void check_ival(struct expr **expp, struct type *tp) { /* The philosophy here is that ch3cast puts an explicit conversion node in front of the expression if the types are not compatible. In this case, the initialisation expression is no longer a constant. */ - register struct expr *expr = *expp; + struct expr *expr = *expp; switch (tp->tp_fund) { case CHAR: @@ -533,7 +533,7 @@ void check_ival(struct expr **expp, register struct type *tp) con_int(expr); else if (expr->VL_CLASS == Name) { - register struct idf *idf = expr->VL_IDF; + struct idf *idf = expr->VL_IDF; if (idf->id_def->df_level >= L_LOCAL && idf->id_def->df_sc != GLOBAL @@ -619,9 +619,9 @@ and also to prevent runtime coercions for compile-time constants. void ch_array(struct type **tpp, /* type tp = array of characters */ struct expr *ex) { - register struct type *tp = *tpp; - register int length = ex->SG_LEN, i; - register char *to, *from, *s; + struct type *tp = *tpp; + int length = ex->SG_LEN, i; + char *to, *from, *s; assert(ex->ex_class == String); if (tp->tp_size == (arith)-1) { @@ -657,7 +657,7 @@ void ch_array(struct type **tpp, /* type tp = array of characters */ /* As long as some parts of the pipeline cannot handle very long string constants, string constants are written out in chunks */ -void str_cst(register char *str, register int len, int inrom) +void str_cst(char *str, int len, int inrom) { int chunksize = ((127 + (int) word_size) / (int) word_size) * (int) word_size; @@ -685,8 +685,8 @@ void put_bf(struct type *tp, arith val) { static long field = (arith)0; static arith offset = (arith)-1; - register struct field *fd = tp->tp_field; - register struct sdef *sd = fd->fd_sdef; + struct field *fd = tp->tp_field; + struct sdef *sd = fd->fd_sdef; static struct expr exp; assert(sd); @@ -709,12 +709,12 @@ void put_bf(struct type *tp, arith val) } #endif /* NOBITFIELD */ -int zero_bytes(register struct sdef *sd) +int zero_bytes(struct sdef *sd) { /* fills the space between a selector of a struct and the next selector of that struct with zero-bytes. */ - register int n = sd->sd_sdef->sd_offset - sd->sd_offset - + int n = sd->sd_sdef->sd_offset - sd->sd_offset - size_of_type(sd->sd_type, "struct member"); int count = n; @@ -733,9 +733,9 @@ int valid_type(struct type *tp, char *str) return 1; } -void con_int(register struct expr *ex) +void con_int(struct expr *ex) { - register struct type *tp = ex->ex_type; + struct type *tp = ex->ex_type; assert(is_cp_cst(ex)); if (tp->tp_unsigned) diff --git a/lang/cem/cemcom.ansi/l_comment.c b/lang/cem/cemcom.ansi/l_comment.c index 2ab983a85d..04efae2103 100644 --- a/lang/cem/cemcom.ansi/l_comment.c +++ b/lang/cem/cemcom.ansi/l_comment.c @@ -24,15 +24,15 @@ extern char loptions[]; one token later. */ -PRIVATE int notreached; -PRIVATE int varargsN = -1; -PRIVATE int argsused; -PRIVATE int formatN; -PRIVATE int formatVAR; -PRIVATE char *format; -PRIVATE char *prev_format; +static int notreached; +static int varargsN = -1; +static int argsused; +static int formatN; +static int formatVAR; +static char *format; +static char *prev_format; -PRIVATE make_format(); +static make_format(); int LINTLIB; /* file is lint library */ int s_NOTREACHED; /* statement not reached */ @@ -73,8 +73,8 @@ lint_comment_function() formatVAR = 0; } -PRIVATE char buf[1000]; -PRIVATE char *bufpos; /* next free position in buf */ +static char buf[1000]; +static char *bufpos; /* next free position in buf */ lint_start_comment() { @@ -118,7 +118,7 @@ lint_end_comment() } else if (strncmp(bufpos, "FORMAT", 6) == 0 && isdigit(bufpos[6])) { - register int argn; + int argn; bufpos += 6; argn = *bufpos++ - '0'; @@ -141,13 +141,13 @@ lint_end_comment() #define LETGIT 1 #define LETGITSPACE 2 -PRIVATE +static make_format(argn, oldf) int argn; char *oldf; { - register char *newf; - register int last_stat; + char *newf; + int last_stat; while (*oldf && *oldf != '$') { oldf++; @@ -175,7 +175,7 @@ make_format(argn, oldf) last_stat = NONE; while (*oldf && *oldf != '$') { - register char ch = *oldf++; + char ch = *oldf++; if (isspace(ch)) { if (last_stat == LETGIT) diff --git a/lang/cem/cemcom.ansi/l_ev_ord.c b/lang/cem/cemcom.ansi/l_ev_ord.c index 64a01346e2..e461e53063 100644 --- a/lang/cem/cemcom.ansi/l_ev_ord.c +++ b/lang/cem/cemcom.ansi/l_ev_ord.c @@ -29,7 +29,7 @@ -PRIVATE check_ev_order(); +static check_ev_order(); check_and_merge(expr, espp, esp) struct expr *expr; @@ -40,7 +40,7 @@ check_and_merge(expr, espp, esp) * united. * *espp will be pointing to this new list. esp is used for this list. */ - register struct expr_state **pp, *p1, *p2; + struct expr_state **pp, *p1, *p2; int oper = expr->OP_OPER; int is_sequencer = (oper == '?' || oper == OR || oper == AND || oper ==','); @@ -88,7 +88,7 @@ check_and_merge(expr, espp, esp) esp->next = p1; } -PRIVATE +static check_ev_order(esp1, esp2, expr) struct expr_state *esp1, *esp2; struct expr *expr; diff --git a/lang/cem/cemcom.ansi/l_lint.c b/lang/cem/cemcom.ansi/l_lint.c index 0558c3fd50..e8bc957e21 100644 --- a/lang/cem/cemcom.ansi/l_lint.c +++ b/lang/cem/cemcom.ansi/l_lint.c @@ -32,13 +32,13 @@ extern char options[128]; -PRIVATE struct expr_state *expr2state(); -PRIVATE struct expr_state *value2state(); -PRIVATE struct expr_state *oper2state(); -PRIVATE expr_ignored(); -PRIVATE add_expr_state(); -PRIVATE referred_esp(); -PRIVATE free_expr_states(); +static struct expr_state *expr2state(); +static struct expr_state *value2state(); +static struct expr_state *oper2state(); +static expr_ignored(); +static add_expr_state(); +static referred_esp(); +static free_expr_states(); lint_init() { @@ -50,16 +50,16 @@ lint_expr(expr, used) struct expr *expr; int used; /* USED or IGNORED */ { - register struct expr_state *esp; + struct expr_state *esp; esp = expr2state(expr, RVAL, used); referred_esp(esp); free_expr_states(esp); } -PRIVATE struct expr_state * +static struct expr_state * expr2state(expr, val, used) - register struct expr *expr; + struct expr *expr; int val; /* RVAL or LVAL */ int used; /* USED or IGNORED */ { @@ -87,7 +87,7 @@ expr2state(expr, val, used) } } -PRIVATE struct expr_state * +static struct expr_state * value2state(expr, val) struct expr *expr; int val; /* RVAL or LVAL */ @@ -99,7 +99,7 @@ value2state(expr, val) case Name: { - register struct idf *idf = expr->VL_IDF; + struct idf *idf = expr->VL_IDF; struct expr_state *esp = 0; if (!idf || !idf->id_def) @@ -133,15 +133,15 @@ value2state(expr, val) 4. set the result of the LHS to SET, if it is a named variable */ -PRIVATE struct expr_state * +static struct expr_state * oper2state(expr, val, used) struct expr *expr; int val; /* RVAL or LVAL */ int used; /* USED or IGNORED */ { - register int oper = expr->OP_OPER; - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; + int oper = expr->OP_OPER; + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; struct expr_state *esp_l = 0; struct expr_state *esp_r = 0; @@ -199,7 +199,7 @@ oper2state(expr, val, used) case '(': if (right != 0) { /* function call with parameters */ - register struct expr *ex = right; + struct expr *ex = right; while ( ex->ex_class == Oper && ex->OP_OPER == PARCOMMA @@ -283,7 +283,7 @@ oper2state(expr, val, used) } } -PRIVATE +static expr_ignored(expr) struct expr *expr; { @@ -358,12 +358,12 @@ expr_ignored(expr) } } -PRIVATE +static add_expr_state(value, to_state, espp) struct value value; struct expr_state **espp; { - register struct expr_state *esp = *espp; + struct expr_state *esp = *espp; assert(value.vl_class == Name); @@ -402,7 +402,7 @@ add_expr_state(value, to_state, espp) } } -PRIVATE +static referred_esp(esp) struct expr_state *esp; { @@ -419,12 +419,12 @@ referred_esp(esp) } } -PRIVATE +static free_expr_states(esp) - register struct expr_state *esp; + struct expr_state *esp; { while (esp) { - register struct expr_state *esp2 = esp; + struct expr_state *esp2 = esp; esp = esp->next; free_expr_state(esp2); diff --git a/lang/cem/cemcom.ansi/l_misc.c b/lang/cem/cemcom.ansi/l_misc.c index e54eb39705..e3ef9b04f2 100644 --- a/lang/cem/cemcom.ansi/l_misc.c +++ b/lang/cem/cemcom.ansi/l_misc.c @@ -29,9 +29,9 @@ extern struct type *func_type; -PRIVATE lint_enum_arith(); -PRIVATE lint_conversion(); -PRIVATE int numsize(); +static lint_enum_arith(); +static lint_conversion(); +static int numsize(); check_hiding(idf, lvl, sc) struct idf *idf; @@ -69,13 +69,13 @@ lint_new_oper(expr) I am not sure we have covered the entire ground, we'll leave the contracting for some rainy day. */ - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; - register int oper = expr->OP_OPER; - register int l_fund = + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; + int oper = expr->OP_OPER; + int l_fund = left == 0 ? 0 : /* for monadics */ left->ex_type->tp_fund; - register int r_fund = + int r_fund = right == 0 ? 0 : /* for ( without parameters */ right->ex_type->tp_fund; @@ -242,7 +242,7 @@ lint_new_oper(expr) } } -PRIVATE +static lint_enum_arith(l_fund, oper, r_fund) int l_fund, oper, r_fund; { @@ -265,12 +265,12 @@ lint_enum_arith(l_fund, oper, r_fund) } } -PRIVATE +static lint_conversion(from_expr, to_fund) struct expr *from_expr; int to_fund; { - register int from_fund = from_expr->ex_type->tp_fund; + int from_fund = from_expr->ex_type->tp_fund; /* was there an attempt to reduce the type of the from_expr of the form @@ -301,7 +301,7 @@ lint_conversion(from_expr, to_fund) } } -PRIVATE int +static int numsize(fund) { switch (fund) { diff --git a/lang/cem/cemcom.ansi/l_outdef.c b/lang/cem/cemcom.ansi/l_outdef.c index da5f84e964..381c6a5652 100644 --- a/lang/cem/cemcom.ansi/l_outdef.c +++ b/lang/cem/cemcom.ansi/l_outdef.c @@ -41,23 +41,23 @@ int stat_number = 9999; /* static scope number */ struct outdef OutDef; -PRIVATE struct outdef OutCall; +static struct outdef OutCall; -PRIVATE local_EFDC(); -PRIVATE output_def(); -PRIVATE outargs(); -PRIVATE outarg(); -PRIVATE outargstring(); -PRIVATE outargtype(); -PRIVATE add_expr_arg(); -PRIVATE def2decl(); +static local_EFDC(); +static output_def(); +static outargs(); +static outarg(); +static outargstring(); +static outargtype(); +static add_expr_arg(); +static def2decl(); lint_declare_idf(idf, sc) struct idf *idf; int sc; { - register struct def *def = idf->id_def; - register int is_function = def->df_type->tp_fund == FUNCTION; + struct def *def = idf->id_def; + int is_function = def->df_type->tp_fund == FUNCTION; if (level == L_GLOBAL) { lint_ext_def(idf, sc); @@ -76,8 +76,8 @@ lint_non_function_decl(ds, dc) struct decspecs *ds; struct declarator *dc; { - register struct def *def = dc->dc_idf->id_def; - register int is_function = def->df_type->tp_fund == FUNCTION; + struct def *def = dc->dc_idf->id_def; + int is_function = def->df_type->tp_fund == FUNCTION; if (is_function) def2decl(ds->ds_sc); @@ -97,8 +97,8 @@ lint_ext_def(idf, sc) * The od_valreturned field is known at the end of the function definition. * sc indicates the storage class defined by the declaration specifier. */ - register struct def *def = idf->id_def; - register struct type *type = def->df_type; + struct def *def = idf->id_def; + struct type *type = def->df_type; OutDef.od_name = idf->id_text; OutDef.od_statnr = (sc == STATIC ? stat_number : 0); @@ -126,7 +126,7 @@ lint_ext_def(idf, sc) OutDef.od_valreturned = NORETURN; } -PRIVATE +static def2decl(sc) int sc; { @@ -142,7 +142,7 @@ set_od_valreturned(n) OutDef.od_valreturned = n; } -PRIVATE +static local_EFDC(idf) struct idf *idf; { @@ -163,13 +163,13 @@ lint_formals() /* Make a list of 'struct argument's containing the types of the formal * parameters of the function definition just parsed. */ - register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; - register struct argument **hook = &OutDef.od_arg; - register int nrargs = 0; + struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; + struct argument **hook = &OutDef.od_arg; + int nrargs = 0; while (se) { - register struct type *type = se->se_idf->id_def->df_type; - register struct argument *arg = new_argument(); + struct type *type = se->se_idf->id_def->df_type; + struct argument *arg = new_argument(); if (f_FORMAT && nrargs == f_FORMATn) { if ( !f_FORMATvar @@ -209,7 +209,7 @@ lint_formals() } while (nrargs < f_FORMATn) { - register struct argument *arg = new_argument(); + struct argument *arg = new_argument(); arg->ar_type = error_type; arg->ar_class = ArgFormal; @@ -218,7 +218,7 @@ lint_formals() nrargs++; } if (nrargs == f_FORMATn) { - register struct argument *arg = new_argument(); + struct argument *arg = new_argument(); arg->ar_type = string_type; arg->ar_class = ArgString; @@ -246,8 +246,8 @@ output_proto(idf, def) struct def *def; { /* fund == FUNCTION && sc != STATIC */ - register struct proto *pl = def->df_type->tp_proto; - register int nrargs = 0; + struct proto *pl = def->df_type->tp_proto; + int nrargs = 0; if (!pl) return; @@ -260,8 +260,8 @@ output_proto(idf, def) OutDef.od_valreturned = NORETURN;/*???*/ while (pl) { - register struct type *type = pl->pl_type; - register struct argument *arg = new_argument(); + struct type *type = pl->pl_type; + struct argument *arg = new_argument(); if (type) { arg->ar_type = type; @@ -305,7 +305,7 @@ outcall() output_def(&OutCall); } -PRIVATE +static output_def(od) struct outdef *od; { @@ -326,7 +326,7 @@ output_def(od) case SFDF: /* free the 'struct argument's */ while (od->od_arg) { - register struct argument *tmp = od->od_arg; + struct argument *tmp = od->od_arg; od->od_arg = od->od_arg->next; free_argument(tmp); } @@ -375,13 +375,13 @@ output_def(od) printf(":%u:%s\n", od->od_line, od->od_file); } -PRIVATE +static outargs(arg, n) struct argument *arg; { /* Output the n arguments in the argument list and remove them */ - register struct argument *tmp; + struct argument *tmp; while (n--) { assert(arg); @@ -398,7 +398,7 @@ outargs(arg, n) } } -PRIVATE +static outarg(arg) struct argument *arg; { @@ -441,12 +441,12 @@ outarg(arg) } } -PRIVATE +static outargstring(arg) struct argument *arg; { char buff[1000]; - register char *p; + char *p; bts2str(arg->CAS_VALUE, arg->CAS_LEN, buff); for (p = &buff[0]; *p; p++) { @@ -456,7 +456,7 @@ outargstring(arg) printf("\"%s\"", buff); } -PRIVATE +static outargtype(tp) struct type *tp; { @@ -519,7 +519,7 @@ outargtype(tp) } #ifdef IMPLICIT -PRIVATE +static implicit_func_decl(idf, file, line) struct idf *idf; char *file; @@ -542,8 +542,8 @@ fill_outcall(ex, used) struct expr *ex; int used; { - register struct idf *idf = ex->OP_LEFT->VL_IDF; - register struct def *def = idf->id_def; + struct idf *idf = ex->OP_LEFT->VL_IDF; + struct def *def = idf->id_def; #ifdef IMPLICIT if (def->df_sc == IMPLICIT && !idf->id_def->df_used) { @@ -573,11 +573,11 @@ fill_outcall(ex, used) OutCall.od_valused = used; /* USED, IGNORED or VOIDED */ } -PRIVATE +static add_expr_arg(e) struct expr *e; { - register struct argument *arg; + struct argument *arg; arg = new_argument(); arg->ar_type = e->ex_type; @@ -590,7 +590,7 @@ add_expr_arg(e) && e->VL_CLASS == Label ) { /* it may be a string; let's look it up */ - register struct string_cst *sc = str_list; + struct string_cst *sc = str_list; while (sc) { if (sc->sc_dlb == e->VL_LBL) diff --git a/lang/cem/cemcom.ansi/l_states.c b/lang/cem/cemcom.ansi/l_states.c index e3f7c05855..6c4bed9834 100644 --- a/lang/cem/cemcom.ansi/l_states.c +++ b/lang/cem/cemcom.ansi/l_states.c @@ -45,34 +45,34 @@ extern char loptions[]; extern struct stack_level *local_level; /* global variables for the lint_stack */ -PRIVATE struct lint_stack_entry *top_ls; +static struct lint_stack_entry *top_ls; /* global variables for the brace stack */ -PRIVATE int brace_count; -PRIVATE struct brace *top_br; +static int brace_count; +static struct brace *top_br; /* global variables for the function return */ -PRIVATE int valreturned; /* see l_lint.h */ -PRIVATE int return_warned; - -PRIVATE end_brace(); -PRIVATE lint_1_local(); -PRIVATE lint_1_global(); -PRIVATE start_loop_stmt(); -PRIVATE check_autos(); -PRIVATE struct auto_def *copy_auto_list(); -PRIVATE free_auto_list(); -PRIVATE struct state *copy_state(); -PRIVATE Free_state(); -PRIVATE remove_settings(); -PRIVATE struct auto_def *merge_autos(); -PRIVATE merge_states(); -PRIVATE struct lint_stack_entry *find_wdf(), *find_wdfc(), *find_cs(); -PRIVATE cont_merge(); -PRIVATE break_merge(); -PRIVATE struct lint_stack_entry *mk_lint_stack_entry(); -PRIVATE lint_push(); -PRIVATE lint_pop(); +static int valreturned; /* see l_lint.h */ +static int return_warned; + +static end_brace(); +static lint_1_local(); +static lint_1_global(); +static start_loop_stmt(); +static check_autos(); +static struct auto_def *copy_auto_list(); +static free_auto_list(); +static struct state *copy_state(); +static Free_state(); +static remove_settings(); +static struct auto_def *merge_autos(); +static merge_states(); +static struct lint_stack_entry *find_wdf(), *find_wdfc(), *find_cs(); +static cont_merge(); +static break_merge(); +static struct lint_stack_entry *mk_lint_stack_entry(); +static lint_push(); +static lint_pop(); lint_init_stack() { @@ -84,7 +84,7 @@ lint_init_stack() lint_start_local() { - register struct brace *br = new_brace(); + struct brace *br = new_brace(); dbg_lint_stack("lint_start_local"); brace_count++; @@ -114,18 +114,18 @@ lint_end_local(stl) end_brace(stl); } -PRIVATE +static end_brace(stl) struct stack_level *stl; { /* Check if static variables and labels are used and/or set. Automatic vars have already been checked by check_autos(). */ - register struct stack_entry *se = stl->sl_entry; - register struct brace *br; + struct stack_entry *se = stl->sl_entry; + struct brace *br; while (se) { - register struct idf *idf = se->se_idf; + struct idf *idf = se->se_idf; if (idf->id_def) { lint_1_local(idf, idf->id_def); @@ -142,12 +142,12 @@ end_brace(stl) free_brace(br); } -PRIVATE +static lint_1_local(idf, def) struct idf *idf; struct def *def; { - register int sc = def->df_sc; + int sc = def->df_sc; if ( (sc == STATIC || sc == LABEL) && !def->df_used @@ -164,7 +164,7 @@ lint_1_local(idf, def) && def->df_minlevel != level && !is_anon_idf(idf) ) { - register int diff = def->df_minlevel - level; + int diff = def->df_minlevel - level; def_warning(def, "local %s could be declared %d level%s deeper", @@ -176,13 +176,13 @@ lint_1_local(idf, def) lint_end_global(stl) struct stack_level *stl; { - register struct stack_entry *se = stl->sl_entry; + struct stack_entry *se = stl->sl_entry; dbg_lint_stack("lint_end_global"); assert(level == L_GLOBAL); while (se) { - register struct idf *idf = se->se_idf; - register struct def *def = idf->id_def; + struct idf *idf = se->se_idf; + struct def *def = idf->id_def; if (def) { lint_1_global(idf, def); @@ -191,14 +191,14 @@ lint_end_global(stl) } } -PRIVATE +static lint_1_global(idf, def) struct idf *idf; struct def *def; { - register int sc = def->df_sc; - register struct type *tp = def->df_type; - register int fund = tp->tp_fund; + int sc = def->df_sc; + struct type *tp = def->df_type; + int fund = tp->tp_fund; switch (sc) { case STATIC: @@ -242,7 +242,7 @@ lint_1_global(idf, def) } } if (loptions['x']) { - register char *fn = def->df_file; + char *fn = def->df_file; if ( (sc == EXTERN || sc == GLOBAL) && def->df_alloc == 0 @@ -272,8 +272,8 @@ change_state(idf, to_state) * on top of the stack. * The fields in the def-descriptor are set too. */ - register struct def *def = idf->id_def; - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct def *def = idf->id_def; + struct auto_def *a = top_ls->ls_current->st_auto_list; assert(def); @@ -292,7 +292,7 @@ change_state(idf, to_state) def->df_minlevel = level; } else { - register struct brace *br = top_br; + struct brace *br = top_br; /* find the smallest brace range from which firstbrace is visible @@ -338,12 +338,12 @@ add_auto(idf) /* to current state on top of lint_stack */ * It could be a static or extern too. * Watch out for formal parameters. */ - register struct def *def = idf->id_def; + struct def *def = idf->id_def; assert(def); switch (def->df_sc) { - register struct auto_def *a; + struct auto_def *a; case AUTO: case REGISTER: if (def->df_level < L_LOCAL) @@ -361,13 +361,13 @@ add_auto(idf) /* to current state on top of lint_stack */ } } -PRIVATE +static check_autos() { /* Before leaving a block, remove the auto_defs of the automatic * variables on this level and check if they are used */ - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct auto_def *a = top_ls->ls_current->st_auto_list; assert(!(a && a->ad_def->df_level > level)); while (a && a->ad_def->df_level == level) { @@ -388,7 +388,7 @@ check_autos() } { /* free a */ - register struct auto_def *aux = a; + struct auto_def *aux = a; a = a->next; free_auto_def(aux); } @@ -398,12 +398,12 @@ check_autos() lint_end_formals() { - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; dbg_lint_stack("lint_end_formals"); assert(level == L_FORMAL1); while (se) { - register struct def *def = se->se_idf->id_def; + struct def *def = se->se_idf->id_def; if ( (def && !def->df_used) && !(f_ARGSUSED || LINTLIB) @@ -416,13 +416,13 @@ lint_end_formals() } } -PRIVATE struct auto_def * +static struct auto_def * copy_auto_list(from_al, lvl) struct auto_def *from_al; int lvl; { struct auto_def *start = 0; - register struct auto_def **hook = &start; + struct auto_def **hook = &start; /* skip too high levels */ while (from_al && from_al->ad_def->df_level > lvl) { @@ -430,7 +430,7 @@ copy_auto_list(from_al, lvl) } while (from_al) { - register struct auto_def *a = new_auto_def(); + struct auto_def *a = new_auto_def(); *hook = a; *a = *from_al; @@ -441,18 +441,18 @@ copy_auto_list(from_al, lvl) return start; } -PRIVATE +static free_auto_list(a) - register struct auto_def *a; + struct auto_def *a; { while (a) { - register struct auto_def *aux = a; + struct auto_def *aux = a; a = a->next; free_auto_def(aux); } } -PRIVATE struct state * +static struct state * copy_state(from_st, lvl) struct state *from_st; int lvl; @@ -460,7 +460,7 @@ copy_state(from_st, lvl) /* Memory for the struct state and the struct auto_defs is allocated * by this function */ - register struct state *st = new_state(); + struct state *st = new_state(); st->st_auto_list = copy_auto_list(from_st->st_auto_list, lvl); st->st_notreached = from_st->st_notreached; @@ -468,7 +468,7 @@ copy_state(from_st, lvl) return st; } -PRIVATE +static Free_state(stp) struct state **stp; { @@ -479,7 +479,7 @@ Free_state(stp) *stp = 0; } -PRIVATE +static remove_settings(st, lvl) struct state *st; int lvl; @@ -487,7 +487,7 @@ remove_settings(st, lvl) /* The states of all variables on this level are set to 'not set' and * 'not maybe set'. (I think you have to read this twice.) */ - register struct auto_def *a = st->st_auto_list; + struct auto_def *a = st->st_auto_list; while (a && a->ad_def->df_level == lvl) { a->ad_set = a->ad_maybe_set = 0; @@ -503,7 +503,7 @@ remove_settings(st, lvl) #define CASE_BREAK 1 #define USE_ONLY 2 -PRIVATE +static merge_states(st1, st2, lvl, mode) struct state *st1, *st2; int lvl; @@ -524,7 +524,7 @@ merge_states(st1, st2, lvl, mode) } else if (st2->st_notreached) { - register struct auto_def *tmp = st2->st_auto_list; + struct auto_def *tmp = st2->st_auto_list; st2->st_auto_list = copy_auto_list(st1->st_auto_list, lvl); st2->st_notreached = 0; @@ -541,7 +541,7 @@ merge_states(st1, st2, lvl, mode) } } -PRIVATE struct auto_def * +static struct auto_def * merge_autos(a1, a2, lvl, mode) struct auto_def *a1, *a2; int lvl; @@ -565,7 +565,7 @@ merge_autos(a1, a2, lvl, mode) * Variables used in a1 become used in a2. * The rest of the result is not changed. */ - register struct auto_def *a; + struct auto_def *a; /* skip too local entries */ while (a1 && a1->ad_def->df_level > lvl) { @@ -574,7 +574,7 @@ merge_autos(a1, a2, lvl, mode) /* discard too local entries */ while (a2 && a2->ad_def->df_level > lvl) { - register struct auto_def *aux = a2; + struct auto_def *aux = a2; a2 = a2->next; free_auto_def(aux); } @@ -616,10 +616,10 @@ merge_autos(a1, a2, lvl, mode) * The letters mean : w: WHILE; d: DO; f: FOR; s: SWITCH; c: CASE. */ -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_wdf() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -633,10 +633,10 @@ find_wdf() return 0; } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_wdfc() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -651,10 +651,10 @@ find_wdfc() return 0; } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_cs() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -671,7 +671,7 @@ find_cs() start_if_part(cst) { - register struct lint_stack_entry *new = mk_lint_stack_entry(IF); + struct lint_stack_entry *new = mk_lint_stack_entry(IF); dbg_lint_stack("start_if_part"); if (cst) @@ -765,12 +765,12 @@ start_for_stmt(expr) } } -PRIVATE +static start_loop_stmt(looptype, cst, cond) { /* If cst, the condition is a constant and its value is cond */ - register struct lint_stack_entry *new = mk_lint_stack_entry(looptype); + struct lint_stack_entry *new = mk_lint_stack_entry(looptype); dbg_lint_stack("start_loop_stmt"); if (cst && !cond) { @@ -803,7 +803,7 @@ start_loop_stmt(looptype, cst, cond) end_loop_body() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_loop_body"); assert(lse == top_ls); @@ -813,7 +813,7 @@ end_loop_body() end_loop_stmt() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_loop_stmt"); assert(lse == top_ls); @@ -836,7 +836,7 @@ end_loop_stmt() end_do_stmt(cst, cond) { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_do_stmt"); if (cst && !cond) { @@ -850,7 +850,7 @@ end_do_stmt(cst, cond) lint_continue_stmt() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("lint_continue_stmt"); if (!lse) @@ -870,7 +870,7 @@ start_switch_part(cst) * following case parts. (Needed for variables declared in a compound * switch-block.) */ - register struct lint_stack_entry *new = mk_lint_stack_entry(SWITCH); + struct lint_stack_entry *new = mk_lint_stack_entry(SWITCH); dbg_lint_stack("start_switch_part"); if (cst) @@ -932,7 +932,7 @@ end_switch_stmt() lint_case_stmt(dflt) { /* A default statement is just a special case statement */ - register struct lint_stack_entry *cs_entry = find_cs(); + struct lint_stack_entry *cs_entry = find_cs(); dbg_lint_stack("lint_case_stmt"); if (!cs_entry) @@ -945,7 +945,7 @@ lint_case_stmt(dflt) } switch (cs_entry->ls_class) { - register struct lint_stack_entry *new; + struct lint_stack_entry *new; case SWITCH: if (dflt) { @@ -982,7 +982,7 @@ lint_case_stmt(dflt) lint_break_stmt() { - register struct lint_stack_entry *lse = find_wdfc(); + struct lint_stack_entry *lse = find_wdfc(); dbg_lint_stack("lint_break_stmt"); if (!lse) @@ -1028,7 +1028,7 @@ lint_break_stmt() top_ls->ls_current->st_warned = 0; } -PRIVATE +static cont_merge(lse) struct lint_stack_entry *lse; { @@ -1042,7 +1042,7 @@ cont_merge(lse) } } -PRIVATE +static break_merge(lse) struct lint_stack_entry *lse; { @@ -1102,7 +1102,7 @@ lint_return_stmt(e) dbg_lint_stack("lint_return_stmt"); if (valreturned == NORETURN) { /* first return met */ - register int fund = func_type->tp_fund; + int fund = func_type->tp_fund; if ( e == NOVALRETURNED && !func_notypegiven @@ -1154,7 +1154,7 @@ lint_label() be done. So we assume that the user knows what he is doing and set all automatic variables to set. */ - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct auto_def *a = top_ls->ls_current->st_auto_list; dbg_lint_stack("lint_label"); while (a) { @@ -1194,14 +1194,14 @@ lint_statement() } } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * mk_lint_stack_entry(cl) int cl; { /* Prepare a new stack entry for the lint_stack with class cl. Copy the top ls_current to this entry and set its level. */ - register struct lint_stack_entry *new = new_lint_stack_entry(); + struct lint_stack_entry *new = new_lint_stack_entry(); new->ls_class = cl; new->ls_current = copy_state(top_ls->ls_current, level); @@ -1210,7 +1210,7 @@ mk_lint_stack_entry(cl) return new; } -PRIVATE +static lint_push(lse) struct lint_stack_entry *lse; { @@ -1219,7 +1219,7 @@ lint_push(lse) top_ls = lse; } -PRIVATE +static lint_pop() { top_ls = top_ls->ls_previous; @@ -1229,7 +1229,7 @@ lint_pop() #ifdef DEBUG /* FOR DEBUGGING */ -PRIVATE +static print_autos(a) struct auto_def *a; { @@ -1247,7 +1247,7 @@ print_autos(a) } } -PRIVATE +static pr_lint_state(nm, st) char *nm; struct state *st; @@ -1266,7 +1266,7 @@ pr_lint_state(nm, st) print_lint_stack(msg) char *msg; { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; print("Lint stack: %s(level=%d)\n", msg, level); while (lse) { diff --git a/lang/cem/cemcom.ansi/label.c b/lang/cem/cemcom.ansi/label.c index e4c10f85d3..3081d5685b 100644 --- a/lang/cem/cemcom.ansi/label.c +++ b/lang/cem/cemcom.ansi/label.c @@ -19,14 +19,14 @@ extern char options[]; -void enter_label(register struct idf *idf, int defining) +void enter_label(struct idf *idf, int defining) { /* The identifier idf is entered as a label. If it is new, it is entered into the idf list with the largest possible scope, i.e., on the lowest possible level. If defining, the label comes from a label statement. */ - register struct def *def = idf->id_label; + struct def *def = idf->id_label; if (def) { if (defining && def->df_initialized) @@ -46,7 +46,7 @@ void enter_label(register struct idf *idf, int defining) def->df_initialized = 1; } -void unstack_label(register struct idf *idf) +void unstack_label(struct idf *idf) { /* The scope in which the label idf occurred is left. */ diff --git a/lang/cem/cemcom.ansi/label.h b/lang/cem/cemcom.ansi/label.h index 47d6b5beaf..e76502c81f 100644 --- a/lang/cem/cemcom.ansi/label.h +++ b/lang/cem/cemcom.ansi/label.h @@ -31,7 +31,7 @@ extern label datlab_count; struct idf; -void enter_label(register struct idf *idf, int defining); -void unstack_label(register struct idf *idf); +void enter_label(struct idf *idf, int defining); +void unstack_label(struct idf *idf); #endif /* LABEL_H_ */ diff --git a/lang/cem/cemcom.ansi/main.c b/lang/cem/cemcom.ansi/main.c index fee1e64cd3..06e91ad082 100644 --- a/lang/cem/cemcom.ansi/main.c +++ b/lang/cem/cemcom.ansi/main.c @@ -42,7 +42,7 @@ struct sp_id special_ids[] = { void compile(int argc, char *argv[]); static void init(void); -static void init_specials(register struct sp_id *si); +static void init_specials(struct sp_id *si); #ifdef DEBUG void Info(void); #endif @@ -123,7 +123,7 @@ void compile(int argc, char *argv[]) { char *result; #ifndef LINT - register char *destination = 0; + char *destination = 0; #endif /* LINT */ switch (argc) { @@ -273,7 +273,7 @@ static void init(void) stack_level(); } -static void init_specials(register struct sp_id *si) +static void init_specials(struct sp_id *si) { while (si->si_identifier) { struct idf *idf = str2idf(si->si_identifier, 0); diff --git a/lang/cem/cemcom.ansi/options.c b/lang/cem/cemcom.ansi/options.c index 2cdfe38359..1cb30fd7c4 100644 --- a/lang/cem/cemcom.ansi/options.c +++ b/lang/cem/cemcom.ansi/options.c @@ -28,11 +28,11 @@ extern int density; -static int txt2int(register char **); +static int txt2int(char **); void do_option(char *text) { - register char opt; + char opt; next_option: /* to allow combined one-char options */ switch (opt = *text++) { @@ -124,7 +124,7 @@ void do_option(char *text) #ifndef NOCROSS case 'V' : /* set object sizes and alignment requirements */ { - register arith sz, algn; + arith sz, algn; char c; while ( (c = *text++) !=0) { @@ -218,12 +218,12 @@ void do_option(char *text) } } -static int txt2int(register char **tp) +static int txt2int(char **tp) { /* the integer pointed to by *tp is read, while increasing *tp; the resulting value is yielded. */ - register int val = 0, ch; + int val = 0, ch; while (ch = **tp, ch >= '0' && ch <= '9') { val = val * 10 + ch - '0'; diff --git a/lang/cem/cemcom.ansi/pragma.c b/lang/cem/cemcom.ansi/pragma.c index 5d22562463..d6432a3e7a 100644 --- a/lang/cem/cemcom.ansi/pragma.c +++ b/lang/cem/cemcom.ansi/pragma.c @@ -24,9 +24,9 @@ struct pkey void do_pragma(void) { #if NR_PRAGMAS - register struct pkey *pkp = &pragmas[0]; + struct pkey *pkp = &pragmas[0]; #endif - register struct idf *id = GetIdentifier(1); + struct idf *id = GetIdentifier(1); if (id != (struct idf *) 0) { diff --git a/lang/cem/cemcom.ansi/program.g b/lang/cem/cemcom.ansi/program.g index ecb5c25d1b..bf4bc922d6 100644 --- a/lang/cem/cemcom.ansi/program.g +++ b/lang/cem/cemcom.ansi/program.g @@ -162,7 +162,7 @@ external_definition {remove_declarator(&Dc); flush_strings(); } ; -non_function(register struct decspecs *ds; register struct declarator *dc;) +non_function(struct decspecs *ds; struct declarator *dc;) : { reject_params(dc); } @@ -187,7 +187,7 @@ non_function(register struct decspecs *ds; register struct declarator *dc;) function(struct decspecs *ds; struct declarator *dc;) { arith fbytes; - register struct idf *idf = dc->dc_idf; + struct idf *idf = dc->dc_idf; } : { diff --git a/lang/cem/cemcom.ansi/proto.c b/lang/cem/cemcom.ansi/proto.c index 1dfa13685a..33dd9d7a71 100644 --- a/lang/cem/cemcom.ansi/proto.c +++ b/lang/cem/cemcom.ansi/proto.c @@ -30,9 +30,9 @@ extern char options[]; -void check_for_void(register struct proto *pl) +void check_for_void(struct proto *pl) { - register int errcnt = 0; + int errcnt = 0; if (!pl) return; @@ -62,10 +62,10 @@ void add_proto(struct proto *pl, struct decspecs *ds, struct declarator *dc, later on it's decided whether they were prototypes or actual declarations. */ - register struct idf *idf = dc->dc_idf; - register struct def *def = idf ? idf->id_def : (struct def *) 0; - register int sc = ds->ds_sc; - register struct type *type; + struct idf *idf = dc->dc_idf; + struct def *def = idf ? idf->id_def : (struct def *) 0; + int sc = ds->ds_sc; + struct type *type; char formal_array = 0; assert(ds->ds_type != (struct type * )0); @@ -134,7 +134,7 @@ void add_proto(struct proto *pl, struct decspecs *ds, struct declarator *dc, { /* New definition, redefinition hides earlier one */ - register struct def *newdef = new_def(); + struct def *newdef = new_def(); newdef->next = def; newdef->df_level = lvl; @@ -181,7 +181,7 @@ void add_proto(struct proto *pl, struct decspecs *ds, struct declarator *dc, static struct tag * gettag(struct type *tp, struct idf **idpp) { struct tag *tg = (struct tag *) 0; - register int fund = tp->tp_fund; + int fund = tp->tp_fund; while (fund == FIELD || fund == POINTER || fund == ARRAY || fund == FUNCTION) { @@ -200,16 +200,16 @@ static struct tag * gettag(struct type *tp, struct idf **idpp) return tg; } -void declare_protos(register struct declarator *dc) +void declare_protos(struct declarator *dc) { /* At this points we know that the idf's in protolist are formal parameters. So it's time to declare them at level L_FORMAL2. */ struct stack_level *stl = stack_level_of(L_FORMAL1); - register struct decl_unary *du; - register struct type *type; - register struct proto *pl; - register struct def *def; + struct decl_unary *du; + struct type *type; + struct proto *pl; + struct def *def; #ifdef DEBUG if (options['t']) @@ -284,7 +284,7 @@ void declare_protos(register struct declarator *dc) #endif /* DEBUG */ } -void update_proto(register struct type *tp, register struct type *otp) +void update_proto(struct type *tp, struct type *otp) { /* This routine performs the proto type updates. Consider the following code: @@ -297,7 +297,7 @@ void update_proto(register struct type *tp, register struct type *otp) This routine will silently update all lists, and removes the redundant occupied space. */ - register struct proto *pl, *opl; + struct proto *pl, *opl; if (tp == otp) return; @@ -347,9 +347,9 @@ void update_proto(register struct type *tp, register struct type *otp) */ static void remove_proto_tag(struct type *tp) { - register struct idf *ident; - register struct tag *tgp, **tgpp; - register int fund = tp->tp_fund; + struct idf *ident; + struct tag *tgp, **tgpp; + int fund = tp->tp_fund; while (fund == FIELD || fund == POINTER || fund == ARRAY || fund == FUNCTION) { @@ -392,10 +392,10 @@ static void remove_proto_tag(struct type *tp) /* Remove all the identifier definitions from the prototype list. */ -void remove_proto_idfs(register struct proto *pl) +void remove_proto_idfs(struct proto *pl) { - register struct def *def; + struct def *def; while (pl) { @@ -422,7 +422,7 @@ void remove_proto_idfs(register struct proto *pl) } } -void call_proto(register struct expr **expp) +void call_proto(struct expr **expp) { /* If the function specified by (*expp)->OP_LEFT has a prototype, the parameters are converted according the rules specified in @@ -431,15 +431,15 @@ void call_proto(register struct expr **expp) under ellipsis clause the old parameters conversion stuff applies. */ - register struct expr *left = (*expp)->OP_LEFT; - register struct expr *right = (*expp)->OP_RIGHT; - register struct proto *pl = NO_PROTO; + struct expr *left = (*expp)->OP_LEFT; + struct expr *right = (*expp)->OP_RIGHT; + struct proto *pl = NO_PROTO; static struct proto ellipsis = { 0, 0, 0, PL_ELLIPSIS }; if (left != NILEXPR) { /* in case of an error */ - register struct type *tp = left->ex_type; + struct type *tp = left->ex_type; while (tp && tp->tp_fund != FUNCTION && tp != error_type) tp = tp->tp_up; @@ -449,8 +449,8 @@ void call_proto(register struct expr **expp) if (right != NILEXPR) { /* function call with parameters */ - register struct expr **ep = &((*expp)->OP_RIGHT); - register int ecnt = 0, pcnt = 0; + struct expr **ep = &((*expp)->OP_RIGHT); + int ecnt = 0, pcnt = 0; struct expr **estack[NPARAMS]; struct proto *pstack[NPARAMS]; diff --git a/lang/cem/cemcom.ansi/skip.c b/lang/cem/cemcom.ansi/skip.c index 8dd6ee837a..d104e34907 100644 --- a/lang/cem/cemcom.ansi/skip.c +++ b/lang/cem/cemcom.ansi/skip.c @@ -15,8 +15,8 @@ int SkipToNewLine(void) { - register int ch; - register int garbage = 0; + int ch; + int garbage = 0; while ((ch = GetChar()) != '\n') { diff --git a/lang/cem/cemcom.ansi/stab.c b/lang/cem/cemcom.ansi/stab.c index 864201aa1e..284235e783 100644 --- a/lang/cem/cemcom.ansi/stab.c +++ b/lang/cem/cemcom.ansi/stab.c @@ -70,7 +70,7 @@ static void adds_db_str(char *s) addc_db_str(*s++); } -static void stb_type(register struct type *tp) +static void stb_type(struct type *tp) { char buf[128], *range; static int stb_count; @@ -153,11 +153,11 @@ static void stb_type(register struct type *tp) } addc_db_str('e'); { - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; while (se) { - register struct def *edef = se->se_idf->id_def; + struct def *edef = se->se_idf->id_def; while (edef) { if (edef->df_type == tp && edef->df_sc == ENUM) @@ -187,7 +187,7 @@ static void stb_type(register struct type *tp) sprint(buf, "%c%ld", tp->tp_fund == STRUCT ? 's' : 'u', tp->tp_size)); { - register struct sdef *sdef = tp->tp_sdef; + struct sdef *sdef = tp->tp_sdef; while (sdef) { @@ -220,7 +220,7 @@ static void stb_type(register struct type *tp) } } -void stb_tag(register struct tag *tg, char *str) +void stb_tag(struct tag *tg, char *str) { create_db_str(); adds_db_str(str); @@ -233,7 +233,7 @@ void stb_tag(register struct tag *tg, char *str) 0 : (int) tg->tg_type->tp_size, (arith) 0); } -void stb_typedef(register struct type *tp, char *str) +void stb_typedef(struct type *tp, char *str) { create_db_str(); adds_db_str(str); @@ -245,9 +245,9 @@ void stb_typedef(register struct type *tp, char *str) (arith) 0); } -void stb_string(register struct def *df, int kind, char* str) +void stb_string(struct def *df, int kind, char* str) { - register struct type *tp = df->df_type; + struct type *tp = df->df_type; create_db_str(); adds_db_str(str); diff --git a/lang/cem/cemcom.ansi/stab.h b/lang/cem/cemcom.ansi/stab.h index 5f584adf8d..d8664410f0 100644 --- a/lang/cem/cemcom.ansi/stab.h +++ b/lang/cem/cemcom.ansi/stab.h @@ -13,8 +13,8 @@ struct def; struct type; struct tag; -void stb_tag(register struct tag *tg, char *str); -void stb_typedef(register struct type *tp, char *str); -void stb_string(register struct def *df, int kind, char* str); +void stb_tag(struct tag *tg, char *str); +void stb_typedef(struct type *tp, char *str); +void stb_string(struct def *df, int kind, char* str); #endif /* STAB_H_ */ diff --git a/lang/cem/cemcom.ansi/stack.c b/lang/cem/cemcom.ansi/stack.c index 1d2cd699f6..e298fc08bc 100644 --- a/lang/cem/cemcom.ansi/stack.c +++ b/lang/cem/cemcom.ansi/stack.c @@ -47,8 +47,8 @@ int level; /* Always equal to local_level->sl_level. */ void stack_level(void) { /* A new level is added on top of the identifier stack. */ - register struct stack_level *stl = new_stack_level(); - register struct stack_level *loclev = local_level; + struct stack_level *stl = new_stack_level(); + struct stack_level *loclev = local_level; loclev->sl_next = stl; stl->sl_previous = loclev; @@ -62,12 +62,12 @@ void stack_level(void) { void stack_idf( struct idf *idf, - register struct stack_level *stl) + struct stack_level *stl) { /* The identifier idf is inserted in the stack on level stl, but only if it is not already present at this level. */ - register struct stack_entry *se; + struct stack_entry *se; se = stl->sl_entry; while (se) { @@ -89,7 +89,7 @@ struct stack_level *stack_level_of(int lvl) The stack should probably be an array, to be extended with realloc where needed. */ - register struct stack_level *stl; + struct stack_level *stl; if (lvl == level) return local_level; @@ -120,11 +120,11 @@ void unstack_level(void) necessary. Optimists may optimize it afterwards. */ while (local_level->sl_entry) { - register struct stack_entry *se = local_level->sl_entry; - register struct idf *idf = se->se_idf; - register struct def *def; - register struct sdef *sdef; - register struct tag *tag; + struct stack_entry *se = local_level->sl_entry; + struct idf *idf = se->se_idf; + struct def *def; + struct sdef *sdef; + struct tag *tag; /* unlink it from the local stack level */ local_level->sl_entry = se->next; @@ -184,7 +184,7 @@ void unstack_world(void) have already been encoded while the uninitialised ones are not and have to be encoded at this moment. */ - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; #ifdef LINT lint_end_global(local_level); @@ -195,8 +195,8 @@ void unstack_world(void) #endif /* GEN_NM_LIST */ while (se) { - register struct idf *idf = se->se_idf; - register struct def *def = idf->id_def; + struct idf *idf = se->se_idf; + struct def *def = idf->id_def; if (!def) { /* global selectors, etc. */ diff --git a/lang/cem/cemcom.ansi/stb.c b/lang/cem/cemcom.ansi/stb.c index 4fcd26258a..1e43a15dde 100644 --- a/lang/cem/cemcom.ansi/stb.c +++ b/lang/cem/cemcom.ansi/stb.c @@ -6,7 +6,7 @@ /* library routine for copying structs */ -void __stb(register int n, register char *f, register char *t) +void __stb(int n, char *f, char *t) { if (n > 0) do diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index 88a52ab022..e62c99eb5d 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -30,11 +30,11 @@ static int field_busy = 0; extern char options[]; -static void check_selector(register struct idf *, struct type *); +static void check_selector(struct idf *, struct type *); /* Greatest Common Divisor */ -static int gcd(register int , register int ); +static int gcd(int , int ); /* Least Common Multiple */ -static int lcm(register int, register int); +static int lcm(int, int); /* The semantics of the identification of structure/union tags is obscure. Some highly regarded compilers are found out to accept, @@ -58,9 +58,9 @@ static int lcm(register int, register int); */ void add_sel( /* this is horrible */ - register struct type *stp, /* type of the structure */ + struct type *stp, /* type of the structure */ struct type *tp, /* type of the selector */ - register struct idf *idf, /* idf of the selector */ + struct idf *idf, /* idf of the selector */ struct sdef ***sdefpp, /* address of hook to selector definition */ arith *szp, /* pointer to struct size upto here */ struct field *fd) @@ -75,7 +75,7 @@ void add_sel( /* this is horrible */ struct tag *tg = stp->tp_idf->id_tag; /* or union */ struct sdef *sdef = idf->id_sdef; - register struct sdef *newsdef; + struct sdef *newsdef; int lvl = tg->tg_level; if (stp->tp_fund == STRUCT) { @@ -150,13 +150,13 @@ void add_sel( /* this is horrible */ } } -static void check_selector(register struct idf *idf, struct type *stp) +static void check_selector(struct idf *idf, struct type *stp) { /* checks if idf occurs already as a selector in struct or union *stp. "stp" indicates the type of the struct. */ - register struct sdef *sdef = stp->tp_sdef; + struct sdef *sdef = stp->tp_sdef; while (sdef) { if (sdef->sd_idf == idf) @@ -165,7 +165,7 @@ static void check_selector(register struct idf *idf, struct type *stp) } } -void declare_struct(int fund, register struct idf *idf, struct type **tpp) +void declare_struct(int fund, struct idf *idf, struct type **tpp) { /* A struct, union or enum (depending on fund) with tag (!) idf is declared, and its type (incomplete as it may be) is @@ -173,8 +173,8 @@ void declare_struct(int fund, register struct idf *idf, struct type **tpp) The idf may be missing (i.e. idf == 0), in which case an anonymous struct etc. is defined. */ - register struct tag **tgp; - register struct tag *tg; + struct tag **tgp; + struct tag *tg; if (*tpp) error("multiple types in declaration"); @@ -233,7 +233,7 @@ void declare_struct(int fund, register struct idf *idf, struct type **tpp) } void apply_struct(int fund, - register struct idf *idf, + struct idf *idf, struct type **tpp) { /* The occurrence of a struct, union or enum (depending on @@ -241,7 +241,7 @@ void apply_struct(int fund, declared before. Its type (complete or incomplete) is returned in *tpp. */ - register struct tag **tgp; + struct tag **tgp; tgp = &idf->id_tag; @@ -259,7 +259,7 @@ void apply_struct(int fund, } struct sdef *idf2sdef( - register struct idf *idf, + struct idf *idf, struct type *tp) { /* The identifier idf is identified as a selector @@ -269,7 +269,7 @@ struct sdef *idf2sdef( If this fails too, a selector of type error_type is created. */ - register struct sdef **sdefp = &idf->id_sdef, *sdef; + struct sdef **sdefp = &idf->id_sdef, *sdef; /* Follow chain from idf, to meet tp. */ while ((sdef = *sdefp)) { @@ -295,7 +295,7 @@ struct sdef *idf2sdef( } #if 0 -int uniq_selector(register struct sdef *idf_sdef) +int uniq_selector(struct sdef *idf_sdef) { /* Returns true if idf_sdef (which is guaranteed to exist) is unique for this level, i.e there is no other selector @@ -305,7 +305,7 @@ int uniq_selector(register struct sdef *idf_sdef) case! */ - register struct sdef *sdef = idf_sdef->next; + struct sdef *sdef = idf_sdef->next; while (sdef && sdef->sd_level == idf_sdef->sd_level) { if ( sdef->sd_type != idf_sdef->sd_type @@ -323,10 +323,10 @@ int uniq_selector(register struct sdef *idf_sdef) arith add_field( arith *szp, /* size of struct upto here */ - register struct field *fd, /* bitfield, containing width */ - register struct type **fdtpp, /* type of selector */ + struct field *fd, /* bitfield, containing width */ + struct type **fdtpp, /* type of selector */ struct idf *idf, /* name of selector */ - register struct type *stp) /* current struct descriptor */ + struct type *stp) /* current struct descriptor */ { /* The address where this selector is put is returned. If the selector with specified width does not fit in the word, or @@ -436,14 +436,14 @@ add_field( #endif /* NOBITFIELD */ /* some utilities */ -int is_struct_or_union(register int fund) +int is_struct_or_union(int fund) { return fund == STRUCT || fund == UNION; } -static int gcd(register int m, register int n) +static int gcd(int m, int n) { - register int r; + int r; while (n) { r = m % n; @@ -454,7 +454,7 @@ static int gcd(register int m, register int n) } -static int lcm(register int m, register int n) +static int lcm(int m, int n) { return m * (n / gcd(m, n)); } diff --git a/lang/cem/cemcom.ansi/switch.c b/lang/cem/cemcom.ansi/switch.c index 95da9aabf0..4dfcce6aeb 100644 --- a/lang/cem/cemcom.ansi/switch.c +++ b/lang/cem/cemcom.ansi/switch.c @@ -57,9 +57,9 @@ void code_startswitch(struct expr **expp) /* Check the expression, stack a new case header and fill in the necessary fields. */ - register label l_table = text_label(); - register label l_break = text_label(); - register struct switch_hdr *sh = new_switch_hdr(); + label l_table = text_label(); + label l_break = text_label(); + struct switch_hdr *sh = new_switch_hdr(); int fund = any2arith(expp, SWITCH); /* INT, LONG, LNGLNG, FLOAT, DOUBLE or LNGDBL */ @@ -89,9 +89,9 @@ void code_startswitch(struct expr **expp) void code_endswitch(void) { - register struct switch_hdr *sh = switch_stack; - register label tablabel; - register struct case_entry *ce; + struct switch_hdr *sh = switch_stack; + label tablabel; + struct case_entry *ce; arith size = sh->sh_type->tp_size; if (sh->sh_default == 0) /* no default occurred yet */ @@ -151,7 +151,7 @@ void code_endswitch(void) switch_stack = sh->next; /* unstack the switch descriptor */ for (ce = sh->sh_entries; ce;) { /* free allocated switch structure */ - register struct case_entry *tmp = ce->next; + struct case_entry *tmp = ce->next; free_case_entry(ce); ce = tmp; @@ -163,8 +163,8 @@ void code_endswitch(void) void code_case(struct expr *expr) { writh val; - register struct case_entry *ce; - register struct switch_hdr *sh = switch_stack; + struct case_entry *ce; + struct switch_hdr *sh = switch_stack; assert(is_cp_cst(expr)); if (sh == 0) { @@ -184,7 +184,7 @@ void code_case(struct expr *expr) sh->sh_nrofentries = 1; } else { /* second etc. case entry; put ce into proper place */ - register struct case_entry *c1 = sh->sh_entries, *c2 = 0; + struct case_entry *c1 = sh->sh_entries, *c2 = 0; if (val < sh->sh_lowerbd) sh->sh_lowerbd = val; @@ -229,7 +229,7 @@ void code_case(struct expr *expr) void code_default(void) { - register struct switch_hdr *sh = switch_stack; + struct switch_hdr *sh = switch_stack; if (sh == 0) { error("default statement not in switch"); diff --git a/lang/cem/cemcom.ansi/tokenname.c b/lang/cem/cemcom.ansi/tokenname.c index 0a86f480e6..04553fff72 100644 --- a/lang/cem/cemcom.ansi/tokenname.c +++ b/lang/cem/cemcom.ansi/tokenname.c @@ -135,7 +135,7 @@ struct tokenname tkfunny[] = { /* internal keywords */ }; #endif /* ____ */ -void reserve(register struct tokenname resv[]) +void reserve(struct tokenname resv[]) { /* The names of the tokens described in resv are entered as reserved words. diff --git a/lang/cem/cemcom.ansi/tokenname.h b/lang/cem/cemcom.ansi/tokenname.h index f3f5edb2e2..1d953fc700 100644 --- a/lang/cem/cemcom.ansi/tokenname.h +++ b/lang/cem/cemcom.ansi/tokenname.h @@ -14,6 +14,6 @@ struct tokenname { /* Used for defining the name of a char *tn_name; }; -void reserve(register struct tokenname resv[]); +void reserve(struct tokenname resv[]); #endif /* TOKENNAME_H_ */ diff --git a/lang/cem/cemcom.ansi/type.c b/lang/cem/cemcom.ansi/type.c index 4a17038c5a..a0f41b3327 100644 --- a/lang/cem/cemcom.ansi/type.c +++ b/lang/cem/cemcom.ansi/type.c @@ -36,7 +36,7 @@ struct type *create_type(int fund) /* A brand new struct type is created, and its tp_fund set to fund. */ - register struct type *ntp = new_type(); + struct type *ntp = new_type(); ntp->tp_fund = fund; ntp->tp_size = (arith) -1; @@ -59,14 +59,14 @@ struct type *promoted_type(struct type *tp) return tp; } -struct type *construct_type(int fund, register struct type *tp, int qual, +struct type *construct_type(int fund, struct type *tp, int qual, arith count, /* for fund == ARRAY only */ -register struct proto *pl) +struct proto *pl) { /* fund must be a type constructor: FIELD, FUNCTION, POINTER or ARRAY. The pointer to the constructed type is returned. */ - register struct type *dtp; + struct type *dtp; switch (fund) { @@ -108,13 +108,13 @@ register struct proto *pl) return dtp; } -struct type *function_of(register struct type *tp, struct proto *pl, int qual) +struct type *function_of(struct type *tp, struct proto *pl, int qual) { #if 0 /* See comment below */ - register struct type *dtp = tp->tp_function; + struct type *dtp = tp->tp_function; #else - register struct type *dtp; + struct type *dtp; #endif /* look for a type with the right qualifier */ @@ -151,9 +151,9 @@ struct type *function_of(register struct type *tp, struct proto *pl, int qual) return dtp; } -struct type *pointer_to(register struct type *tp, int qual) +struct type *pointer_to(struct type *tp, int qual) { - register struct type *dtp = tp->tp_pointer; + struct type *dtp = tp->tp_pointer; /* look for a type with the right qualifier */ while (dtp && dtp->tp_typequal != qual) @@ -173,9 +173,9 @@ struct type *pointer_to(register struct type *tp, int qual) return dtp; } -struct type * array_of(register struct type *tp, arith count, int qual) +struct type * array_of(struct type *tp, arith count, int qual) { - register struct type *dtp = tp->tp_array; + struct type *dtp = tp->tp_array; /* look for a type with the right size */ while (dtp && (dtp->tp_nel != count || dtp->tp_typequal != qual)) @@ -201,9 +201,9 @@ struct type * array_of(register struct type *tp, arith count, int qual) } #ifndef NOBITFIELD -struct type * field_of(register struct type *tp, int qual) +struct type * field_of(struct type *tp, int qual) { - register struct type *dtp = create_type(FIELD); + struct type *dtp = create_type(FIELD); dtp->tp_up = tp; dtp->tp_align = tp->tp_align; @@ -232,7 +232,7 @@ void idf2type(struct idf *idf, struct type **tpp) descriptor to prevent garbage at the initialisation of arrays with unknown size. */ - register struct type *tp = idf->id_def->df_type; + struct type *tp = idf->id_def->df_type; if (*tpp) error("multiple types in declaration"); @@ -255,7 +255,7 @@ arith align(arith pos, int al) struct type * standard_type(int fund, int sgn, int algn, arith sz) { - register struct type *tp = create_type(fund); + struct type *tp = create_type(fund); tp->tp_unsigned = sgn != 0; tp->tp_align = algn; @@ -266,8 +266,8 @@ struct type * standard_type(int fund, int sgn, int algn, arith sz) void completed(struct type *tp) { - register struct type *atp = tp->tp_array; - register struct type *etp = tp; + struct type *atp = tp->tp_array; + struct type *etp = tp; switch (etp->tp_fund) { diff --git a/lang/cem/cemcom.ansi/util.c b/lang/cem/cemcom.ansi/util.c index 6d3f084bf8..53abc3c402 100644 --- a/lang/cem/cemcom.ansi/util.c +++ b/lang/cem/cemcom.ansi/util.c @@ -50,7 +50,7 @@ void LocalInit(void) arith LocalSpace(arith sz, int al) { - register struct stack_level *stl = local_level; + struct stack_level *stl = local_level; stl->sl_max_block = - align(sz - stl->sl_max_block, al); return stl->sl_max_block; @@ -61,7 +61,7 @@ static struct localvar *regs[TABSIZ]; arith NewLocal(arith sz, int al, int regtype, int sc) { - register struct localvar *tmp = FreeTmps; + struct localvar *tmp = FreeTmps; struct localvar *prev = 0; int index; @@ -97,7 +97,7 @@ arith NewLocal(arith sz, int al, int regtype, int sc) void FreeLocal(arith off) { int index = (int) (off >> 2) & (TABSIZ - 1); - register struct localvar *tmp = regs[index]; + struct localvar *tmp = regs[index]; struct localvar *prev = 0; while (tmp && tmp->t_offset != off) { @@ -114,8 +114,8 @@ void FreeLocal(arith off) void LocalFinish(void) { - register struct localvar *tmp, *tmp1; - register int i; + struct localvar *tmp, *tmp1; + int i; #ifdef USE_TMP C_beginpart(loc_id); @@ -160,7 +160,7 @@ void LocalFinish(void) void RegisterAccount(arith offset, arith size, int regtype, int sc) { - register struct localvar *p; + struct localvar *p; int index; if (regtype < 0) return; @@ -178,7 +178,7 @@ void RegisterAccount(arith offset, arith size, int regtype, int sc) static struct localvar *find_reg(arith off) { - register struct localvar *p = regs[(int)(off >> 2) & (TABSIZ - 1)]; + struct localvar *p = regs[(int)(off >> 2) & (TABSIZ - 1)]; while (p && p->t_offset != off) p = p->next; return p; @@ -186,7 +186,7 @@ static struct localvar *find_reg(arith off) void LoadLocal(arith off, arith sz) { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); #ifdef USE_TMP #ifdef REGCOUNT @@ -205,7 +205,7 @@ void LoadLocal(arith off, arith sz) void StoreLocal(arith off, arith sz) { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); #ifdef USE_TMP #ifdef REGCOUNT @@ -225,7 +225,7 @@ void StoreLocal(arith off, arith sz) #ifndef LINT void AddrLocal(arith off) { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); if (p) p->t_regtype = -1; C_lal(off); diff --git a/lang/cem/cemcom/LLlex.c b/lang/cem/cemcom/LLlex.c index 3bd570259e..6fb9c1454e 100644 --- a/lang/cem/cemcom/LLlex.c +++ b/lang/cem/cemcom/LLlex.c @@ -101,7 +101,7 @@ char *string_token(); int GetToken(ptok) - register struct token *ptok; + struct token *ptok; { /* GetToken() is the actual token recognizer. It calls the control line interpreter if it encounters a "\n#" @@ -109,7 +109,7 @@ GetToken(ptok) needed. */ char buf[(IDFSIZE > NUMSIZE ? IDFSIZE : NUMSIZE) + 1]; - register int ch, nch; + int ch, nch; token_nmb++; @@ -244,10 +244,10 @@ GetToken(ptok) } case STIDF: { - register char *tg = &buf[0]; - register int pos = -1; - register int hash; - register struct idf *idef; + char *tg = &buf[0]; + int pos = -1; + int hash; + struct idf *idef; extern int idfsize; /* ??? */ hash = STARTHASH(); @@ -288,7 +288,7 @@ GetToken(ptok) } case STCHAR: /* character constant */ { - register arith val = 0; + arith val = 0; int size = 0; LoadChar(ch); @@ -327,10 +327,10 @@ GetToken(ptok) 099.5 means 99.5 . This severely limits the tricks we can use to scan a numeric value. */ - register char *np = &buf[1]; - register int base = 10; - register int vch; - register arith val = 0; + char *np = &buf[1]; + int base = 10; + int vch; + arith val = 0; if (ch == '.') { /* an embarrassing ambiguity */ #ifndef NOFLOAT @@ -449,7 +449,7 @@ skipcomment() EOI is returned by LoadChar only on encountering EOF of the top-level file... */ - register int c; + int c; NoUnstack++; LoadChar(c); @@ -492,10 +492,10 @@ string_token(nm, stop_char, plen) char *nm; int *plen; { - register int ch; - register int str_size; - register char *str = Malloc((unsigned) (str_size = ISTRSIZE)); - register int pos = 0; + int ch; + int str_size; + char *str = Malloc((unsigned) (str_size = ISTRSIZE)); + int pos = 0; LoadChar(ch); while (ch != stop_char) { @@ -529,7 +529,7 @@ string_token(nm, stop_char, plen) int quoted(ch) - register int ch; + int ch; { /* quoted() replaces an escaped character sequence by the character meant. @@ -555,7 +555,7 @@ quoted(ch) } } else { /* a quoted octal */ - register int oct = 0, cnt = 0; + int oct = 0, cnt = 0; do { oct = oct*8 + (ch-'0'); @@ -570,7 +570,7 @@ quoted(ch) /* provisional */ int val_in_base(ch, base) - register int ch; + int ch; { return is_dig(ch) ? ch - '0' diff --git a/lang/cem/cemcom/arith.c b/lang/cem/cemcom/arith.c index 13adfd4269..f41a1a893d 100644 --- a/lang/cem/cemcom/arith.c +++ b/lang/cem/cemcom/arith.c @@ -31,13 +31,13 @@ extern char options[]; arithbalance(e1p, oper, e2p) /* RM 6.6 */ - register struct expr **e1p, **e2p; + struct expr **e1p, **e2p; int oper; { /* The expressions *e1p and *e2p are balanced to be operands of the arithmetic operator oper. */ - register int t1, t2, u1, u2; + int t1, t2, u1, u2; t1 = any2arith(e1p, oper); t2 = any2arith(e2p, oper); @@ -76,7 +76,7 @@ arithbalance(e1p, oper, e2p) /* RM 6.6 */ } relbalance(e1p, oper, e2p) - register struct expr **e1p, **e2p; + struct expr **e1p, **e2p; { /* The expressions *e1p and *e2p are balanced to be operands of the relational operator oper. @@ -101,13 +101,13 @@ relbalance(e1p, oper, e2p) ch76pointer(expp, oper, tp) struct expr **expp; - register struct type *tp; + struct type *tp; { /* Checks whether *expp may be compared to tp using oper, as described in chapter 7.6 and 7.7. tp is known to be a pointer. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; if (exp->ex_type->tp_fund == POINTER) { if (exp->ex_type != tp) @@ -136,8 +136,8 @@ ch76pointer(expp, oper, tp) int any2arith(expp, oper) - register struct expr **expp; - register int oper; + struct expr **expp; + int oper; { /* Turns any expression into int_type, long_type or double_type. @@ -201,7 +201,7 @@ erroneous2int(expp) /* the (erroneous) expression *expp is replaced by an int expression */ - register struct expr *exp = *expp; + struct expr *exp = *expp; int flags = exp->ex_flags; free_expression(exp); @@ -214,12 +214,12 @@ struct expr * arith2arith(tp, oper, expr) struct type *tp; int oper; - register struct expr *expr; + struct expr *expr; { /* arith2arith constructs a new expression containing a run-time conversion between some arithmetic types. */ - register struct expr *new = new_expr(); + struct expr *new = new_expr(); new->ex_file = expr->ex_file; new->ex_line = expr->ex_line; @@ -231,15 +231,15 @@ arith2arith(tp, oper, expr) int int2int(expp, tp) struct expr **expp; - register struct type *tp; + struct type *tp; { /* The expression *expp, which is of some integral type, is converted to the integral type tp. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; if (is_cp_cst(exp)) { - register struct type *tp1 = exp->ex_type; + struct type *tp1 = exp->ex_type; exp->ex_type = tp; if (! tp1->tp_unsigned && tp->tp_unsigned) { @@ -268,13 +268,13 @@ int2int(expp, tp) #ifndef NOFLOAT int2float(expp, tp) - register struct expr **expp; + struct expr **expp; struct type *tp; { /* The expression *expp, which is of some integral type, is converted to the floating type tp. */ - register struct expr *exp = *expp; + struct expr *exp = *expp; char buf[32]; fp_used = 1; @@ -305,7 +305,7 @@ float2int(expp, tp) } float2float(expp, tp) - register struct expr **expp; + struct expr **expp; struct type *tp; { /* The expression *expp, which is of some floating type, is @@ -323,7 +323,7 @@ float2float(expp, tp) #endif /* NOFLOAT */ array2pointer(exp) - register struct expr *exp; + struct expr *exp; { /* The expression, which must be an array, is converted to a pointer. @@ -332,7 +332,7 @@ array2pointer(exp) } function2pointer(exp) - register struct expr *exp; + struct expr *exp; { /* The expression, which must be a function, is converted to a pointer to the function. @@ -341,7 +341,7 @@ function2pointer(exp) } string2pointer(ex) - register struct expr *ex; + struct expr *ex; { /* The expression, which must be a string constant, is converted to a pointer to the string-containing area. @@ -356,10 +356,10 @@ string2pointer(ex) } opnd2integral(expp, oper) - register struct expr **expp; + struct expr **expp; int oper; { - register int fund = (*expp)->ex_type->tp_fund; + int fund = (*expp)->ex_type->tp_fund; if (fund != INT && fund != LONG) { expr_error(*expp, "%s operand to %s", @@ -370,7 +370,7 @@ opnd2integral(expp, oper) } opnd2logical(expp, oper) - register struct expr **expp; + struct expr **expp; int oper; { int fund = (*expp)->ex_type->tp_fund; @@ -411,7 +411,7 @@ opnd2logical(expp, oper) } opnd2test(expp, oper) - register struct expr **expp; + struct expr **expp; { opnd2logical(expp, oper); if ((*expp)->ex_class == Oper) { @@ -448,7 +448,7 @@ is_test_op(oper) } any2opnd(expp, oper) - register struct expr **expp; + struct expr **expp; { if (!*expp) return; @@ -478,14 +478,14 @@ any2opnd(expp, oper) #ifndef NOBITFIELD field2arith(expp) - register struct expr **expp; + struct expr **expp; { /* The expression to extract the bitfield value from the memory word is put in the tree. */ - register struct type *tp = (*expp)->ex_type->tp_up; - register struct field *fd = (*expp)->ex_type->tp_field; - register struct type *atype = tp->tp_unsigned ? uword_type : word_type; + struct type *tp = (*expp)->ex_type->tp_up; + struct field *fd = (*expp)->ex_type->tp_field; + struct type *atype = tp->tp_unsigned ? uword_type : word_type; (*expp)->ex_type = atype; @@ -514,7 +514,7 @@ field2arith(expp) take care of the first byte the fl_value pointer points to. */ switch_sign_fp(expr) - register struct expr *expr; + struct expr *expr; { if (*(expr->FL_VALUE) == '-') ++(expr->FL_VALUE); diff --git a/lang/cem/cemcom/ch7.c b/lang/cem/cemcom/ch7.c index 65cc6f4143..7b29b9e420 100644 --- a/lang/cem/cemcom/ch7.c +++ b/lang/cem/cemcom/ch7.c @@ -34,9 +34,9 @@ ch7sel(expp, oper, idf) /* The selector idf is applied to *expp; oper may be '.' or ARROW. */ - register struct expr *exp; - register struct type *tp; - register struct sdef *sd; + struct expr *exp; + struct type *tp; + struct sdef *sd; any2opnd(expp, oper); exp = *expp; @@ -146,15 +146,15 @@ ch7incr(expp, oper) } ch7cast(expp, oper, tp) - register struct expr **expp; - register struct type *tp; + struct expr **expp; + struct type *tp; { /* The expression *expp is cast to type tp; the cast is caused by the operator oper. If the cast has to be passed on to run time, its left operand will be an expression of class Type. */ - register struct type *oldtp; + struct type *oldtp; if ((*expp)->ex_type->tp_fund == FUNCTION) function2pointer(*expp); @@ -344,7 +344,7 @@ ch7asgn(expp, oper, expr) f (typeof (f op e))e EVAL should however take care of evaluating (typeof (f op e))f */ - register struct expr *exp = *expp; + struct expr *exp = *expp; int fund = exp->ex_type->tp_fund; struct type *tp; @@ -399,7 +399,7 @@ ch7asgn(expp, oper, expr) */ int is_integral_type(tp) - register struct type *tp; + struct type *tp; { switch (tp->tp_fund) { case CHAR: @@ -419,7 +419,7 @@ is_integral_type(tp) int is_arith_type(tp) - register struct type *tp; + struct type *tp; { switch (tp->tp_fund) { case CHAR: diff --git a/lang/cem/cemcom/ch7bin.c b/lang/cem/cemcom/ch7bin.c index 8badf41341..b5e8846961 100644 --- a/lang/cem/cemcom/ch7bin.c +++ b/lang/cem/cemcom/ch7bin.c @@ -30,7 +30,7 @@ extern char options[]; #define non_commutative_binop(expp, oper, expr) mk_binop(expp, oper, expr, 0) ch7bin(expp, oper, expr) - register struct expr **expp; + struct expr **expp; struct expr *expr; { /* apply binary operator oper between *expp and expr. @@ -210,7 +210,7 @@ ch7bin(expp, oper, expr) opnd2test(expp, oper); opnd2test(&expr, oper); if (is_cp_cst(*expp)) { - register struct expr *ex = *expp; + struct expr *ex = *expp; /* the following condition is a short-hand for ((oper == AND) && o1) || ((oper == OR) && !o1) @@ -299,7 +299,7 @@ ch7bin(expp, oper, expr) } pntminuspnt(expp, oper, expr) - register struct expr **expp, *expr; + struct expr **expp, *expr; { /* Subtracting two pointers is so complicated it merits a routine of its own. @@ -324,13 +324,13 @@ pntminuspnt(expp, oper, expr) mk_binop(expp, oper, expr, commutative) struct expr **expp; - register struct expr *expr; + struct expr *expr; { /* Constructs in *expp the operation indicated by the operands. "commutative" indicates whether "oper" is a commutative operator. */ - register struct expr *ex = *expp; + struct expr *ex = *expp; if (is_cp_cst(expr) && is_cp_cst(ex)) cstbin(expp, oper, expr); @@ -345,7 +345,7 @@ mk_binop(expp, oper, expr, commutative) } pointer_arithmetic(expp1, oper, expp2) - register struct expr **expp1, **expp2; + struct expr **expp1, **expp2; { /* prepares the integral expression expp2 in order to apply it to the pointer expression expp1 @@ -364,7 +364,7 @@ pointer_arithmetic(expp1, oper, expp2) } pointer_binary(expp, oper, expr) - register struct expr **expp, *expr; + struct expr **expp, *expr; { /* constructs the pointer arithmetic expression out of a pointer expression, a binary operator and an integral diff --git a/lang/cem/cemcom/ch7mon.c b/lang/cem/cemcom/ch7mon.c index cc86f0f599..394f776c47 100644 --- a/lang/cem/cemcom/ch7mon.c +++ b/lang/cem/cemcom/ch7mon.c @@ -22,11 +22,11 @@ extern long full_mask[/*MAXSIZE*/]; /* cstoper.c */ char *symbol2str(); ch7mon(oper, expp) - register struct expr **expp; + struct expr **expp; { /* The monadic prefix operator oper is applied to *expp. */ - register struct expr *expr; + struct expr *expr; switch (oper) { case '*': /* RM 7.2 */ @@ -72,7 +72,7 @@ ch7mon(oper, expp) else { /* assume that enums are already filtered out */ if (ISNAME(*expp)) { - register struct def *def = + struct def *def = (*expp)->VL_IDF->id_def; /* & indicates that diff --git a/lang/cem/cemcom/code.c b/lang/cem/cemcom/code.c index 9613918235..b753152720 100644 --- a/lang/cem/cemcom/code.c +++ b/lang/cem/cemcom/code.c @@ -108,7 +108,7 @@ code_string(val, len, dlb) int len; label dlb; { - register struct string_cst *sc = new_string_cst(); + struct string_cst *sc = new_string_cst(); C_ina_dlb(dlb); sc->next = str_list; @@ -119,7 +119,7 @@ code_string(val, len, dlb) } def_strings(sc) - register struct string_cst *sc; + struct string_cst *sc; { while (sc) { struct string_cst *sc1 = sc; @@ -157,14 +157,14 @@ prepend_scopes() and generates those exa's, exp's, ina's and inp's that superior hindsight has provided. */ - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; #ifdef USE_TMP C_beginpart(tmp_id); #endif /* USE_TMP */ while (se != 0) { - register struct idf *id = se->se_idf; - register struct def *df = id->id_def; + struct idf *id = se->se_idf; + struct def *df = id->id_def; if (df && (df->df_initialized || df->df_used || df->df_alloc)) code_scope(id->id_text, df); @@ -178,7 +178,7 @@ prepend_scopes() code_scope(text, def) char *text; - register struct def *def; + struct def *def; { /* generates code for one name, text, of the storage class as given by def, if meaningful. @@ -222,8 +222,8 @@ begin_proc(ds, idf) /* to be called when entering a procedure */ does not fit in the return area - a fil pseudo instruction */ - register char *name = idf->id_text; - register struct def *def = idf->id_def; + char *name = idf->id_text; + struct def *def = idf->id_def; while (def->df_level > L_GLOBAL) def = def->next; /* idf->id_def does not indicate the right def structure @@ -391,7 +391,7 @@ do_return_expr(expr) } code_declaration(idf, expr, lvl, sc) - register struct idf *idf; /* idf to be declared */ + struct idf *idf; /* idf to be declared */ struct expr *expr; /* initialisation; NULL if absent */ int lvl; /* declaration level */ int sc; /* storage class, as in the declaration */ @@ -419,8 +419,8 @@ code_declaration(idf, expr, lvl, sc) while at the same time forbidding extern int a = 5; */ - register struct def *def = idf->id_def; - register arith size = def->df_type->tp_size; + struct def *def = idf->id_def; + arith size = def->df_type->tp_size; int def_sc = def->df_sc; if (def_sc == TYPEDEF) { /* no code for typedefs */ @@ -500,14 +500,14 @@ code_declaration(idf, expr, lvl, sc) loc_init(expr, id) struct expr *expr; - register struct idf *id; + struct idf *id; { /* loc_init() generates code for the assignment of expression expr to the local variable described by id. It frees the expression afterwards. */ - register struct expr *e = expr; - register struct type *tp = id->id_def->df_type; + struct expr *e = expr; + struct type *tp = id->id_def->df_type; ASSERT(id->id_def->df_sc != STATIC); switch (tp->tp_fund) { @@ -554,7 +554,7 @@ loc_init(expr, id) } bss(idf) - register struct idf *idf; + struct idf *idf; { /* bss() allocates bss space for the global idf. */ @@ -583,12 +583,12 @@ bss(idf) } formal_cvt(df) - register struct def *df; + struct def *df; { /* formal_cvt() converts a formal parameter of type char or short from int to that type. */ - register struct type *tp = df->df_type; + struct type *tp = df->df_type; if (tp->tp_size != int_size && (tp->tp_fund == CHAR || tp->tp_fund == SHORT) @@ -641,7 +641,7 @@ static struct stmt_block *stmt_stack; /* top of statement stack */ */ code_break() { - register struct stmt_block *stmt_block = stmt_stack; + struct stmt_block *stmt_block = stmt_stack; #ifdef DBSYMTAB if (options['g']) db_line(dot.tk_file, dot.tk_line); @@ -659,7 +659,7 @@ code_break() */ code_continue() { - register struct stmt_block *stmt_block = stmt_stack; + struct stmt_block *stmt_block = stmt_stack; while (stmt_block) { if (stmt_block->st_continue) { @@ -677,7 +677,7 @@ code_continue() stack_stmt(break_label, cont_label) label break_label, cont_label; { - register struct stmt_block *stmt_block = new_stmt_block(); + struct stmt_block *stmt_block = new_stmt_block(); stmt_block->next = stmt_stack; stmt_block->st_break = break_label; @@ -690,7 +690,7 @@ unstack_stmt() /* unstack_stmt() unstacks the data of a statement which may contain break or continue */ - register struct stmt_block *sbp = stmt_stack; + struct stmt_block *sbp = stmt_stack; stmt_stack = sbp->next; free_stmt_block(sbp); } diff --git a/lang/cem/cemcom/conversion.c b/lang/cem/cemcom/conversion.c index 28b1052b21..d6dedb3308 100644 --- a/lang/cem/cemcom/conversion.c +++ b/lang/cem/cemcom/conversion.c @@ -33,10 +33,10 @@ static int convtype(); conversion(from_type, to_type) - register struct type *from_type, *to_type; + struct type *from_type, *to_type; { - register arith from_size = from_type->tp_size; - register arith to_size = to_type->tp_size; + arith from_size = from_type->tp_size; + arith to_size = to_type->tp_size; int from_cnvtype = convtype(from_type); int to_cnvtype = convtype(to_type); @@ -131,7 +131,7 @@ conversion(from_type, to_type) */ static int convtype(tp) - register struct type *tp; + struct type *tp; { switch (tp->tp_fund) { case CHAR: diff --git a/lang/cem/cemcom/cstoper.c b/lang/cem/cemcom/cstoper.c index 15a09467a8..15166860ef 100644 --- a/lang/cem/cemcom/cstoper.c +++ b/lang/cem/cemcom/cstoper.c @@ -22,14 +22,14 @@ arith max_int; /* maximum integer on target machine */ arith max_unsigned; /* maximum unsigned on target machine */ cstbin(expp, oper, expr) - register struct expr **expp, *expr; + struct expr **expp, *expr; { /* The operation oper is performed on the constant expressions *expp(ld) and expr(ct), and the result restored in *expp. */ - register arith o1 = (*expp)->VL_VALUE; - register arith o2 = expr->VL_VALUE; + arith o1 = (*expp)->VL_VALUE; + arith o2 = expr->VL_VALUE; int uns = (*expp)->ex_type->tp_unsigned; ASSERT(is_ld_cst(*expp) && is_cp_cst(expr)); @@ -183,12 +183,12 @@ cstbin(expp, oper, expr) } cut_size(expr) - register struct expr *expr; + struct expr *expr; { /* The constant value of the expression expr is made to conform to the size of the type of the expression. */ - register arith o1 = expr->VL_VALUE; + arith o1 = expr->VL_VALUE; int uns = expr->ex_type->tp_unsigned; int size = (int) expr->ex_type->tp_size; @@ -219,8 +219,8 @@ cut_size(expr) init_cst() { - register int i = 0; - register arith bt = (arith)0; + int i = 0; + arith bt = (arith)0; while (!(bt < 0)) { bt = (bt << 8) + 0377, i++; diff --git a/lang/cem/cemcom/declar.g b/lang/cem/cemcom/declar.g index f8bb113e38..295c7412c7 100644 --- a/lang/cem/cemcom/declar.g +++ b/lang/cem/cemcom/declar.g @@ -72,7 +72,7 @@ declaration makes all hope of writing a specific grammar for typedefs illusory. */ -decl_specifiers /* non-empty */ (register struct decspecs *ds;) +decl_specifiers /* non-empty */ (struct decspecs *ds;) /* Reads a non-empty decl_specifiers and fills the struct decspecs *ds. */ @@ -92,7 +92,7 @@ decl_specifiers /* non-empty */ (register struct decspecs *ds;) ; /* 8.1 */ -other_specifier(register struct decspecs *ds;): +other_specifier(struct decspecs *ds;): [ AUTO | STATIC | EXTERN | TYPEDEF | REGISTER ] { if (ds->ds_sc_given) error("repeated storage class specifier"); @@ -130,7 +130,7 @@ type_specifier(struct type **tpp;) {*tpp = Ds.ds_type;} ; -single_type_specifier(register struct decspecs *ds;): +single_type_specifier(struct decspecs *ds;): %default TYPE_IDENTIFIER /* this includes INT, CHAR, etc. */ {idf2type(dot.tk_idf, &ds->ds_type);} | @@ -159,7 +159,7 @@ init_declarator_list(struct decspecs *ds;): [ ',' init_declarator(ds) ]* ; -init_declarator(register struct decspecs *ds;) +init_declarator(struct decspecs *ds;) { struct declarator Dc; } @@ -252,7 +252,7 @@ initializer(struct idf *idf; int sc;) we just include the (formal) parameter list in the declarator description list dc. */ -declarator(register struct declarator *dc;) +declarator(struct declarator *dc;) { arith count; struct formal *fm = 0; @@ -276,7 +276,7 @@ declarator(register struct declarator *dc;) {add_decl_unary(dc, POINTER, (arith)0, NO_PARAMS);} ; -primary_declarator(register struct declarator *dc;) : +primary_declarator(struct declarator *dc;) : identifier(&dc->dc_idf) | '(' declarator(dc) ')' @@ -310,7 +310,7 @@ formal(struct formal **fmp;) : identifier(&idf) { - register struct formal *new = new_formal(); + struct formal *new = new_formal(); new->fm_idf = idf; new->next = *fmp; @@ -319,7 +319,7 @@ formal(struct formal **fmp;) ; /* Change 2 */ -enum_specifier(register struct type **tpp;) +enum_specifier(struct type **tpp;) { struct idf *idf; arith l = (arith)0; @@ -348,7 +348,7 @@ enum_specifier(register struct type **tpp;) ] ; -enumerator_pack(register struct type *tp; arith *lp;) : +enumerator_pack(struct type *tp; arith *lp;) : '{' enumerator(tp, lp) [%while(AHEAD != '}') /* >>> conflict on ',' */ @@ -382,11 +382,11 @@ enumerator(struct type *tp; arith *lp;) ; /* 8.5 */ -struct_or_union_specifier(register struct type **tpp;) +struct_or_union_specifier(struct type **tpp;) { int fund; struct idf *idfX; - register struct idf *idf; + struct idf *idf; } : [ STRUCT | UNION ] @@ -419,7 +419,7 @@ struct_or_union_specifier(register struct type **tpp;) ] ; -struct_declaration_pack(register struct type *stp;) +struct_declaration_pack(struct type *stp;) { struct sdef **sdefp = &stp->tp_sdef; arith size = (arith)0; @@ -509,7 +509,7 @@ cast(struct type **tpp;) {struct declarator Dc;} : /* This code is an abject copy of that of 'declarator', for lack of a two-level grammar. */ -abstract_declarator(register struct declarator *dc;) +abstract_declarator(struct declarator *dc;) {arith count;} : primary_abstract_declarator(dc) diff --git a/lang/cem/cemcom/declarator.c b/lang/cem/cemcom/declarator.c index 9a3e8f17c9..9246ac6b71 100644 --- a/lang/cem/cemcom/declarator.c +++ b/lang/cem/cemcom/declarator.c @@ -26,7 +26,7 @@ declare_type(tp, dc) /* Applies the decl_unary list starting at dc->dc_decl_unary to the type tp and returns the result. */ - register struct decl_unary *du = dc->dc_decl_unary; + struct decl_unary *du = dc->dc_decl_unary; while (du) { tp = construct_type(du->du_fund, tp, du->du_count); @@ -36,7 +36,7 @@ declare_type(tp, dc) } add_decl_unary(dc, fund, count, fm) - register struct declarator *dc; + struct declarator *dc; arith count; struct formal *fm; { @@ -44,7 +44,7 @@ add_decl_unary(dc, fund, count, fm) type fund and with size count is inserted in front of the declarator dc. */ - register struct decl_unary *new = new_decl_unary(); + struct decl_unary *new = new_decl_unary(); new->next = dc->dc_decl_unary; new->du_fund = fund; @@ -68,7 +68,7 @@ remove_declarator(dc) /* The decl_unary list starting at dc->dc_decl_unary is removed. */ - register struct decl_unary *du = dc->dc_decl_unary; + struct decl_unary *du = dc->dc_decl_unary; while (du) { struct decl_unary *old_du = du; @@ -79,7 +79,7 @@ remove_declarator(dc) } reject_params(dc) - register struct declarator *dc; + struct declarator *dc; { /* The declarator is checked to have no parameters, if it is a function. @@ -92,7 +92,7 @@ reject_params(dc) } check_array_subscript(expr) - register struct expr *expr; + struct expr *expr; { arith size = expr->VL_VALUE; diff --git a/lang/cem/cemcom/decspecs.c b/lang/cem/cemcom/decspecs.c index 9096a5ca39..8b4a7e147d 100644 --- a/lang/cem/cemcom/decspecs.c +++ b/lang/cem/cemcom/decspecs.c @@ -22,12 +22,12 @@ extern int level; struct decspecs null_decspecs; do_decspecs(ds) - register struct decspecs *ds; + struct decspecs *ds; { /* The provisional decspecs ds as obtained from the program is turned into a legal consistent decspecs. */ - register struct type *tp = ds->ds_type; + struct type *tp = ds->ds_type; ASSERT(level != L_FORMAL1); diff --git a/lang/cem/cemcom/domacro.c b/lang/cem/cemcom/domacro.c index 016242d302..5ba3a89988 100644 --- a/lang/cem/cemcom/domacro.c +++ b/lang/cem/cemcom/domacro.c @@ -36,27 +36,27 @@ extern char options[]; IMPORT char **inctable; /* list of include directories */ IMPORT char *getwdir(); -PRIVATE char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */ +static char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */ /* 1 if a corresponding ELSE has been */ /* encountered. */ int nestlevel = -1; -PRIVATE do_include(); -PRIVATE ifexpr(); -PRIVATE do_define(); -PRIVATE push_if(); -PRIVATE do_elif(); -PRIVATE do_else(); -PRIVATE do_endif(); -PRIVATE do_if(); -PRIVATE do_ifdef(); -PRIVATE do_undef(); -PRIVATE int getparams(); -PRIVATE char *get_text(); -PRIVATE int macroeq(); -PRIVATE SkipRestOfLine(); -PRIVATE do_line(); +static do_include(); +static ifexpr(); +static do_define(); +static push_if(); +static do_elif(); +static do_else(); +static do_endif(); +static do_if(); +static do_ifdef(); +static do_undef(); +static int getparams(); +static char *get_text(); +static int macroeq(); +static SkipRestOfLine(); +static do_line(); struct idf * GetIdentifier() @@ -159,7 +159,7 @@ domacro() int lint_skip_comment; #endif -PRIVATE +static skip_block(to_endif) { /* skip_block() skips the input from @@ -170,8 +170,8 @@ skip_block(to_endif) #ifndef or #elif until the corresponding #endif is seen. */ - register int ch; - register int skiplevel = nestlevel; /* current nesting level */ + int ch; + int skiplevel = nestlevel; /* current nesting level */ struct token tk; #ifdef LINT @@ -258,7 +258,7 @@ skip_block(to_endif) } } -PRIVATE +static ifexpr() { /* ifexpr() returns whether the restricted constant @@ -281,7 +281,7 @@ ifexpr() return (errors == err_occurred) && (ifval != (arith)0); } -PRIVATE +static do_include() { /* do_include() performs the inclusion of a file. @@ -322,7 +322,7 @@ do_include() } } -PRIVATE +static do_define() { /* do_define() interprets a #define control line. @@ -333,7 +333,7 @@ do_define() char parbuf[PARBUFSIZE]; /* names of formals */ char *repl_text; /* start of the replacement text */ int length; /* length of the replacement text */ - register ch; + int ch; /* read the #defined macro's name */ if (!(id = GetIdentifier())) { @@ -369,7 +369,7 @@ do_define() LineNumber++; } -PRIVATE +static push_if() { if (nestlevel >= IFDEPTH) @@ -378,7 +378,7 @@ push_if() ifstack[++nestlevel] = 0; } -PRIVATE +static do_elif() { if (nestlevel <= nestlow || (ifstack[nestlevel])) { @@ -392,7 +392,7 @@ do_elif() } } -PRIVATE +static do_else() { SkipRestOfLine(); @@ -404,7 +404,7 @@ do_else() } } -PRIVATE +static do_endif() { SkipRestOfLine(); @@ -414,7 +414,7 @@ do_endif() else nestlevel--; } -PRIVATE +static do_if() { push_if(); @@ -422,10 +422,10 @@ do_if() skip_block(0); } -PRIVATE +static do_ifdef(how) { - register struct idf *id; + struct idf *id; /* how == 1 : ifdef; how == 0 : ifndef */ @@ -442,10 +442,10 @@ do_ifdef(how) SkipRestOfLine(); } -PRIVATE +static do_undef() { - register struct idf *id; + struct idf *id; /* Forget a macro definition. */ if (id = GetIdentifier()) { @@ -459,7 +459,7 @@ do_undef() SkipRestOfLine(); } -PRIVATE int +static int getparams(buf, parbuf) char *buf[]; char parbuf[]; @@ -474,10 +474,10 @@ getparams(buf, parbuf) Note that the '(' has already been eaten. The names of the formal parameters are stored into parbuf. */ - register char **pbuf = &buf[0]; - register int c; - register char *ptr = &parbuf[0]; - register char **pbuf2; + char **pbuf = &buf[0]; + int c; + char *ptr = &parbuf[0]; + char **pbuf2; LoadChar(c); c = skipspaces(c,0); @@ -530,10 +530,10 @@ getparams(buf, parbuf) EXPORT macro_def(id, text, nformals, length, flags) - register struct idf *id; + struct idf *id; char *text; { - register struct macro *newdef = id->id_macro; + struct macro *newdef = id->id_macro; /* macro_def() puts the contents and information of a macro definition into a structure and stores it into the symbol @@ -554,7 +554,7 @@ macro_def(id, text, nformals, length, flags) newdef->mc_count = 0; } -PRIVATE int +static int find_name(nm, index) char *nm, *index[]; { @@ -562,7 +562,7 @@ find_name(nm, index) "index" if it can be found there. 0 is returned if it is not there. */ - register char **ip = &index[0]; + char **ip = &index[0]; while (*ip) if (strcmp(nm, *ip++) == 0) @@ -571,7 +571,7 @@ find_name(nm, index) return 0; } -PRIVATE char * +static char * get_text(formals, length) char *formals[]; int *length; @@ -591,10 +591,10 @@ get_text(formals, length) identifiers, because they might be replaced by some actual parameter. Other tokens will not be seen as such. */ - register int c; - register int text_size; + int c; + int text_size; char *text = Malloc(text_size = ITEXTSIZE); - register int pos = 0; + int pos = 0; LoadChar(c); @@ -631,8 +631,8 @@ get_text(formals, length) else if (formals && class(c) == STIDF) { char id_buf[IDFSIZE + 1]; - register id_size = 0; - register n; + id_size = 0; + int n; /* read identifier: it may be a formal parameter */ id_buf[id_size++] = c; @@ -650,7 +650,7 @@ get_text(formals, length) text_size += RTEXTSIZE); } else { - register char *ptr = &id_buf[0]; + char *ptr = &id_buf[0]; while (pos + id_size >= text_size) text = Srealloc(text, @@ -678,9 +678,9 @@ get_text(formals, length) as strings, without taking care of the leading and trailing blanks (spaces and tabs). */ -PRIVATE int +static int macroeq(s, t) - register char *s, *t; + char *s, *t; { /* skip leading spaces */ @@ -729,7 +729,7 @@ domacro() } #endif /* NOPP */ -PRIVATE +static SkipRestOfLine() { /* we do a PushBack because we don't want to skip the next line @@ -739,7 +739,7 @@ SkipRestOfLine() skipline(); } -PRIVATE +static do_line(l) unsigned int l; { diff --git a/lang/cem/cemcom/dumpidf.c b/lang/cem/cemcom/dumpidf.c index d525a27f47..39b3c74e9c 100644 --- a/lang/cem/cemcom/dumpidf.c +++ b/lang/cem/cemcom/dumpidf.c @@ -44,7 +44,7 @@ static int dumplevel; static newline() { - register int dl = dumplevel; + int dl = dumplevel; print("\n"); while (dl >= 2) { @@ -69,7 +69,7 @@ dumpidftab(msg, opt) print(">>> DUMPIDF, %s (start)", msg); dumpstack(); for (i = 0; i < HASHSIZE; i++) { - register struct idf *notch = idf_hashtable[i]; + struct idf *notch = idf_hashtable[i]; while (notch) { dumpidf(notch, opt); @@ -84,10 +84,10 @@ dumpstack() { /* Dumps the identifier stack, starting at the top. */ - register struct stack_level *stl = local_level; + struct stack_level *stl = local_level; while (stl) { - register struct stack_entry *se = stl->sl_entry; + struct stack_entry *se = stl->sl_entry; newline(); print("%3d: ", stl->sl_level); @@ -101,7 +101,7 @@ dumpstack() } dumpidf(idf, opt) - register struct idf *idf; + struct idf *idf; { /* All information about the identifier idf is divulged in a hopefully readable format. @@ -157,7 +157,7 @@ dumpidf(idf, opt) } dumpdefs(def, opt) - register struct def *def; + struct def *def; { dumplevel++; while (def && ((opt&4) || def->df_level)) { @@ -179,12 +179,12 @@ dumpdefs(def, opt) } dumptags(tag) - register struct tag *tag; + struct tag *tag; { dumplevel++; while (tag) { - register struct type *tp = tag->tg_type; - register int fund = tp->tp_fund; + struct type *tp = tag->tg_type; + int fund = tp->tp_fund; newline(); print("L%d: %s %s", @@ -207,7 +207,7 @@ dumptags(tag) } dumpsdefs(sdef, sdk) - register struct sdef *sdef; + struct sdef *sdef; enum sdef_kind sdk; { /* Since sdef's are members of two chains, there are actually @@ -240,7 +240,7 @@ dumpsdefs(sdef, sdk) char * type2str(tp) - register struct type *tp; + struct type *tp; { /* Yields a pointer to a one-line description of the type tp. */ @@ -317,7 +317,7 @@ print_expr(msg, expr) } p1_expr(lvl, expr) - register struct expr *expr; + struct expr *expr; { p1_indent(lvl); if (!expr) { @@ -394,7 +394,7 @@ p1_expr(lvl, expr) } p1_indent(lvl) - register int lvl; + int lvl; { while (lvl--) print(" "); diff --git a/lang/cem/cemcom/error.c b/lang/cem/cemcom/error.c index 7bbc1c0484..eec3f8d6c6 100644 --- a/lang/cem/cemcom/error.c +++ b/lang/cem/cemcom/error.c @@ -243,7 +243,7 @@ expr_error(va_alist) /* expr, fmt, args */ va_start(ap); { - register struct expr *expr = va_arg(ap, struct expr *); + struct expr *expr = va_arg(ap, struct expr *); char *fmt = va_arg(ap, char *); if (!(expr->ex_flags & EX_ERROR)) { @@ -298,7 +298,7 @@ def_warning(va_alist) /* def, fmt, args */ va_start(ap); { - register struct def *def = va_arg(ap, struct def *); + struct def *def = va_arg(ap, struct def *); char *fmt = va_arg(ap, char *); _error(WARNING, def->df_file, def->df_line, fmt, ap); diff --git a/lang/cem/cemcom/eval.c b/lang/cem/cemcom/eval.c index 542980db4e..0a14ecf3b0 100644 --- a/lang/cem/cemcom/eval.c +++ b/lang/cem/cemcom/eval.c @@ -65,11 +65,11 @@ arith NewLocal(); /* util.c */ */ EVAL(expr, val, code, true_label, false_label) - register struct expr *expr; + struct expr *expr; int val, code; label true_label, false_label; { - register int gencode = (code == TRUE && expr->ex_type->tp_size > 0); + int gencode = (code == TRUE && expr->ex_type->tp_size > 0); switch (expr->ex_class) { case Value: /* just a simple value */ @@ -105,9 +105,9 @@ EVAL(expr, val, code, true_label, false_label) case Oper: /* compound expression */ { int oper = expr->OP_OPER; - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; - register struct type *tp = expr->OP_TYPE; + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; + struct type *tp = expr->OP_TYPE; if (tp->tp_fund == ERRONEOUS || (expr->ex_flags & EX_ERROR)) { /* stop immediately */ @@ -476,7 +476,7 @@ EVAL(expr, val, code, true_label, false_label) } case '(': { - register struct expr *ex; + struct expr *ex; arith ParSize = (arith)0; label setjmp_label = 0; @@ -497,7 +497,7 @@ EVAL(expr, val, code, true_label, false_label) while ( ex->ex_class == Oper && ex->OP_OPER == PARCOMMA ) { - register struct expr *rght = ex->OP_RIGHT; + struct expr *rght = ex->OP_RIGHT; EVAL(rght, RVAL, rght->ex_type->tp_size > 0, NO_LABEL, NO_LABEL); @@ -706,11 +706,11 @@ truthvalue(relop) /* assop() generates the opcode of an assignment operators op= */ assop(type, oper) - register struct type *type; + struct type *type; int oper; { - register arith size; - register uns = type->tp_unsigned; + arith size; + uns = type->tp_unsigned; if ((int)(size = type->tp_size) < (int)word_size) size = word_size; @@ -824,14 +824,14 @@ assop(type, oper) - absolute addressing */ store_val(vl, tp) - register struct value *vl; + struct value *vl; struct type *tp; { arith size = tp->tp_size; int tpalign = tp->tp_align; int al_on_word; - register int inword; - register int indword; + int inword; + int indword; arith val = vl->vl_value; if (vl->vl_class == Const) { /* absolute addressing */ @@ -843,8 +843,8 @@ store_val(vl, tp) if (!(inword = (size == word_size && al_on_word))) indword = (size == dword_size && al_on_word); if (vl->vl_class == Name) { - register struct idf *id = vl->vl_data.vl_idf; - register struct def *df = id->id_def; + struct idf *id = vl->vl_data.vl_idf; + struct def *df = id->id_def; if (df->df_level == L_GLOBAL) { if (inword) @@ -894,16 +894,16 @@ store_val(vl, tp) - local variable */ load_val(expr, rlval) - register struct expr *expr; /* expression containing the value */ + struct expr *expr; /* expression containing the value */ int rlval; /* generate either LVAL or RVAL */ { - register struct type *tp = expr->ex_type; + struct type *tp = expr->ex_type; int rvalue = (rlval == RVAL && expr->ex_lvalue != 0); arith size = tp->tp_size; int tpalign = tp->tp_align; int al_on_word; - register int inword, indword; - register arith val = expr->VL_VALUE; + int inword, indword; + arith val = expr->VL_VALUE; if (expr->VL_CLASS == Const) { if (rvalue) { /* absolute addressing */ @@ -938,8 +938,8 @@ load_val(expr, rlval) } } else { - register struct idf *id = expr->VL_IDF; - register struct def *df = id->id_def; + struct idf *id = expr->VL_IDF; + struct def *df = id->id_def; ASSERT(ISNAME(expr)); if (df->df_type->tp_fund == FUNCTION) { diff --git a/lang/cem/cemcom/expr.c b/lang/cem/cemcom/expr.c index 43adcbdf67..94e86332ad 100644 --- a/lang/cem/cemcom/expr.c +++ b/lang/cem/cemcom/expr.c @@ -100,7 +100,7 @@ rank_of(oper) #ifndef NOROPTION int rank_of_expression(ex) - register struct expr *ex; + struct expr *ex; { /* Returns the rank of the top node in the expression. */ @@ -110,7 +110,7 @@ rank_of_expression(ex) } check_conditional(expr, oper, pos_descr) - register struct expr *expr; + struct expr *expr; char *pos_descr; { /* Warn if restricted C is in effect and the expression expr, @@ -129,7 +129,7 @@ dot2expr(expp) /* The token in dot is converted into an expression, a pointer to which is stored in *expp. */ - register struct expr *ex = new_expr(); + struct expr *ex = new_expr(); *expp = ex; ex->ex_file = dot.tk_file; @@ -156,15 +156,15 @@ dot2expr(expp) } idf2expr(expr) - register struct expr *expr; + struct expr *expr; { /* Dot contains an identifier which is turned into an expression. Note that this constitutes an applied occurrence of the identifier. */ - register struct idf *idf = dot.tk_idf; /* != 0*/ - register struct def *def = idf->id_def; + struct idf *idf = dot.tk_idf; /* != 0*/ + struct def *def = idf->id_def; if (def == 0) { if (AHEAD == '(') /* function call, declare name IMPLICITly */ @@ -221,7 +221,7 @@ idf2expr(expr) } string2expr(expr) - register struct expr *expr; + struct expr *expr; { /* Dot contains a string which is turned into an expression. */ @@ -244,7 +244,7 @@ int2expr(expr) #ifndef NOFLOAT float2expr(expr) - register struct expr *expr; + struct expr *expr; { /* Dot contains a floating point constant which is turned into an expression. @@ -264,7 +264,7 @@ intexpr(ivalue, fund) /* The value ivalue is turned into an integer expression of the size indicated by fund. */ - register struct expr *expr = new_expr(); + struct expr *expr = new_expr(); expr->ex_file = dot.tk_file; expr->ex_line = dot.tk_line; @@ -273,7 +273,7 @@ intexpr(ivalue, fund) } fill_int_expr(ex, ivalue, fund) - register struct expr *ex; + struct expr *ex; arith ivalue; int fund; { @@ -326,7 +326,7 @@ fill_int_expr(ex, ivalue, fund) struct expr * new_oper(tp, e1, oper, e2) struct type *tp; - register struct expr *e1, *e2; + struct expr *e1, *e2; { /* A new expression is constructed which consists of the operator oper which has e1 and e2 as operands; for a @@ -334,11 +334,11 @@ new_oper(tp, e1, oper, e2) During the construction of the right recursive initialisation tree it is possible for e2 to be NILEXPR. */ - register struct expr *expr = new_expr(); - register struct oper *op; + struct expr *expr = new_expr(); + struct oper *op; if (e2) { - register struct expr *e = e2; + struct expr *e = e2; while (e->ex_class == Oper && e->OP_LEFT) e = e->OP_LEFT; @@ -347,7 +347,7 @@ new_oper(tp, e1, oper, e2) } else if (e1) { - register struct expr *e = e1; + struct expr *e = e1; while (e->ex_class == Oper && e->OP_RIGHT) e = e->OP_RIGHT; @@ -382,7 +382,7 @@ new_oper(tp, e1, oper, e2) } chk_cst_expr(expp) - register struct expr **expp; + struct expr **expp; { /* The expression expr is checked for constancy. @@ -411,9 +411,9 @@ chk_cst_expr(expp) constant expressions and is indeed rejected by the Ritchie compiler. */ - register struct expr *expr = *expp; - register int fund = expr->ex_type->tp_fund; - register int flags = expr->ex_flags; + struct expr *expr = *expp; + int fund = expr->ex_type->tp_fund; + int flags = expr->ex_flags; int err = 0; #ifdef DEBUG @@ -443,7 +443,7 @@ chk_cst_expr(expp) } init_expression(eppp, expr) - register struct expr ***eppp, *expr; + struct expr ***eppp, *expr; { /* The expression expr is added to the tree designated indirectly by **eppp. @@ -463,7 +463,7 @@ init_expression(eppp, expr) int is_ld_cst(expr) - register struct expr *expr; + struct expr *expr; { /* An expression is a `load-time constant' if it is of the form +/- or . @@ -477,7 +477,7 @@ is_ld_cst(expr) int is_cp_cst(expr) - register struct expr *expr; + struct expr *expr; { /* An expression is a `compile-time constant' if it is a load-time constant, and the idf is not there. @@ -488,7 +488,7 @@ is_cp_cst(expr) #ifndef NOFLOAT int is_fp_cst(expr) - register struct expr *expr; + struct expr *expr; { /* An expression is a `floating-point constant' if it consists of the float only. @@ -498,7 +498,7 @@ is_fp_cst(expr) #endif /* NOFLOAT */ free_expression(expr) - register struct expr *expr; + struct expr *expr; { /* The expression expr is freed recursively. */ diff --git a/lang/cem/cemcom/expression.g b/lang/cem/cemcom/expression.g index 0c4ff26942..73ab9e8371 100644 --- a/lang/cem/cemcom/expression.g +++ b/lang/cem/cemcom/expression.g @@ -20,7 +20,7 @@ extern struct expr *intexpr(); } /* 7.1 */ -primary(register struct expr **expp;) : +primary(struct expr **expp;) : IDENTIFIER {dot2expr(expp);} | @@ -35,7 +35,7 @@ primary(register struct expr **expp;) : {(*expp)->ex_flags |= EX_PARENS;} ; -secundary(register struct expr **expp;) : +secundary(struct expr **expp;) : primary(expp) [ index_pack(expp) @@ -97,7 +97,7 @@ postfixed(struct expr **expp;) %first first_of_type_specifier, type_specifier; -unary(register struct expr **expp;) +unary(struct expr **expp;) {struct type *tp; int oper;} : %if (first_of_type_specifier(AHEAD) && AHEAD != IDENTIFIER) @@ -114,7 +114,7 @@ unary(register struct expr **expp;) size_of(expp) ; -size_of(register struct expr **expp;) +size_of(struct expr **expp;) {struct type *tp;} : SIZEOF @@ -287,7 +287,7 @@ binop(int *oper;) : {*oper = DOT;} ; -asgnop(register int *oper;): +asgnop(int *oper;): '=' {*oper = DOT;} | '+' '=' {*oper = PLUSAB;} diff --git a/lang/cem/cemcom/field.c b/lang/cem/cemcom/field.c index 91dc09106b..8ecdb22fc4 100644 --- a/lang/cem/cemcom/field.c +++ b/lang/cem/cemcom/field.c @@ -47,9 +47,9 @@ eval_field(expr, code) int code; { int op = expr->OP_OPER; - register struct expr *leftop = expr->OP_LEFT; - register struct expr *rightop = expr->OP_RIGHT; - register struct field *fd = leftop->ex_type->tp_field; + struct expr *leftop = expr->OP_LEFT; + struct expr *rightop = expr->OP_RIGHT; + struct field *fd = leftop->ex_type->tp_field; struct type *tp = leftop->ex_type->tp_up; arith tmpvar; struct type *atype = tp->tp_unsigned ? uword_type : word_type; @@ -166,7 +166,7 @@ eval_field(expr, code) retrieval) is on top of stack. */ if (atype->tp_unsigned == 0) { /* sign extension */ - register arith shift = asize * 8 - fd->fd_width; + arith shift = asize * 8 - fd->fd_width; C_loc(shift); C_sli(asize); diff --git a/lang/cem/cemcom/idf.c b/lang/cem/cemcom/idf.c index e02d6149ca..b70d5d465b 100644 --- a/lang/cem/cemcom/idf.c +++ b/lang/cem/cemcom/idf.c @@ -63,12 +63,12 @@ idf_hashed(tg, size, hc) The identifier has already been truncated to idfsize characters. */ - register struct idf **hook = &idf_hashtable[hc], *notch; + struct idf **hook = &idf_hashtable[hc], *notch; while ((notch = *hook)) { - register char *s1 = tg; - register char *cp = notch->id_text; - register int cmp; + char *s1 = tg; + char *cp = notch->id_text; + int cmp; while (!(cmp = (*s1 - *cp++))) { if (*s1++ == '\0') { @@ -102,11 +102,11 @@ idf_hashed(tg, size, hc) hash_stat() { if (options['h']) { - register int i; + int i; print("Hash table tally:\n"); for (i = 0; i < HASHSIZE; i++) { - register struct idf *notch = idf_hashtable[i]; + struct idf *notch = idf_hashtable[i]; int cnt = 0; while (notch) { @@ -130,12 +130,12 @@ str2idf(tg) but its hash value is not; otherwise idf_hashed() is to be used. */ - register char *cp = tg; - register int hash; - register int pos = -1; - register int ch; + char *cp = tg; + int hash; + int pos = -1; + int ch; char ntg[IDFSIZE + 1]; - register char *ncp = ntg; + char *ncp = ntg; hash = STARTHASH(); while (++pos < idfsize && (ch = *cp++)) { @@ -183,14 +183,14 @@ declare_idf(ds, dc, lvl) This routine implements the rich semantics of C declarations. */ - register struct idf *idf = dc->dc_idf; - register int sc = ds->ds_sc; + struct idf *idf = dc->dc_idf; + int sc = ds->ds_sc; /* This local copy is essential: char b(), c; makes b GLOBAL and c AUTO. */ - register struct def *def = idf->id_def; /* may be NULL */ - register struct type *type; + struct def *def = idf->id_def; /* may be NULL */ + struct type *type; struct stack_level *stl = stack_level_of(lvl); char formal_array = 0; @@ -334,7 +334,7 @@ declare_idf(ds, dc, lvl) declare_idf(ds, dc, L_GLOBAL); } else { /* fill in the def block */ - register struct def *newdef = new_def(); + struct def *newdef = new_def(); newdef->next = def; newdef->df_level = lvl; @@ -387,7 +387,7 @@ actual_declaration(sc, tp) { /* An actual_declaration needs space, right here and now. */ - register int fund = tp->tp_fund; + int fund = tp->tp_fund; if (sc == ENUM || sc == TYPEDEF) /* virtual declarations */ return 0; @@ -399,8 +399,8 @@ actual_declaration(sc, tp) } global_redecl(idf, new_sc, tp) - register struct idf *idf; - register struct type *tp; + struct idf *idf; + struct type *tp; { /* A global identifier may be declared several times, provided the declarations do not conflict; they might @@ -408,10 +408,10 @@ global_redecl(idf, new_sc, tp) an array) or they might conflict or supplement each other in storage class. */ - register struct def *def = idf->id_def; + struct def *def = idf->id_def; if (tp != def->df_type) { - register struct type *otp = def->df_type; + struct type *otp = def->df_type; if ( tp->tp_fund != ARRAY || otp->tp_fund != ARRAY || tp->tp_up != otp->tp_up ) { @@ -554,8 +554,8 @@ global_redecl(idf, new_sc, tp) int good_formal(def, idf) - register struct def *def; - register struct idf *idf; + struct def *def; + struct idf *idf; { /* Succeeds if def is a proper L_FORMAL1 definition and gives an error message otherwise. @@ -570,11 +570,11 @@ good_formal(def, idf) } declare_params(dc) - register struct declarator *dc; + struct declarator *dc; { /* Declares the formal parameters if they exist. */ - register struct formal *fm = dc->dc_formal; + struct formal *fm = dc->dc_formal; while (fm) { declare_parameter(fm->fm_idf); @@ -585,11 +585,11 @@ declare_params(dc) } init_idf(idf) - register struct idf *idf; + struct idf *idf; { /* The topmost definition of idf is set to initialized. */ - register struct def *def = idf->id_def; /* the topmost */ + struct def *def = idf->id_def; /* the topmost */ if (def->df_initialized) error("multiple initialization of %s", idf->id_text); @@ -627,7 +627,7 @@ declare_formals(fp) An address is assigned to each formal parameter. The total size of the formals is returned in *fp; */ - register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; + struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; arith f_offset = (arith)0; #ifdef DEBUG @@ -635,7 +635,7 @@ declare_formals(fp) dumpidftab("start declare_formals", 0); #endif /* DEBUG */ while (se) { - register struct def *def = se->se_idf->id_def; + struct def *def = se->se_idf->id_def; def->df_address = f_offset; /* the alignment convention for parameters is: align on @@ -699,12 +699,12 @@ add_def(idf, sc, tp, lvl) } update_ahead(idf) - register struct idf *idf; + struct idf *idf; { /* The tk_symb of the token ahead is updated in the light of new information about the identifier idf. */ - register int tk_symb = AHEAD; + int tk_symb = AHEAD; if ( (tk_symb == IDENTIFIER || tk_symb == TYPE_IDENTIFIER) && ahead.tk_idf == idf @@ -714,7 +714,7 @@ update_ahead(idf) } free_formals(fm) - register struct formal *fm; + struct formal *fm; { while (fm) { struct formal *tmp = fm->next; @@ -731,7 +731,7 @@ init_hmask() /* A simple congruence random number generator, as described in Knuth, vol 2. */ - register int h, rnd = HASH_X; + int h, rnd = HASH_X; for (h = 0; h < IDFSIZE; h++) { hmask[h] = rnd; diff --git a/lang/cem/cemcom/init.c b/lang/cem/cemcom/init.c index b7c855343f..253154cfeb 100644 --- a/lang/cem/cemcom/init.c +++ b/lang/cem/cemcom/init.c @@ -15,7 +15,7 @@ #include "idf.h" #include "interface.h" -PRIVATE struct mkey { +static struct mkey { char *mk_reserved; int mk_key; } mkey[] = { @@ -48,10 +48,10 @@ init_pp() id_resmac field of the identifier. */ { - register struct mkey *mk = &mkey[0]; + struct mkey *mk = &mkey[0]; while (mk->mk_reserved) { - register struct idf *idf = str2idf(mk->mk_reserved); + struct idf *idf = str2idf(mk->mk_reserved); if (idf->id_resmac) fatal("maximum identifier length insufficient"); diff --git a/lang/cem/cemcom/input.c b/lang/cem/cemcom/input.c index 0490142c04..c35ea4d727 100644 --- a/lang/cem/cemcom/input.c +++ b/lang/cem/cemcom/input.c @@ -28,9 +28,9 @@ extern char options[]; #endif char * getwdir(fn) - register char *fn; + char *fn; { - register char *p; + char *p; char *strrchr(); p = strrchr(fn, '/'); diff --git a/lang/cem/cemcom/interface.h b/lang/cem/cemcom/interface.h index 4967e557e8..87d2a49fae 100644 --- a/lang/cem/cemcom/interface.h +++ b/lang/cem/cemcom/interface.h @@ -3,6 +3,6 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ -#define PRIVATE static /* or not */ +#define static static /* or not */ #define IMPORT extern #define EXPORT diff --git a/lang/cem/cemcom/ival.g b/lang/cem/cemcom/ival.g index 016bbe6bb2..ad309fe1cf 100644 --- a/lang/cem/cemcom/ival.g +++ b/lang/cem/cemcom/ival.g @@ -51,7 +51,7 @@ struct e_stack *p_stack; Upto now, the initialisation of a union is not allowed! */ /* 7 */ -initial_value(register struct type **tpp; register struct expr **expp;) : +initial_value(struct type **tpp; struct expr **expp;) : { if (tpp) gen_tpcheck(tpp, 0); } [ assignment_expression(expp) @@ -91,9 +91,9 @@ initial_value_pack(struct type **tpp; struct expr **expp;) '}' ; -initial_value_list(register struct type **tpp; struct expr **expp;) +initial_value_list(struct type **tpp; struct expr **expp;) { struct expr *e1; - register struct type **tpp2 = 0; + struct type **tpp2 = 0; int err_flag = gen_error; } : @@ -114,7 +114,7 @@ initial_value_list(register struct type **tpp; struct expr **expp;) gen_tpcheck(tpp, union_allowed) struct type **tpp; { - register struct type *tp; + struct type *tp; if (gen_error) return; switch((tp = *tpp)->tp_fund) { @@ -145,7 +145,7 @@ gen_simple_exp(tpp, expp) struct type **tpp; struct expr **expp; { - register struct type *tp; + struct type *tp; if (gen_error) return; tp = *tpp; @@ -173,7 +173,7 @@ arr_elem(tpp, p) struct type **tpp; struct e_stack *p; { - register struct type *tp = *tpp; + struct type *tp = *tpp; if (tp->tp_up->tp_fund == CHAR && AHEAD == STRING && p->elem_count == 1) { p->nelem = 1; @@ -186,8 +186,8 @@ arr_elem(tpp, p) struct sdef * next_field(sd, p) - register struct sdef *sd; - register struct e_stack *p; + struct sdef *sd; + struct e_stack *p; { if (sd->sd_sdef) p->bytes_upto_here += zero_bytes(sd); @@ -201,9 +201,9 @@ struct type ** gen_tphead(tpp, nest) struct type **tpp; { - register struct type *tp = *tpp; - register struct e_stack *p; - register struct sdef *sd; + struct type *tp = *tpp; + struct e_stack *p; + struct sdef *sd; if (tpp && *tpp == error_type) { gen_error = pack_level; @@ -258,9 +258,9 @@ gen_tphead(tpp, nest) struct type ** gen_tpmiddle() { - register struct type *tp; - register struct sdef *sd; - register struct e_stack *p = p_stack; + struct type *tp; + struct sdef *sd; + struct e_stack *p = p_stack; if (gen_error) { if (p) return p->s_tpp; @@ -311,9 +311,9 @@ again: struct sdef * gen_align_to_next(p) - register struct e_stack *p; + struct e_stack *p; { - register struct sdef *sd = p->s_def; + struct sdef *sd = p->s_def; if (! sd) return sd; #ifndef NOBITFIELD @@ -330,9 +330,9 @@ gen_align_to_next(p) gen_tpend() { - register struct e_stack *p = p_stack; - register struct type *tp; - register struct sdef *sd; + struct e_stack *p = p_stack; + struct type *tp; + struct sdef *sd; int getout = 0; while (!getout && p) { @@ -381,7 +381,7 @@ check_and_pad(expp, tpp) struct type **tpp; struct expr **expp; { - register struct type *tp = *tpp; + struct type *tp = *tpp; if (tp->tp_fund == ARRAY) { check_and_pad(expp, &(tp->tp_up)); /* first member */ @@ -391,7 +391,7 @@ check_and_pad(expp, tpp) */ tp = *tpp = construct_type(ARRAY, tp->tp_up, (arith)1); else { - register int dim = tp->tp_size / tp->tp_up->tp_size; + int dim = tp->tp_size / tp->tp_up->tp_size; /* pad remaining members with zeroes */ while (--dim > 0) pad(tp->tp_up); @@ -399,7 +399,7 @@ check_and_pad(expp, tpp) } else if (tp->tp_fund == STRUCT) { - register struct sdef *sd = tp->tp_sdef; + struct sdef *sd = tp->tp_sdef; check_and_pad(expp, &(sd->sd_type)); /* next selector is aligned by adding extra zeroes */ @@ -421,8 +421,8 @@ check_and_pad(expp, tpp) pad(tpx) struct type *tpx; { - register struct type *tp = tpx; - register arith sz = tp->tp_size; + struct type *tp = tpx; + arith sz = tp->tp_size; gen_tpcheck(&tpx, 1); if (gen_error) return; @@ -460,7 +460,7 @@ pad(tpx) of this straightforward function. */ check_ival(expp, tp) - register struct type *tp; + struct type *tp; struct expr **expp; { /* The philosophy here is that ch7cast puts an explicit @@ -468,7 +468,7 @@ check_ival(expp, tp) are not compatible. In this case, the initialisation expression is no longer a constant. */ - register struct expr *expr = *expp; + struct expr *expr = *expp; switch (tp->tp_fund) { case CHAR: @@ -489,7 +489,7 @@ check_ival(expp, tp) con_int(expr); else if (expr->VL_CLASS == Name) { - register struct idf *idf = expr->VL_IDF; + struct idf *idf = expr->VL_IDF; if (idf->id_def->df_level >= L_LOCAL) illegal_init_cst(expr); @@ -568,9 +568,9 @@ ch_array(tpp, ex) struct type **tpp; /* type tp = array of characters */ struct expr *ex; { - register struct type *tp = *tpp; - register int length = ex->SG_LEN, i; - register char *to, *from, *s; + struct type *tp = *tpp; + int length = ex->SG_LEN, i; + char *to, *from, *s; ASSERT(ex->ex_class == String); if (tp->tp_size == (arith)-1) { @@ -602,8 +602,8 @@ ch_array(tpp, ex) constants, string constants are written out in chunks */ str_cst(str, len) - register char *str; - register int len; + char *str; + int len; { int chunksize = ((127 + (int) word_size) / (int) word_size) * (int) word_size; @@ -629,8 +629,8 @@ put_bf(tp, val) { static long field = (arith)0; static arith offset = (arith)-1; - register struct field *fd = tp->tp_field; - register struct sdef *sd = fd->fd_sdef; + struct field *fd = tp->tp_field; + struct sdef *sd = fd->fd_sdef; static struct expr exp; ASSERT(sd); @@ -655,14 +655,14 @@ put_bf(tp, val) int zero_bytes(sd) - register struct sdef *sd; + struct sdef *sd; { /* fills the space between a selector of a struct and the next selector of that struct with zero-bytes. */ - register int n = sd->sd_sdef->sd_offset - sd->sd_offset - + int n = sd->sd_sdef->sd_offset - sd->sd_offset - size_of_type(sd->sd_type, "struct member"); - register int count = n; + int count = n; while (n-- > 0) con_nullbyte(); @@ -682,9 +682,9 @@ valid_type(tp, str) } con_int(ex) - register struct expr *ex; + struct expr *ex; { - register struct type *tp = ex->ex_type; + struct type *tp = ex->ex_type; ASSERT(is_cp_cst(ex)); if (tp->tp_unsigned) diff --git a/lang/cem/cemcom/l_comment.c b/lang/cem/cemcom/l_comment.c index da9d2b7762..15c41bff81 100644 --- a/lang/cem/cemcom/l_comment.c +++ b/lang/cem/cemcom/l_comment.c @@ -25,15 +25,15 @@ extern char loptions[]; one token later. */ -PRIVATE int notreached; -PRIVATE int varargsN = -1; -PRIVATE int argsused; -PRIVATE int formatN; -PRIVATE int formatVAR; -PRIVATE char *format; -PRIVATE char *prev_format; +static int notreached; +static int varargsN = -1; +static int argsused; +static int formatN; +static int formatVAR; +static char *format; +static char *prev_format; -PRIVATE make_format(); +static make_format(); int LINTLIB; /* file is lint library */ int s_NOTREACHED; /* statement not reached */ @@ -74,8 +74,8 @@ lint_comment_function() formatVAR = 0; } -PRIVATE char buf[1000]; -PRIVATE char *bufpos; /* next free position in buf */ +static char buf[1000]; +static char *bufpos; /* next free position in buf */ lint_start_comment() { @@ -119,7 +119,7 @@ lint_end_comment() } else if (strncmp(bufpos, "FORMAT", 6) == 0 && isdigit(bufpos[6])) { - register int argn; + int argn; bufpos += 6; argn = *bufpos++ - '0'; @@ -142,13 +142,13 @@ lint_end_comment() #define LETGIT 1 #define LETGITSPACE 2 -PRIVATE +static make_format(argn, oldf) int argn; char *oldf; { - register char *newf; - register int last_stat; + char *newf; + int last_stat; while (*oldf && *oldf != '$') { oldf++; @@ -176,7 +176,7 @@ make_format(argn, oldf) last_stat = NONE; while (*oldf && *oldf != '$') { - register char ch = *oldf++; + char ch = *oldf++; if (isspace(ch)) { if (last_stat == LETGIT) diff --git a/lang/cem/cemcom/l_ev_ord.c b/lang/cem/cemcom/l_ev_ord.c index 4aff2b4902..8f8a0e3502 100644 --- a/lang/cem/cemcom/l_ev_ord.c +++ b/lang/cem/cemcom/l_ev_ord.c @@ -31,7 +31,7 @@ -PRIVATE check_ev_order(); +static check_ev_order(); check_and_merge(expr, espp, esp) struct expr *expr; @@ -42,7 +42,7 @@ check_and_merge(expr, espp, esp) * united. * *espp will be pointing to this new list. esp is used for this list. */ - register struct expr_state **pp, *p1, *p2; + struct expr_state **pp, *p1, *p2; int oper = expr->OP_OPER; int is_sequencer = (oper == '?' || oper == OR || oper == AND || oper ==','); @@ -90,7 +90,7 @@ check_and_merge(expr, espp, esp) esp->next = p1; } -PRIVATE +static check_ev_order(esp1, esp2, expr) struct expr_state *esp1, *esp2; struct expr *expr; diff --git a/lang/cem/cemcom/l_lint.c b/lang/cem/cemcom/l_lint.c index d7dd43916a..e95c994d1c 100644 --- a/lang/cem/cemcom/l_lint.c +++ b/lang/cem/cemcom/l_lint.c @@ -34,13 +34,13 @@ extern char options[128]; -PRIVATE struct expr_state *expr2state(); -PRIVATE struct expr_state *value2state(); -PRIVATE struct expr_state *oper2state(); -PRIVATE expr_ignored(); -PRIVATE add_expr_state(); -PRIVATE referred_esp(); -PRIVATE free_expr_states(); +static struct expr_state *expr2state(); +static struct expr_state *value2state(); +static struct expr_state *oper2state(); +static expr_ignored(); +static add_expr_state(); +static referred_esp(); +static free_expr_states(); lint_init() { @@ -52,16 +52,16 @@ lint_expr(expr, used) struct expr *expr; int used; /* USED or IGNORED */ { - register struct expr_state *esp; + struct expr_state *esp; esp = expr2state(expr, RVAL, used); referred_esp(esp); free_expr_states(esp); } -PRIVATE struct expr_state * +static struct expr_state * expr2state(expr, val, used) - register struct expr *expr; + struct expr *expr; int val; /* RVAL or LVAL */ int used; /* USED or IGNORED */ { @@ -89,7 +89,7 @@ expr2state(expr, val, used) } } -PRIVATE struct expr_state * +static struct expr_state * value2state(expr, val) struct expr *expr; int val; /* RVAL or LVAL */ @@ -101,7 +101,7 @@ value2state(expr, val) case Name: { - register struct idf *idf = expr->VL_IDF; + struct idf *idf = expr->VL_IDF; struct expr_state *esp = 0; if (!idf || !idf->id_def) @@ -135,15 +135,15 @@ value2state(expr, val) 4. set the result of the LHS to SET, if it is a named variable */ -PRIVATE struct expr_state * +static struct expr_state * oper2state(expr, val, used) struct expr *expr; int val; /* RVAL or LVAL */ int used; /* USED or IGNORED */ { - register int oper = expr->OP_OPER; - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; + int oper = expr->OP_OPER; + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; struct expr_state *esp_l = 0; struct expr_state *esp_r = 0; @@ -201,7 +201,7 @@ oper2state(expr, val, used) case '(': if (right != 0) { /* function call with parameters */ - register struct expr *ex = right; + struct expr *ex = right; while ( ex->ex_class == Oper && ex->OP_OPER == PARCOMMA @@ -285,7 +285,7 @@ oper2state(expr, val, used) } } -PRIVATE +static expr_ignored(expr) struct expr *expr; { @@ -360,12 +360,12 @@ expr_ignored(expr) } } -PRIVATE +static add_expr_state(value, to_state, espp) struct value value; struct expr_state **espp; { - register struct expr_state *esp = *espp; + struct expr_state *esp = *espp; ASSERT(value.vl_class == Name); @@ -404,7 +404,7 @@ add_expr_state(value, to_state, espp) } } -PRIVATE +static referred_esp(esp) struct expr_state *esp; { @@ -421,12 +421,12 @@ referred_esp(esp) } } -PRIVATE +static free_expr_states(esp) - register struct expr_state *esp; + struct expr_state *esp; { while (esp) { - register struct expr_state *esp2 = esp; + struct expr_state *esp2 = esp; esp = esp->next; free_expr_state(esp2); diff --git a/lang/cem/cemcom/l_misc.c b/lang/cem/cemcom/l_misc.c index 1a25b19f86..9a5443e80f 100644 --- a/lang/cem/cemcom/l_misc.c +++ b/lang/cem/cemcom/l_misc.c @@ -30,9 +30,9 @@ extern struct type *func_type; -PRIVATE lint_enum_arith(); -PRIVATE lint_conversion(); -PRIVATE int numsize(); +static lint_enum_arith(); +static lint_conversion(); +static int numsize(); check_hiding(idf, lvl, sc) struct idf *idf; @@ -70,13 +70,13 @@ lint_new_oper(expr) I am not sure we have covered the entire ground, we'll leave the contracting for some rainy day. */ - register struct expr *left = expr->OP_LEFT; - register struct expr *right = expr->OP_RIGHT; - register int oper = expr->OP_OPER; - register int l_fund = + struct expr *left = expr->OP_LEFT; + struct expr *right = expr->OP_RIGHT; + int oper = expr->OP_OPER; + int l_fund = left == 0 ? 0 : /* for monadics */ left->ex_type->tp_fund; - register int r_fund = + int r_fund = right == 0 ? 0 : /* for ( without parameters */ right->ex_type->tp_fund; @@ -243,7 +243,7 @@ lint_new_oper(expr) } } -PRIVATE +static lint_enum_arith(l_fund, oper, r_fund) int l_fund, oper, r_fund; { @@ -266,12 +266,12 @@ lint_enum_arith(l_fund, oper, r_fund) } } -PRIVATE +static lint_conversion(from_expr, to_fund) struct expr *from_expr; int to_fund; { - register int from_fund = from_expr->ex_type->tp_fund; + int from_fund = from_expr->ex_type->tp_fund; /* was there an attempt to reduce the type of the from_expr of the form @@ -302,7 +302,7 @@ lint_conversion(from_expr, to_fund) } } -PRIVATE int +static int numsize(fund) { switch (fund) { diff --git a/lang/cem/cemcom/l_outdef.c b/lang/cem/cemcom/l_outdef.c index 2b50c4948e..dffabfa7e8 100644 --- a/lang/cem/cemcom/l_outdef.c +++ b/lang/cem/cemcom/l_outdef.c @@ -42,22 +42,22 @@ extern char *strchr(); int stat_number = 9999; /* static scope number */ struct outdef OutDef; -PRIVATE struct outdef OutCall; +static struct outdef OutCall; -PRIVATE local_EFDC(); -PRIVATE output_def(); -PRIVATE outargs(); -PRIVATE outarg(); -PRIVATE outargstring(); -PRIVATE outargtype(); -PRIVATE add_expr_arg(); +static local_EFDC(); +static output_def(); +static outargs(); +static outarg(); +static outargstring(); +static outargtype(); +static add_expr_arg(); lint_declare_idf(idf, sc) struct idf *idf; int sc; { - register struct def *def = idf->id_def; - register int is_function = def->df_type->tp_fund == FUNCTION; + struct def *def = idf->id_def; + int is_function = def->df_type->tp_fund == FUNCTION; if (level == L_GLOBAL) { lint_ext_def(idf, sc); @@ -76,8 +76,8 @@ lint_non_function_decl(ds, dc) struct decspecs *ds; struct declarator *dc; { - register struct def *def = dc->dc_idf->id_def; - register int is_function = def->df_type->tp_fund == FUNCTION; + struct def *def = dc->dc_idf->id_def; + int is_function = def->df_type->tp_fund == FUNCTION; if (is_function) def2decl(ds->ds_sc); @@ -97,8 +97,8 @@ lint_ext_def(idf, sc) * The returns-field is known at the end of the function definition. * sc indicates the storage class defined by the declaration specifier. */ - register struct def *def = idf->id_def; - register struct type *type = def->df_type; + struct def *def = idf->id_def; + struct type *type = def->df_type; OutDef.od_name = idf->id_text; OutDef.od_statnr = (sc == STATIC ? stat_number : 0); @@ -141,7 +141,7 @@ set_od_valreturned(n) OutDef.od_valreturned = n; } -PRIVATE +static local_EFDC(idf) struct idf *idf; { @@ -162,13 +162,13 @@ lint_formals() /* Make a list of 'struct argument's containing the types of the formal * parameters of the function definition just parsed. */ - register struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; - register struct argument **hook = &OutDef.od_arg; - register int nrargs = 0; + struct stack_entry *se = stack_level_of(L_FORMAL1)->sl_entry; + struct argument **hook = &OutDef.od_arg; + int nrargs = 0; while (se) { - register struct type *type = se->se_idf->id_def->df_type; - register struct argument *arg = new_argument(); + struct type *type = se->se_idf->id_def->df_type; + struct argument *arg = new_argument(); /* Do the conversions on the formals that could not be done in declare_idf(). @@ -226,7 +226,7 @@ lint_formals() } while (nrargs < f_FORMATn) { - register struct argument *arg = new_argument(); + struct argument *arg = new_argument(); arg->ar_type = error_type; arg->ar_class = ArgFormal; @@ -235,7 +235,7 @@ lint_formals() nrargs++; } if (nrargs == f_FORMATn) { - register struct argument *arg = new_argument(); + struct argument *arg = new_argument(); arg->ar_type = string_type; arg->ar_class = ArgString; @@ -282,7 +282,7 @@ outcall() output_def(&OutCall); } -PRIVATE +static output_def(od) struct outdef *od; { @@ -303,7 +303,7 @@ output_def(od) case SFDF: /* remove 'struct argument's */ while (od->od_arg) { - register struct argument *tmp = od->od_arg; + struct argument *tmp = od->od_arg; od->od_arg = od->od_arg->next; free_argument(tmp); } @@ -351,13 +351,13 @@ output_def(od) printf(":%u:%s\n", od->od_line, od->od_file); } -PRIVATE +static outargs(arg, n) struct argument *arg; { /* Output the n arguments in the argument list and remove them */ - register struct argument *tmp; + struct argument *tmp; while (n--) { ASSERT(arg); @@ -374,7 +374,7 @@ outargs(arg, n) } } -PRIVATE +static outarg(arg) struct argument *arg; { @@ -413,12 +413,12 @@ outarg(arg) } } -PRIVATE +static outargstring(arg) struct argument *arg; { char buff[1000]; - register char *p; + char *p; bts2str(arg->CAS_VALUE, arg->CAS_LEN, buff); for (p = &buff[0]; *p; p++) { @@ -428,7 +428,7 @@ outargstring(arg) printf("\"%s\"", buff); } -PRIVATE +static outargtype(tp) struct type *tp; { @@ -484,7 +484,7 @@ outargtype(tp) } #ifdef IMPLICIT -PRIVATE +static implicit_func_decl(idf, file, line) struct idf *idf; char *file; @@ -507,8 +507,8 @@ fill_outcall(ex, used) struct expr *ex; int used; { - register struct idf *idf = ex->OP_LEFT->VL_IDF; - register struct def *def = idf->id_def; + struct idf *idf = ex->OP_LEFT->VL_IDF; + struct def *def = idf->id_def; #ifdef IMPLICIT if (def->df_sc == IMPLICIT && !idf->id_def->df_used) { @@ -538,11 +538,11 @@ fill_outcall(ex, used) OutCall.od_valused = used; /* USED, IGNORED or VOIDED */ } -PRIVATE +static add_expr_arg(e) struct expr *e; { - register struct argument *arg; + struct argument *arg; arg = new_argument(); arg->ar_type = e->ex_type; @@ -555,7 +555,7 @@ add_expr_arg(e) && e->VL_CLASS == Label ) { /* it may be a string; let's look it up */ - register struct string_cst *sc = str_list; + struct string_cst *sc = str_list; while (sc) { if (sc->sc_dlb == e->VL_LBL) diff --git a/lang/cem/cemcom/l_states.c b/lang/cem/cemcom/l_states.c index e0bc3dd013..593a443ef2 100644 --- a/lang/cem/cemcom/l_states.c +++ b/lang/cem/cemcom/l_states.c @@ -47,34 +47,34 @@ extern char loptions[]; extern struct stack_level *local_level; /* global variables for the lint_stack */ -PRIVATE struct lint_stack_entry *top_ls; +static struct lint_stack_entry *top_ls; /* global variables for the brace stack */ -PRIVATE int brace_count; -PRIVATE struct brace *top_br; +static int brace_count; +static struct brace *top_br; /* global variables for the function return */ -PRIVATE int valreturned; /* see l_lint.h */ -PRIVATE int return_warned; - -PRIVATE end_brace(); -PRIVATE lint_1_local(); -PRIVATE lint_1_global(); -PRIVATE start_loop_stmt(); -PRIVATE check_autos(); -PRIVATE struct auto_def *copy_auto_list(); -PRIVATE free_auto_list(); -PRIVATE struct state *copy_state(); -PRIVATE Free_state(); -PRIVATE remove_settings(); -PRIVATE struct auto_def *merge_autos(); -PRIVATE merge_states(); -PRIVATE struct lint_stack_entry *find_wdf(), *find_wdfc(), *find_cs(); -PRIVATE cont_merge(); -PRIVATE break_merge(); -PRIVATE struct lint_stack_entry *mk_lint_stack_entry(); -PRIVATE lint_push(); -PRIVATE lint_pop(); +static int valreturned; /* see l_lint.h */ +static int return_warned; + +static end_brace(); +static lint_1_local(); +static lint_1_global(); +static start_loop_stmt(); +static check_autos(); +static struct auto_def *copy_auto_list(); +static free_auto_list(); +static struct state *copy_state(); +static Free_state(); +static remove_settings(); +static struct auto_def *merge_autos(); +static merge_states(); +static struct lint_stack_entry *find_wdf(), *find_wdfc(), *find_cs(); +static cont_merge(); +static break_merge(); +static struct lint_stack_entry *mk_lint_stack_entry(); +static lint_push(); +static lint_pop(); lint_init_stack() { @@ -86,7 +86,7 @@ lint_init_stack() lint_start_local() { - register struct brace *br = new_brace(); + struct brace *br = new_brace(); dbg_lint_stack("lint_start_local"); brace_count++; @@ -116,19 +116,19 @@ lint_end_local(stl) end_brace(stl); } -PRIVATE +static end_brace(stl) struct stack_level *stl; { /* Check if static variables and labels are used and/or set. Automatic vars have already been checked by check_autos(). */ - register struct stack_entry *se = stl->sl_entry; - register struct brace *br; + struct stack_entry *se = stl->sl_entry; + struct brace *br; while (se) { - register struct idf *idf = se->se_idf; - register struct def *def = idf->id_def; + struct idf *idf = se->se_idf; + struct def *def = idf->id_def; if (def) { lint_1_local(idf, def); @@ -142,12 +142,12 @@ end_brace(stl) free_brace(br); } -PRIVATE +static lint_1_local(idf, def) struct idf *idf; struct def *def; { - register int sc = def->df_sc; + int sc = def->df_sc; if ( (sc == STATIC || sc == LABEL) && !def->df_used @@ -164,7 +164,7 @@ lint_1_local(idf, def) && def->df_minlevel != level && !is_anon_idf(idf) ) { - register int diff = def->df_minlevel - level; + int diff = def->df_minlevel - level; def_warning(def, "local %s could be declared %d level%s deeper", @@ -176,13 +176,13 @@ lint_1_local(idf, def) lint_end_global(stl) struct stack_level *stl; { - register struct stack_entry *se = stl->sl_entry; + struct stack_entry *se = stl->sl_entry; dbg_lint_stack("lint_end_global"); ASSERT(level == L_GLOBAL); while (se) { - register struct idf *idf = se->se_idf; - register struct def *def = idf->id_def; + struct idf *idf = se->se_idf; + struct def *def = idf->id_def; if (def) { lint_1_global(idf, def); @@ -191,13 +191,13 @@ lint_end_global(stl) } } -PRIVATE +static lint_1_global(idf, def) struct idf *idf; struct def *def; { - register int sc = def->df_sc; - register int fund = def->df_type->tp_fund; + int sc = def->df_sc; + int fund = def->df_type->tp_fund; switch (sc) { case STATIC: @@ -237,7 +237,7 @@ lint_1_global(idf, def) } } if (loptions['x']) { - register char *fn = def->df_file; + char *fn = def->df_file; if ( (sc == EXTERN || sc == GLOBAL) && def->df_alloc == 0 @@ -267,8 +267,8 @@ change_state(idf, to_state) * on top of the stack. * The fields in the def-descriptor are set too. */ - register struct def *def = idf->id_def; - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct def *def = idf->id_def; + struct auto_def *a = top_ls->ls_current->st_auto_list; ASSERT(def); @@ -287,7 +287,7 @@ change_state(idf, to_state) def->df_minlevel = level; } else { - register struct brace *br = top_br; + struct brace *br = top_br; /* find the smallest brace range from which firstbrace is visible @@ -329,16 +329,16 @@ change_state(idf, to_state) add_auto(idf) /* to current state on top of lint_stack */ struct idf *idf; { -/* Check if idf's definition is really an auto (or register). +/* Check if idf's definition is really an auto (or ). * It could be a static or extern too. * Watch out for formal parameters. */ - register struct def *def = idf->id_def; + struct def *def = idf->id_def; ASSERT(def); switch (def->df_sc) { - register struct auto_def *a; + struct auto_def *a; case AUTO: case REGISTER: if (def->df_level < L_LOCAL) @@ -356,13 +356,13 @@ add_auto(idf) /* to current state on top of lint_stack */ } } -PRIVATE +static check_autos() { /* Before leaving a block, remove the auto_defs of the automatic * variables on this level and check if they are used */ - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct auto_def *a = top_ls->ls_current->st_auto_list; ASSERT(!(a && a->ad_def->df_level > level)); while (a && a->ad_def->df_level == level) { @@ -383,7 +383,7 @@ check_autos() } { /* free a */ - register struct auto_def *aux = a; + struct auto_def *aux = a; a = a->next; free_auto_def(aux); } @@ -393,12 +393,12 @@ check_autos() lint_end_formals() { - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; dbg_lint_stack("lint_end_formals"); ASSERT(level == L_FORMAL1); while (se) { - register struct def *def = se->se_idf->id_def; + struct def *def = se->se_idf->id_def; if ( (def && !def->df_used) && !(f_ARGSUSED || LINTLIB) @@ -411,13 +411,13 @@ lint_end_formals() } } -PRIVATE struct auto_def * +static struct auto_def * copy_auto_list(from_al, lvl) struct auto_def *from_al; int lvl; { struct auto_def *start = 0; - register struct auto_def **hook = &start; + struct auto_def **hook = &start; /* skip too high levels */ while (from_al && from_al->ad_def->df_level > lvl) { @@ -425,7 +425,7 @@ copy_auto_list(from_al, lvl) } while (from_al) { - register struct auto_def *a = new_auto_def(); + struct auto_def *a = new_auto_def(); *hook = a; *a = *from_al; @@ -436,18 +436,18 @@ copy_auto_list(from_al, lvl) return start; } -PRIVATE +static free_auto_list(a) - register struct auto_def *a; + struct auto_def *a; { while (a) { - register struct auto_def *aux = a; + struct auto_def *aux = a; a = a->next; free_auto_def(aux); } } -PRIVATE struct state * +static struct state * copy_state(from_st, lvl) struct state *from_st; int lvl; @@ -455,7 +455,7 @@ copy_state(from_st, lvl) /* Memory for the struct state and the struct auto_defs is allocated * by this function */ - register struct state *st = new_state(); + struct state *st = new_state(); st->st_auto_list = copy_auto_list(from_st->st_auto_list, lvl); st->st_notreached = from_st->st_notreached; @@ -463,7 +463,7 @@ copy_state(from_st, lvl) return st; } -PRIVATE +static Free_state(stp) struct state **stp; { @@ -474,7 +474,7 @@ Free_state(stp) *stp = 0; } -PRIVATE +static remove_settings(st, lvl) struct state *st; int lvl; @@ -482,7 +482,7 @@ remove_settings(st, lvl) /* The states of all variables on this level are set to 'not set' and * 'not maybe set'. (I think you have to read this twice.) */ - register struct auto_def *a = st->st_auto_list; + struct auto_def *a = st->st_auto_list; while (a && a->ad_def->df_level == lvl) { a->ad_set = a->ad_maybe_set = 0; @@ -498,7 +498,7 @@ remove_settings(st, lvl) #define CASE_BREAK 1 #define USE_ONLY 2 -PRIVATE +static merge_states(st1, st2, lvl, mode) struct state *st1, *st2; int lvl; @@ -519,7 +519,7 @@ merge_states(st1, st2, lvl, mode) } else if (st2->st_notreached) { - register struct auto_def *tmp = st2->st_auto_list; + struct auto_def *tmp = st2->st_auto_list; st2->st_auto_list = copy_auto_list(st1->st_auto_list, lvl); st2->st_notreached = 0; @@ -536,7 +536,7 @@ merge_states(st1, st2, lvl, mode) } } -PRIVATE struct auto_def * +static struct auto_def * merge_autos(a1, a2, lvl, mode) struct auto_def *a1, *a2; int lvl; @@ -560,7 +560,7 @@ merge_autos(a1, a2, lvl, mode) * Variables used in a1 become used in a2. * The rest of the result is not changed. */ - register struct auto_def *a; + struct auto_def *a; /* skip too local entries */ while (a1 && a1->ad_def->df_level > lvl) { @@ -569,7 +569,7 @@ merge_autos(a1, a2, lvl, mode) /* discard too local entries */ while (a2 && a2->ad_def->df_level > lvl) { - register struct auto_def *aux = a2; + struct auto_def *aux = a2; a2 = a2->next; free_auto_def(aux); } @@ -611,10 +611,10 @@ merge_autos(a1, a2, lvl, mode) * The letters mean : w: WHILE; d: DO; f: FOR; s: SWITCH; c: CASE. */ -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_wdf() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -628,10 +628,10 @@ find_wdf() return 0; } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_wdfc() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -646,10 +646,10 @@ find_wdfc() return 0; } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * find_cs() { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; while (lse) { switch (lse->ls_class) { @@ -666,7 +666,7 @@ find_cs() start_if_part(cst) { - register struct lint_stack_entry *new = mk_lint_stack_entry(IF); + struct lint_stack_entry *new = mk_lint_stack_entry(IF); dbg_lint_stack("start_if_part"); if (cst) @@ -760,12 +760,12 @@ start_for_stmt(expr) } } -PRIVATE +static start_loop_stmt(looptype, cst, cond) { /* If cst, the condition is a constant and its value is cond */ - register struct lint_stack_entry *new = mk_lint_stack_entry(looptype); + struct lint_stack_entry *new = mk_lint_stack_entry(looptype); dbg_lint_stack("start_loop_stmt"); if (cst && !cond) { @@ -798,7 +798,7 @@ start_loop_stmt(looptype, cst, cond) end_loop_body() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_loop_body"); ASSERT(lse == top_ls); @@ -808,7 +808,7 @@ end_loop_body() end_loop_stmt() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_loop_stmt"); ASSERT(lse == top_ls); @@ -831,7 +831,7 @@ end_loop_stmt() end_do_stmt(cst, cond) { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("end_do_stmt"); if (cst && !cond) { @@ -845,7 +845,7 @@ end_do_stmt(cst, cond) lint_continue_stmt() { - register struct lint_stack_entry *lse = find_wdf(); + struct lint_stack_entry *lse = find_wdf(); dbg_lint_stack("lint_continue_stmt"); if (!lse) @@ -865,7 +865,7 @@ start_switch_part(cst) * following case parts. (Needed for variables declared in a compound * switch-block.) */ - register struct lint_stack_entry *new = mk_lint_stack_entry(SWITCH); + struct lint_stack_entry *new = mk_lint_stack_entry(SWITCH); dbg_lint_stack("start_switch_part"); if (cst) @@ -927,7 +927,7 @@ end_switch_stmt() lint_case_stmt(dflt) { /* A default statement is just a special case statement */ - register struct lint_stack_entry *cs_entry = find_cs(); + struct lint_stack_entry *cs_entry = find_cs(); dbg_lint_stack("lint_case_stmt"); if (!cs_entry) @@ -940,7 +940,7 @@ lint_case_stmt(dflt) } switch (cs_entry->ls_class) { - register struct lint_stack_entry *new; + struct lint_stack_entry *new; case SWITCH: if (dflt) { @@ -977,7 +977,7 @@ lint_case_stmt(dflt) lint_break_stmt() { - register struct lint_stack_entry *lse = find_wdfc(); + struct lint_stack_entry *lse = find_wdfc(); dbg_lint_stack("lint_break_stmt"); if (!lse) @@ -1023,7 +1023,7 @@ lint_break_stmt() top_ls->ls_current->st_warned = 0; } -PRIVATE +static cont_merge(lse) struct lint_stack_entry *lse; { @@ -1037,7 +1037,7 @@ cont_merge(lse) } } -PRIVATE +static break_merge(lse) struct lint_stack_entry *lse; { @@ -1097,7 +1097,7 @@ lint_return_stmt(e) dbg_lint_stack("lint_return_stmt"); if (valreturned == NORETURN) { /* first return met */ - register int fund = func_type->tp_fund; + int fund = func_type->tp_fund; if ( e == NOVALRETURNED && !func_notypegiven @@ -1149,7 +1149,7 @@ lint_label() be done. So we assume that the user knows what he is doing and set all automatic variables to set. */ - register struct auto_def *a = top_ls->ls_current->st_auto_list; + struct auto_def *a = top_ls->ls_current->st_auto_list; dbg_lint_stack("lint_label"); while (a) { @@ -1189,14 +1189,14 @@ lint_statement() } } -PRIVATE struct lint_stack_entry * +static struct lint_stack_entry * mk_lint_stack_entry(cl) int cl; { /* Prepare a new stack entry for the lint_stack with class cl. Copy the top ls_current to this entry and set its level. */ - register struct lint_stack_entry *new = new_lint_stack_entry(); + struct lint_stack_entry *new = new_lint_stack_entry(); new->ls_class = cl; new->ls_current = copy_state(top_ls->ls_current, level); @@ -1205,7 +1205,7 @@ mk_lint_stack_entry(cl) return new; } -PRIVATE +static lint_push(lse) struct lint_stack_entry *lse; { @@ -1214,7 +1214,7 @@ lint_push(lse) top_ls = lse; } -PRIVATE +static lint_pop() { top_ls = top_ls->ls_previous; @@ -1224,7 +1224,7 @@ lint_pop() #ifdef DEBUG /* FOR DEBUGGING */ -PRIVATE +static print_autos(a) struct auto_def *a; { @@ -1242,7 +1242,7 @@ print_autos(a) } } -PRIVATE +static pr_lint_state(nm, st) char *nm; struct state *st; @@ -1261,7 +1261,7 @@ pr_lint_state(nm, st) print_lint_stack(msg) char *msg; { - register struct lint_stack_entry *lse = top_ls; + struct lint_stack_entry *lse = top_ls; print("Lint stack: %s(level=%d)\n", msg, level); while (lse) { diff --git a/lang/cem/cemcom/label.c b/lang/cem/cemcom/label.c index f37916098c..120d0a2695 100644 --- a/lang/cem/cemcom/label.c +++ b/lang/cem/cemcom/label.c @@ -17,7 +17,7 @@ extern char options[]; enter_label(idf, defining) - register struct idf *idf; + struct idf *idf; { /* The identifier idf is entered as a label. If it is new, it is entered into the idf list with the largest possible @@ -25,7 +25,7 @@ enter_label(idf, defining) If defining, the label comes from a label statement. */ if (idf->id_def) { - register struct def *def = idf->id_def; + struct def *def = idf->id_def; if (def->df_sc == LABEL) { if (defining && def->df_initialized) @@ -42,7 +42,7 @@ enter_label(idf, defining) if (def->df_level == level) /* but alas, no */ error("%s is not a label", idf->id_text); else { - register int lvl = def->df_level + 1; + int lvl = def->df_level + 1; #ifndef NOROPTION if (options['R'] && def->df_level > L_LOCAL) @@ -65,7 +65,7 @@ enter_label(idf, defining) } unstack_label(idf) - register struct idf *idf; + struct idf *idf; { /* The scope in which the label idf occurred is left. */ diff --git a/lang/cem/cemcom/main.c b/lang/cem/cemcom/main.c index 9297cfda1a..a66ed19886 100644 --- a/lang/cem/cemcom/main.c +++ b/lang/cem/cemcom/main.c @@ -147,10 +147,10 @@ extern char *strrchr(); list_dependencies(source) char *source; { - register struct idf *p = file_head; + struct idf *p = file_head; if (source) { - register char *s = strrchr(source, '.'); + char *s = strrchr(source, '.'); if (s && *(s+1)) { s++; @@ -179,7 +179,7 @@ char *source; add_dependency(s) char *s; { - register struct idf *p = str2idf(s); + struct idf *p = str2idf(s); if (! p->id_resmac) { p->id_resmac = K_FILE; @@ -211,7 +211,7 @@ compile(argc, argv) { char *result; #ifndef LINT - register char *destination = 0; + char *destination = 0; #endif /* LINT */ #ifdef DEBUG @@ -382,7 +382,7 @@ init() } init_specials(si) - register struct sp_id *si; + struct sp_id *si; { while (si->si_identifier) { struct idf *idf = str2idf(si->si_identifier); diff --git a/lang/cem/cemcom/mcomm.c b/lang/cem/cemcom/mcomm.c index b54c076e83..e299a05b4d 100644 --- a/lang/cem/cemcom/mcomm.c +++ b/lang/cem/cemcom/mcomm.c @@ -81,8 +81,8 @@ readfile(filename, psiz) int *psiz; { struct stat stbuf; /* for `stat' to get filesize */ - register int fd; /* filedescriptor for `filename' */ - register char *cbuf; /* pointer to buffer to be returned */ + int fd; /* filedescriptor for `filename' */ + char *cbuf; /* pointer to buffer to be returned */ if (((fd = open(filename, 0)) < 0) || (fstat(fd, &stbuf) != 0)) return 0; @@ -99,7 +99,7 @@ int writefile(filename, text, size) char *filename, *text; { - register fd; + fd; if ((fd = open(filename, 1)) < 0) return 0; @@ -133,10 +133,10 @@ insert(ptree, id) struct node **ptree; char *id; { - register cmp; + cmp; if (*ptree == 0) { - register struct node *nnode = new_node(); + struct node *nnode = new_node(); nnode->name = id; nnode->left = nnode->right = 0; @@ -155,7 +155,7 @@ find(tree, id) struct node *tree; char *id; { - register cmp; + cmp; if (tree == 0) return 0; @@ -170,10 +170,10 @@ edit(text, tree) char *text; struct node *tree; { - register char *ptr = text; + char *ptr = text; char idbuf[IDFSIZE]; - register char *id; - register char *save_ptr; + char *id; + char *save_ptr; while (*ptr) { if ( diff --git a/lang/cem/cemcom/options.c b/lang/cem/cemcom/options.c index 62e3dc9f65..f150ed5dbb 100644 --- a/lang/cem/cemcom/options.c +++ b/lang/cem/cemcom/options.c @@ -49,7 +49,7 @@ static int txt2int(); do_option(text) char *text; { - register char opt; + char opt; next_option: /* to allow combined one-char options */ switch (opt = *text++) { @@ -136,7 +136,7 @@ deleted, is now a debug-flag case 'D' : { /* -Dname : predefine name */ #ifndef NOPP - register char *cp = text, *name, *mactext; + char *cp = text, *name, *mactext; if (class(*cp) != STIDF) { error("identifier missing in -D%s", text); @@ -185,7 +185,7 @@ deleted, is now a debug-flag #ifndef NOPP if (*text) { int i; - register char *new = text; + char *new = text; if (++inc_total > inc_max) { inctable = (char **) @@ -248,7 +248,7 @@ deleted, is now a debug-flag case 'U' : { /* -Uname : undefine predefined */ #ifndef NOPP - register struct idf *idef; + struct idf *idef; if (*text) { if ((idef = str2idf(text))->id_macro) { @@ -269,7 +269,7 @@ deleted, is now a debug-flag break; #else /* NOCROSS */ { - register arith sz, algn; + arith sz, algn; char c; while (c = *text++) { @@ -357,12 +357,12 @@ deleted, is now a debug-flag static int txt2int(tp) - register char **tp; + char **tp; { /* the integer pointed to by *tp is read, while increasing *tp; the resulting value is yielded. */ - register int val = 0, ch; + int val = 0, ch; while (ch = **tp, ch >= '0' && ch <= '9') { val = val * 10 + ch - '0'; diff --git a/lang/cem/cemcom/program.g b/lang/cem/cemcom/program.g index 7e748da0eb..394cd3cfc5 100644 --- a/lang/cem/cemcom/program.g +++ b/lang/cem/cemcom/program.g @@ -76,7 +76,7 @@ control_if_expression constant_expression(&exprX) { #ifndef NOPP - register struct expr *expr = exprX; + struct expr *expr = exprX; if (expr->ex_flags & EX_SIZEOF) expr_error(expr, "sizeof not allowed in preprocessor"); @@ -151,7 +151,7 @@ ext_decl_specifiers(struct decspecs *ds;) : {do_decspecs(ds);} ; -non_function(register struct decspecs *ds; register struct declarator *dc;) +non_function(struct decspecs *ds; struct declarator *dc;) : {reject_params(dc);} [ @@ -177,7 +177,7 @@ function(struct decspecs *ds; struct declarator *dc;) arith fbytes; } : - { register struct idf *idf = dc->dc_idf; + { struct idf *idf = dc->dc_idf; #ifdef LINT lint_start_function(); #endif /* LINT */ diff --git a/lang/cem/cemcom/replace.c b/lang/cem/cemcom/replace.c index c4e6e4f04c..9061073169 100644 --- a/lang/cem/cemcom/replace.c +++ b/lang/cem/cemcom/replace.c @@ -29,15 +29,15 @@ char *strcpy(), *strcat(); char *long2str(); extern int InputLevel; -PRIVATE struct mlist *ReplaceList; /* list of currently active macros */ +static struct mlist *ReplaceList; /* list of currently active macros */ -PRIVATE macro_func(); -PRIVATE char *macro2buffer(); +static macro_func(); +static char *macro2buffer(); extern char **getactuals(); EXPORT int replace(idef) - register struct idf *idef; + struct idf *idef; { /* replace() is called by the lexical analyzer to perform macro replacement. "idef" is the description of the @@ -48,9 +48,9 @@ replace(idef) replace() returns 1 if the replacement succeeded and 0 if some error has occurred. */ - register struct macro *mac = idef->id_macro; - register struct mlist *repl; - register int c; + struct macro *mac = idef->id_macro; + struct mlist *repl; + int c; char **actpars; char *reptext; int size; @@ -138,16 +138,16 @@ replace(idef) GSTATIC char FilNamBuf[PATHLENGTH]; -PRIVATE +static macro_func(idef) - register struct idf *idef; + struct idf *idef; { /* macro_func() performs the special actions needed with some macros. These macros are __FILE__ and __LINE__ which replacement texts must be evaluated at the time they are used. */ - register struct macro *mac = idef->id_macro; + struct macro *mac = idef->id_macro; switch (idef->id_text[2]) { /* This switch is very blunt... */ case 'F' : /* __FILE__ */ @@ -167,7 +167,7 @@ macro_func(idef) } } -PRIVATE char * +static char * macro2buffer(idef, actpars, siztext) struct idf *idef; char **actpars; @@ -183,15 +183,15 @@ macro2buffer(idef, actpars, siztext) If there are no parameters, this function behaves the same as strcpy(). */ - register int size = 8; - register char *text = Malloc(size); - register int pos = 0; - register char *ptr = idef->id_macro->mc_text; + int size = 8; + char *text = Malloc(size); + int pos = 0; + char *ptr = idef->id_macro->mc_text; while (*ptr) { if (*ptr & FORMALP) { /* non-asc formal param. mark */ - register int n = *ptr++ & 0177; - register char *p; + int n = *ptr++ & 0177; + char *p; ASSERT(n != 0); /* copy the text of the actual parameter @@ -223,7 +223,7 @@ DoUnstack() EXPORT EnableMacros() { - register struct mlist *p = ReplaceList, *prev = 0; + struct mlist *p = ReplaceList, *prev = 0; ASSERT(Unstacked > 0); while (p) { diff --git a/lang/cem/cemcom/scan.c b/lang/cem/cemcom/scan.c index 66dfcd13da..0012cee0a6 100644 --- a/lang/cem/cemcom/scan.c +++ b/lang/cem/cemcom/scan.c @@ -26,24 +26,24 @@ #define EOS '\0' #define overflow() (fatal("actual parameter buffer overflow")) -PRIVATE char apbuf[LAPBUF]; /* temporary storage for actual parameters */ -PRIVATE char *actparams[NPARAMS]; /* pointers to the text of the actuals */ -PRIVATE char *aptr; /* pointer to last inserted character in apbuf */ +static char apbuf[LAPBUF]; /* temporary storage for actual parameters */ +static char *actparams[NPARAMS]; /* pointers to the text of the actuals */ +static char *aptr; /* pointer to last inserted character in apbuf */ #define copy(ch) ((aptr < &apbuf[LAPBUF]) ? (*aptr++ = ch) : overflow()) -PRIVATE int nr_of_params; /* number of actuals read until now */ +static int nr_of_params; /* number of actuals read until now */ -PRIVATE copyact(); +static copyact(); char ** getactuals(idef) - register struct idf *idef; + struct idf *idef; { /* getactuals() collects the actual parameters and turns them into a list of strings, a pointer to which is returned. */ - register acnt = idef->id_macro->mc_nps; + acnt = idef->id_macro->mc_nps; nr_of_params = 0; actparams[0] = aptr = &apbuf[0]; @@ -53,7 +53,7 @@ getactuals(idef) if (!nr_of_params++) { /* 0 or 1 parameter */ /* there could be a ( ) */ - register char *p = actparams[0]; + char *p = actparams[0]; while ((class(*p) == STSKIP) || (*p == '\n')) { ++p; @@ -81,7 +81,7 @@ getactuals(idef) return actparams; } -PRIVATE +static copyact(ch1, ch2, lvl) char ch1, ch2; int lvl; @@ -98,8 +98,8 @@ copyact(ch1, ch2, lvl) Opening bracket is ch1, closing bracket is ch2. If lvl != 0, copy opening and closing parameters too. */ - register int ch; /* Current char */ - register int match; /* used to read strings */ + int ch; /* Current char */ + int match; /* used to read strings */ if (lvl) { copy(ch1); diff --git a/lang/cem/cemcom/skip.c b/lang/cem/cemcom/skip.c index 2b1dd7ee61..e63c72d9e7 100644 --- a/lang/cem/cemcom/skip.c +++ b/lang/cem/cemcom/skip.c @@ -15,12 +15,12 @@ #ifndef NOPP int skipspaces(ch, skipnl) - register int ch; + int ch; { /* skipspaces() skips any white space and returns the first non-space character. */ - register int nlseen = 0; + int nlseen = 0; for (;;) { while (class(ch) == STSKIP) { @@ -64,12 +64,12 @@ skipline() is seen, not escaped by a '\\'. Any comment is skipped. */ - register int c; + int c; LoadChar(c); while (class(c) != STNL && c != EOI) { if (class(c) == STSTR || class(c) == STCHAR) { - register int stopc = c; + int stopc = c; int escaped; do { escaped = 0; diff --git a/lang/cem/cemcom/stab.c b/lang/cem/cemcom/stab.c index 4c9d84ad97..f95f12f4f2 100644 --- a/lang/cem/cemcom/stab.c +++ b/lang/cem/cemcom/stab.c @@ -74,7 +74,7 @@ adds_db_str(s) static stb_type(tp) - register struct type *tp; + struct type *tp; { char buf[128]; static int stb_count; @@ -148,10 +148,10 @@ stb_type(tp) } addc_db_str('e'); { - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; while (se) { - register struct def *edef = se->se_idf->id_def; + struct def *edef = se->se_idf->id_def; while (edef) { if (edef->df_type == tp && edef->df_sc == ENUM) { @@ -182,7 +182,7 @@ stb_type(tp) tp->tp_fund == STRUCT ? 's' : 'u', tp->tp_size)); { - register struct sdef *sdef = tp->tp_sdef; + struct sdef *sdef = tp->tp_sdef; while (sdef) { adds_db_str(sdef->sd_idf->id_text); @@ -213,7 +213,7 @@ stb_type(tp) } stb_tag(tg, str) - register struct tag *tg; + struct tag *tg; char *str; { create_db_str(); @@ -230,7 +230,7 @@ stb_tag(tg, str) } stb_typedef(tp, str) - register struct type *tp; + struct type *tp; char *str; { create_db_str(); @@ -247,10 +247,10 @@ stb_typedef(tp, str) } stb_string(df, kind, str) - register struct def *df; + struct def *df; char *str; { - register struct type *tp = df->df_type; + struct type *tp = df->df_type; create_db_str(); adds_db_str(str); diff --git a/lang/cem/cemcom/stack.c b/lang/cem/cemcom/stack.c index 073683d2ba..aa45e9d026 100644 --- a/lang/cem/cemcom/stack.c +++ b/lang/cem/cemcom/stack.c @@ -49,8 +49,8 @@ int level; /* Always equal to local_level->sl_level. */ stack_level() { /* A new level is added on top of the identifier stack. */ - register struct stack_level *stl = new_stack_level(); - register struct stack_level *loclev = local_level; + struct stack_level *stl = new_stack_level(); + struct stack_level *loclev = local_level; loclev->sl_next = stl; stl->sl_previous = loclev; @@ -64,11 +64,11 @@ stack_level() { stack_idf(idf, stl) struct idf *idf; - register struct stack_level *stl; + struct stack_level *stl; { /* The identifier idf is inserted in the stack on level stl. */ - register struct stack_entry *se = new_stack_entry(); + struct stack_entry *se = new_stack_entry(); /* link it into the stack level */ se->next = stl->sl_entry; @@ -83,7 +83,7 @@ stack_level_of(lvl) The stack should probably be an array, to be extended with realloc where needed. */ - register struct stack_level *stl; + struct stack_level *stl; if (lvl == level) return local_level; @@ -113,11 +113,11 @@ unstack_level() necessary. Optimists may optimize it afterwards. */ while (local_level->sl_entry) { - register struct stack_entry *se = local_level->sl_entry; - register struct idf *idf = se->se_idf; - register struct def *def; - register struct sdef *sdef; - register struct tag *tag; + struct stack_entry *se = local_level->sl_entry; + struct idf *idf = se->se_idf; + struct def *def; + struct sdef *sdef; + struct tag *tag; /* unlink it from the local stack level */ local_level->sl_entry = se->next; @@ -179,7 +179,7 @@ unstack_world() have already been encoded while the uninitialised ones are not and have to be encoded at this moment. */ - register struct stack_entry *se = local_level->sl_entry; + struct stack_entry *se = local_level->sl_entry; #ifdef LINT lint_end_global(local_level); @@ -188,8 +188,8 @@ unstack_world() open_name_list(); while (se) { - register struct idf *idf = se->se_idf; - register struct def *def = idf->id_def; + struct idf *idf = se->se_idf; + struct def *def = idf->id_def; if (!def) { /* global selectors, etc. */ diff --git a/lang/cem/cemcom/stb.c b/lang/cem/cemcom/stb.c index 0a98e6725c..a9579347f6 100644 --- a/lang/cem/cemcom/stb.c +++ b/lang/cem/cemcom/stb.c @@ -6,7 +6,7 @@ /* library routine for copying structs */ __stb(n, f, t) - register char *f, *t; register n; + char *f, *t; n; { if (n > 0) do diff --git a/lang/cem/cemcom/struct.c b/lang/cem/cemcom/struct.c index c51ecda20f..85967b3804 100644 --- a/lang/cem/cemcom/struct.c +++ b/lang/cem/cemcom/struct.c @@ -54,9 +54,9 @@ int lcm(); */ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */ - register struct type *stp; /* type of the structure */ + struct type *stp; /* type of the structure */ struct type *tp; /* type of the selector */ - register struct idf *idf; /* idf of the selector */ + struct idf *idf; /* idf of the selector */ struct sdef ***sdefpp; /* address of hook to selector definition */ arith *szp; /* pointer to struct size upto here */ struct field *fd; @@ -74,7 +74,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */ struct tag *tg = stp->tp_idf->id_struct; /* or union */ struct sdef *sdef = idf->id_sdef; - register struct sdef *newsdef; + struct sdef *newsdef; int lvl = tg->tg_level; #ifndef NOROPTION @@ -167,13 +167,13 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */ } check_selector(idf, stp) - register struct idf *idf; + struct idf *idf; struct type *stp; /* the type of the struct */ { /* checks if idf occurs already as a selector in struct or union *stp. */ - register struct sdef *sdef = stp->tp_sdef; + struct sdef *sdef = stp->tp_sdef; while (sdef) { if (sdef->sd_idf == idf) @@ -185,7 +185,7 @@ check_selector(idf, stp) char *symbol2str(); declare_struct(fund, idf, tpp) - register struct idf *idf; + struct idf *idf; struct type **tpp; { /* A struct, union or enum (depending on fund) with tag (!) @@ -194,8 +194,8 @@ declare_struct(fund, idf, tpp) The idf may be missing (i.e. idf == 0), in which case an anonymous struct etc. is defined. */ - register struct tag **tgp; - register struct tag *tg; + struct tag **tgp; + struct tag *tg; if (!idf) idf = gen_idf(); @@ -265,7 +265,7 @@ declare_struct(fund, idf, tpp) } apply_struct(fund, idf, tpp) - register struct idf *idf; + struct idf *idf; struct type **tpp; { /* The occurrence of a struct, union or enum (depending on @@ -273,7 +273,7 @@ apply_struct(fund, idf, tpp) declared before. Its type (complete or incomplete) is returned in *tpp. */ - register struct tag **tgp; + struct tag **tgp; tgp = (is_struct_or_union(fund) ? &idf->id_struct : &idf->id_enum); @@ -285,7 +285,7 @@ apply_struct(fund, idf, tpp) struct sdef * idf2sdef(idf, tp) - register struct idf *idf; + struct idf *idf; struct type *tp; { /* The identifier idf is identified as a selector, preferably @@ -294,7 +294,7 @@ idf2sdef(idf, tp) If the attempt fails, a selector of type error_type is created. */ - register struct sdef **sdefp = &idf->id_sdef, *sdef; + struct sdef **sdefp = &idf->id_sdef, *sdef; /* Follow chain from idf, to meet tp. */ while ((sdef = *sdefp)) { @@ -329,7 +329,7 @@ idf2sdef(idf, tp) int uniq_selector(idf_sdef) - register struct sdef *idf_sdef; + struct sdef *idf_sdef; { /* Returns true if idf_sdef (which is guaranteed to exist) is unique for this level, i.e there is no other selector @@ -339,7 +339,7 @@ uniq_selector(idf_sdef) case! */ - register struct sdef *sdef = idf_sdef->next; + struct sdef *sdef = idf_sdef->next; while (sdef && sdef->sd_level == idf_sdef->sd_level) { if ( sdef->sd_type != idf_sdef->sd_type @@ -356,10 +356,10 @@ uniq_selector(idf_sdef) arith add_field(szp, fd, fdtpp, idf, stp) arith *szp; /* size of struct upto here */ - register struct field *fd; /* bitfield, containing width */ - register struct type **fdtpp; /* type of selector */ + struct field *fd; /* bitfield, containing width */ + struct type **fdtpp; /* type of selector */ struct idf *idf; /* name of selector */ - register struct type *stp; /* current struct descriptor */ + struct type *stp; /* current struct descriptor */ { /* The address where this selector is put is returned. If the selector with specified width does not fit in the word, or @@ -468,7 +468,7 @@ add_field(szp, fd, fdtpp, idf, stp) /* some utilities */ int is_struct_or_union(fund) - register int fund; + int fund; { return fund == STRUCT || fund == UNION; } @@ -477,9 +477,9 @@ is_struct_or_union(fund) */ int gcd(m, n) - register int m, n; + int m, n; { - register int r; + int r; while (n) { r = m % n; @@ -493,7 +493,7 @@ gcd(m, n) */ int lcm(m, n) - register int m, n; + int m, n; { return m * (n / gcd(m, n)); } diff --git a/lang/cem/cemcom/switch.c b/lang/cem/cemcom/switch.c index 279581d62c..011edcd55d 100644 --- a/lang/cem/cemcom/switch.c +++ b/lang/cem/cemcom/switch.c @@ -57,9 +57,9 @@ code_startswitch(expp) /* Check the expression, stack a new case header and fill in the necessary fields. */ - register label l_table = text_label(); - register label l_break = text_label(); - register struct switch_hdr *sh = new_switch_hdr(); + label l_table = text_label(); + label l_break = text_label(); + struct switch_hdr *sh = new_switch_hdr(); int fund = any2arith(expp, SWITCH); /* INT, LONG or DOUBLE */ switch (fund) { @@ -96,9 +96,9 @@ code_startswitch(expp) code_endswitch() { - register struct switch_hdr *sh = switch_stack; - register label tablabel; - register struct case_entry *ce; + struct switch_hdr *sh = switch_stack; + label tablabel; + struct case_entry *ce; if (sh->sh_default == 0) /* no default occurred yet */ sh->sh_default = sh->sh_break; @@ -113,7 +113,7 @@ code_endswitch() C_rom_ilb(sh->sh_default); if (compact(sh->sh_nrofentries, sh->sh_lowerbd, sh->sh_upperbd)) { /* CSA */ - register arith val; + arith val; C_rom_cst(sh->sh_lowerbd); C_rom_cst(sh->sh_upperbd - sh->sh_lowerbd); @@ -144,7 +144,7 @@ code_endswitch() C_df_ilb(sh->sh_break); switch_stack = sh->next; /* unstack the switch descriptor */ for (ce = sh->sh_entries; ce;) { /* free allocated switch structure */ - register struct case_entry *tmp = ce->next; + struct case_entry *tmp = ce->next; free_case_entry(ce); ce = tmp; @@ -156,9 +156,9 @@ code_endswitch() code_case(expr) struct expr *expr; { - register arith val; - register struct case_entry *ce; - register struct switch_hdr *sh = switch_stack; + arith val; + struct case_entry *ce; + struct switch_hdr *sh = switch_stack; ASSERT(is_cp_cst(expr)); if (sh == 0) { @@ -178,7 +178,7 @@ code_case(expr) sh->sh_nrofentries = 1; } else { /* second etc. case entry; put ce into proper place */ - register struct case_entry *c1 = sh->sh_entries, *c2 = 0; + struct case_entry *c1 = sh->sh_entries, *c2 = 0; if (val < sh->sh_lowerbd) sh->sh_lowerbd = val; @@ -223,7 +223,7 @@ code_case(expr) code_default() { - register struct switch_hdr *sh = switch_stack; + struct switch_hdr *sh = switch_stack; if (sh == 0) { error("default statement not in switch"); diff --git a/lang/cem/cemcom/tokenname.c b/lang/cem/cemcom/tokenname.c index e7de2557f5..170dff5fc3 100644 --- a/lang/cem/cemcom/tokenname.c +++ b/lang/cem/cemcom/tokenname.c @@ -131,7 +131,7 @@ struct tokenname tkfunny[] = { /* internal keywords */ #endif /* ____ */ reserve(resv) - register struct tokenname resv[]; + struct tokenname resv[]; { /* The names of the tokens described in resv are entered as reserved words. diff --git a/lang/cem/cemcom/type.c b/lang/cem/cemcom/type.c index d7c8548907..0ab9c384df 100644 --- a/lang/cem/cemcom/type.c +++ b/lang/cem/cemcom/type.c @@ -46,7 +46,7 @@ create_type(fund) /* A brand new struct type is created, and its tp_fund set to fund. */ - register struct type *ntp = new_type(); + struct type *ntp = new_type(); ntp->tp_fund = fund; ntp->tp_size = (arith)-1; @@ -56,13 +56,13 @@ create_type(fund) struct type * construct_type(fund, tp, count) - register struct type *tp; + struct type *tp; arith count; /* for fund == ARRAY only */ { /* fund must be a type constructor: FIELD, FUNCTION, POINTER or ARRAY. The pointer to the constructed type is returned. */ - register struct type *dtp; + struct type *dtp; switch (fund) { #ifndef NOBITFIELD @@ -106,9 +106,9 @@ construct_type(fund, tp, count) struct type * function_of(tp) - register struct type *tp; + struct type *tp; { - register struct type *dtp = tp->tp_function; + struct type *dtp = tp->tp_function; if (!dtp) { tp->tp_function = dtp = create_type(FUNCTION); @@ -121,9 +121,9 @@ function_of(tp) struct type * pointer_to(tp) - register struct type *tp; + struct type *tp; { - register struct type *dtp = tp->tp_pointer; + struct type *dtp = tp->tp_pointer; if (!dtp) { tp->tp_pointer = dtp = create_type(POINTER); @@ -137,10 +137,10 @@ pointer_to(tp) struct type * array_of(tp, count) - register struct type *tp; + struct type *tp; arith count; { - register struct type *dtp = tp->tp_array; + struct type *dtp = tp->tp_array; /* look for a type with the right size */ while (dtp && dtp->tp_size != count) @@ -160,9 +160,9 @@ array_of(tp, count) #ifndef NOBITFIELD struct type * field_of(tp) - register struct type *tp; + struct type *tp; { - register struct type *dtp = create_type(FIELD); + struct type *dtp = create_type(FIELD); dtp->tp_up = tp; dtp->tp_align = tp->tp_align; @@ -194,7 +194,7 @@ idf2type(idf, tpp) prevent garbage at the initialisation of arrays with unknown size. */ - register struct type *tp = idf->id_def->df_type; + struct type *tp = idf->id_def->df_type; if ( tp->tp_size < (arith)0 && tp->tp_fund == ARRAY) { *tpp = new_type(); @@ -218,7 +218,7 @@ struct type * standard_type(fund, sgn, algn, sz) int algn; arith sz; { - register struct type *tp = create_type(fund); + struct type *tp = create_type(fund); tp->tp_unsigned = sgn; tp->tp_align = algn; diff --git a/lang/cem/cemcom/util.c b/lang/cem/cemcom/util.c index a364248fbc..8cf07c1390 100644 --- a/lang/cem/cemcom/util.c +++ b/lang/cem/cemcom/util.c @@ -54,7 +54,7 @@ arith LocalSpace(sz, al) arith sz; { - register struct stack_level *stl = local_level; + struct stack_level *stl = local_level; stl->sl_max_block = - align(sz - stl->sl_max_block, al); return stl->sl_max_block; @@ -67,9 +67,9 @@ arith NewLocal(sz, al, regtype, sc) arith sz; { - register struct localvar *tmp = FreeTmps; + struct localvar *tmp = FreeTmps; struct localvar *prev = 0; - register int index; + int index; while (tmp) { if (tmp->t_align >= al && @@ -104,7 +104,7 @@ FreeLocal(off) arith off; { int index = (int) (off >> 2) & (TABSIZ - 1); - register struct localvar *tmp = regs[index]; + struct localvar *tmp = regs[index]; struct localvar *prev = 0; while (tmp && tmp->t_offset != off) { @@ -121,8 +121,8 @@ FreeLocal(off) LocalFinish() { - register struct localvar *tmp, *tmp1; - register int i; + struct localvar *tmp, *tmp1; + int i; #ifdef USE_TMP C_beginpart(loc_id); @@ -166,7 +166,7 @@ LocalFinish() RegisterAccount(offset, size, regtype, sc) arith offset, size; { - register struct localvar *p; + struct localvar *p; int index; if (regtype < 0) return; @@ -186,7 +186,7 @@ static struct localvar * find_reg(off) arith off; { - register struct localvar *p = regs[(int)(off >> 2) & (TABSIZ - 1)]; + struct localvar *p = regs[(int)(off >> 2) & (TABSIZ - 1)]; while (p && p->t_offset != off) p = p->next; return p; @@ -195,7 +195,7 @@ find_reg(off) LoadLocal(off, sz) arith off, sz; { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); #ifdef USE_TMP #ifdef REGCOUNT @@ -214,7 +214,7 @@ LoadLocal(off, sz) StoreLocal(off, sz) arith off, sz; { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); #ifdef USE_TMP #ifdef REGCOUNT @@ -234,7 +234,7 @@ StoreLocal(off, sz) AddrLocal(off) arith off; { - register struct localvar *p = find_reg(off); + struct localvar *p = find_reg(off); if (p) p->t_regtype = -1; C_lal(off); diff --git a/lang/cem/cpp.ansi/LLlex.c b/lang/cem/cpp.ansi/LLlex.c index 5fa78d109a..58218f7e5a 100644 --- a/lang/cem/cpp.ansi/LLlex.c +++ b/lang/cem/cpp.ansi/LLlex.c @@ -42,8 +42,8 @@ extern int InputLevel; /* # of current macro expansions */ static arith char_constant(char*); static char* string_token(char*, int); -static int quoted(register int); -static int val_in_base(register int, int); +static int quoted(int); +static int val_in_base(int, int); static int trigraph(void); int LLlex(void) @@ -51,7 +51,7 @@ int LLlex(void) return (DOT != EOF) ? GetToken(&dot) : EOF; } -int GetToken(register struct token* ptok) +int GetToken(struct token* ptok) { /* GetToken() is the actual token recognizer. It calls the control line interpreter if it encounters a "\n{w}*#" @@ -59,7 +59,7 @@ int GetToken(register struct token* ptok) needed. */ char buf[BUFFERSIZE]; - register int ch, nch; + int ch, nch; again: /* rescan the input after an error or replacement */ ch = GetChar(); @@ -218,8 +218,8 @@ int GetToken(register struct token* ptok) case STIDF: { extern int idfsize; /* ??? */ - register char* tg = &buf[0]; - register char* maxpos = &buf[idfsize]; + char* tg = &buf[0]; + char* maxpos = &buf[idfsize]; int NoExpandNext = 0; #define tstmac(bx) \ @@ -278,7 +278,7 @@ int GetToken(register struct token* ptok) *tg++ = '\0'; /* mark the end of the identifier */ if (ReplaceMacros) { - register struct idf* idef = findidf(buf); + struct idf* idef = findidf(buf); if (idef && idef->id_macro && !NoExpandNext) { @@ -310,8 +310,8 @@ int GetToken(register struct token* ptok) } case STNUM: /* a numeric constant */ { /* it may only be an integer constant */ - register int base = 10, vch; - register arith val = 0; + int base = 10, vch; + arith val = 0; int ovfl = 0; arith ubound = max_arith / (base / 2); @@ -405,7 +405,7 @@ void skipcomment(void) EOI is returned by LoadChar only on encountering EOF of the top-level file... */ - register int c; + int c; NoUnstack++; c = GetChar(); @@ -448,8 +448,8 @@ void skiplinecomment(void) static arith char_constant(char* nm) { - register arith val = 0; - register int ch; + arith val = 0; + int ch; int size = 0; ch = GetChar(); @@ -482,10 +482,10 @@ static arith char_constant(char* nm) static char* string_token(char* nm, int stop_char) { - register int ch; - register int str_size; - register char* str = Malloc((unsigned)(str_size = ISTRSIZE)); - register int pos = 0; + int ch; + int str_size; + char* str = Malloc((unsigned)(str_size = ISTRSIZE)); + int pos = 0; ch = GetChar(); while (ch != stop_char) @@ -513,7 +513,7 @@ static char* string_token(char* nm, int stop_char) return str; } -static int quoted(register int ch) +static int quoted(int ch) { /* quoted() replaces an escaped character sequence by the character meant. @@ -546,8 +546,8 @@ static int quoted(register int ch) break; case 'x': /* quoted hex */ { - register int hex = 0; - register int vch; + int hex = 0; + int vch; for (;;) { @@ -563,7 +563,7 @@ static int quoted(register int ch) } else { /* a quoted octal */ - register int oct = 0, cnt = 0; + int oct = 0, cnt = 0; do { @@ -576,7 +576,7 @@ static int quoted(register int ch) return ch & 0377; } -static int val_in_base(register int ch, int base) +static int val_in_base(int ch, int base) { switch (base) { @@ -597,7 +597,7 @@ int GetChar(void) /* The routines GetChar and trigraph parses the trigraph sequences and removes occurences of \\\n. */ - register int ch; + int ch; static bool atnewline = true; again: @@ -646,7 +646,7 @@ int GetChar(void) static int trigraph(void) { - register int ch; + int ch; LoadChar(ch); if (ch == '?') diff --git a/lang/cem/cpp.ansi/LLlex.h b/lang/cem/cpp.ansi/LLlex.h index 41d9c6895b..d589b416e7 100644 --- a/lang/cem/cpp.ansi/LLlex.h +++ b/lang/cem/cpp.ansi/LLlex.h @@ -50,7 +50,7 @@ extern int err_occurred; /* "error.c" */ /* Public function declarations */ extern int LLlex(void); -extern int GetToken(register struct token* ptok); +extern int GetToken(struct token* ptok); extern void skipcomment(void); extern void skiplinecomment(void); /* Get next character input, with trigraph parsing and newline */ diff --git a/lang/cem/cpp.ansi/ch3bin.c b/lang/cem/cpp.ansi/ch3bin.c index 8caf9b3ffd..4a9b88cb65 100644 --- a/lang/cem/cpp.ansi/ch3bin.c +++ b/lang/cem/cpp.ansi/ch3bin.c @@ -11,7 +11,7 @@ #include "skip.h" #include "error.h" -void ch3bin(register arith *pval, int *pis_uns, int oper, register arith val, int is_uns) +void ch3bin(arith *pval, int *pis_uns, int oper, arith val, int is_uns) { if (is_uns) *pis_uns = 1; switch (oper) { diff --git a/lang/cem/cpp.ansi/ch3bin.h b/lang/cem/cpp.ansi/ch3bin.h index ba84e0937f..ed5f4af1d4 100644 --- a/lang/cem/cpp.ansi/ch3bin.h +++ b/lang/cem/cpp.ansi/ch3bin.h @@ -10,6 +10,6 @@ #include "arith.h" -void ch3bin(register arith *pval, int *pis_uns, int oper, register arith val, int is_uns); +void ch3bin(arith *pval, int *pis_uns, int oper, arith val, int is_uns); #endif /* CH3BIN_H_ */ diff --git a/lang/cem/cpp.ansi/ch3mon.c b/lang/cem/cpp.ansi/ch3mon.c index f4368242c5..45569f21a0 100644 --- a/lang/cem/cpp.ansi/ch3mon.c +++ b/lang/cem/cpp.ansi/ch3mon.c @@ -10,7 +10,7 @@ #include "arith.h" /*ARGSUSED2*/ -void ch3mon(int oper, register arith *pval, int *puns) +void ch3mon(int oper, arith *pval, int *puns) { switch (oper) { case '~': diff --git a/lang/cem/cpp.ansi/ch3mon.h b/lang/cem/cpp.ansi/ch3mon.h index fd715c4a38..832a874361 100644 --- a/lang/cem/cpp.ansi/ch3mon.h +++ b/lang/cem/cpp.ansi/ch3mon.h @@ -10,6 +10,6 @@ #include "arith.h" -void ch3mon(int oper, register arith *pval, int *puns); +void ch3mon(int oper, arith *pval, int *puns); #endif /* CH3MON_H_ */ diff --git a/lang/cem/cpp.ansi/domacro.c b/lang/cem/cpp.ansi/domacro.c index 80b1150858..92a21d6ba3 100644 --- a/lang/cem/cpp.ansi/domacro.c +++ b/lang/cem/cpp.ansi/domacro.c @@ -52,7 +52,7 @@ static int find_name(char*, char*[]); static char* get_text(char*[], int*); static int getparams(char*[], char[]); static int ifexpr(void); -static int macroeq(register char*, register char*); +static int macroeq(char*, char*); static void skip_block(int); static void do_error(void); @@ -90,7 +90,7 @@ char* GetIdentifier(int skiponerr /* skip the rest of the line on error */ void domacro(void) { struct token tk; /* the token itself */ - register struct idf* id; + struct idf* id; int toknum; ReplaceMacros = 0; @@ -182,8 +182,8 @@ static void skip_block(int to_endif) #ifndef or #elif until the corresponding #endif is seen. */ - register int ch; - register int skiplevel = nestlevel; /* current nesting level */ + int ch; + int skiplevel = nestlevel; /* current nesting level */ struct token tk; int toknum; struct idf* id; @@ -388,13 +388,13 @@ static void do_define(void) { /* do_define() interprets a #define control line. */ - register char* str; /* the #defined identifier's descriptor */ + char* str; /* the #defined identifier's descriptor */ int nformals = -1; /* keep track of the number of formals */ char* formals[NPARAMS]; /* pointers to the names of the formals */ char parbuf[PARBUFSIZE]; /* names of formals */ char* repl_text; /* start of the replacement text */ int length; /* length of the replacement text */ - register int ch; + int ch; /* read the #defined macro's name */ if (!(str = GetIdentifier(1))) @@ -498,8 +498,8 @@ static void do_if(void) static void do_ifdef(int how) { - register struct idf* id; - register char* str; + struct idf* id; + char* str; /* how == 1 : ifdef; how == 0 : ifndef */ @@ -530,8 +530,8 @@ static void do_ifdef(int how) /* argstr != NULL when the undef came from a -U option */ void do_undef(char* argstr) { - register struct idf* id; - register char* str = argstr; + struct idf* id; + char* str = argstr; /* Forget a macro definition. */ if (str || (str = GetIdentifier(1))) @@ -585,10 +585,10 @@ static int getparams(char* buf[], char parbuf[]) Note that the '(' has already been eaten. The names of the formal parameters are stored into parbuf. */ - register char** pbuf = &buf[0]; - register int c; - register char* ptr = &parbuf[0]; - register char** pbuf2; + char** pbuf = &buf[0]; + int c; + char* ptr = &parbuf[0]; + char** pbuf2; c = GetChar(); c = skipspaces(c, 0); @@ -646,9 +646,9 @@ static int getparams(char* buf[], char parbuf[]) UNREACHABLE_CODE; } -void macro_def(register struct idf* id, char* text, int nformals, int length, int flags) +void macro_def(struct idf* id, char* text, int nformals, int length, int flags) { - register struct macro* newdef = id->id_macro; + struct macro* newdef = id->id_macro; /* macro_def() puts the contents and information of a macro definition into a structure and stores it into the symbol @@ -669,7 +669,7 @@ void macro_def(register struct idf* id, char* text, int nformals, int length, in else { #ifdef DOBITS - register char* p = id->id_text; + char* p = id->id_text; #define setbit(bx) \ if (!*p) \ goto go_on; \ @@ -699,7 +699,7 @@ static int find_name(char* nm, char* index[]) "index" if it can be found there. 0 is returned if it is not there. */ - register char** ip = &index[0]; + char** ip = &index[0]; while (*ip) if (strcmp(nm, *ip++) == 0) @@ -734,9 +734,9 @@ static char* get_text(char* formals[], int* length) 4- comment, same as for 1 Other tokens will not be seen as such. */ - register int c; + int c; struct repl repls; - register struct repl* repl = &repls; + struct repl* repl = &repls; int blank = 0; c = GetChar(); @@ -754,7 +754,7 @@ static char* get_text(char* formals[], int* length) if (c == '\'' || c == '"') { - register int delim = c; + int delim = c; if (blank) { @@ -803,7 +803,7 @@ static char* get_text(char* formals[], int* length) else if (formals && (class(c) == STIDF || class(c) == STELL)) { char id_buf[IDFSIZE + 1]; - register char* idp = id_buf; + char* idp = id_buf; int n; /* read identifier: it may be a formal parameter */ @@ -884,7 +884,7 @@ static char* get_text(char* formals[], int* length) as strings, without taking care of the leading and trailing blanks (spaces and tabs). */ -static int macroeq(register char* s, register char* t) +static int macroeq(char* s, char* t) { /* skip leading spaces */ diff --git a/lang/cem/cpp.ansi/domacro.h b/lang/cem/cpp.ansi/domacro.h index f488f9b009..1c21a85db1 100644 --- a/lang/cem/cpp.ansi/domacro.h +++ b/lang/cem/cpp.ansi/domacro.h @@ -10,7 +10,7 @@ struct idf; -extern void macro_def(register struct idf* id, char* text, int nformals, int length, int flags); +extern void macro_def(struct idf* id, char* text, int nformals, int length, int flags); extern void do_undef(char* argstr); /* Control line interpreter. The '#' has already been read by the lexical analyzer by which this function is called. diff --git a/lang/cem/cpp.ansi/init.c b/lang/cem/cpp.ansi/init.c index a0aeb8f274..68b760e0c2 100644 --- a/lang/cem/cpp.ansi/init.c +++ b/lang/cem/cpp.ansi/init.c @@ -55,10 +55,10 @@ void init_pp(void) id_resmac field of the identifier. */ { - register struct mkey *mk = &mkey[0]; + struct mkey *mk = &mkey[0]; while (mk->mk_reserved) { - register struct idf *idf = str2idf(mk->mk_reserved, 0); + struct idf *idf = str2idf(mk->mk_reserved, 0); if (idf->id_resmac) fatal("maximum identifier length insufficient"); diff --git a/lang/cem/cpp.ansi/input.c b/lang/cem/cpp.ansi/input.c index 36a0afba90..52c71c3127 100644 --- a/lang/cem/cpp.ansi/input.c +++ b/lang/cem/cpp.ansi/input.c @@ -20,9 +20,9 @@ struct file_info finfo; #include #include -char* getwdir(register char* fn) +char* getwdir(char* fn) { - register char* p; + char* p; p = strrchr(fn, '/'); while (p && *(p + 1) == '\0') diff --git a/lang/cem/cpp.ansi/input.h b/lang/cem/cpp.ansi/input.h index f2634d9538..c5e18be9c3 100644 --- a/lang/cem/cpp.ansi/input.h +++ b/lang/cem/cpp.ansi/input.h @@ -17,5 +17,5 @@ extern int LexSave; /* last character read by GetChar */ * If there is just a filename and no path, it returns DOT e.g the current * directory. */ -char *getwdir(register char *fn); +char *getwdir(char *fn); diff --git a/lang/cem/cpp.ansi/main.c b/lang/cem/cpp.ansi/main.c index ce23f97dd9..1db525daf0 100644 --- a/lang/cem/cpp.ansi/main.c +++ b/lang/cem/cpp.ansi/main.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) void compile(int argc, char *argv[]) { - register char *source = 0; + char *source = 0; char *dummy; switch (argc) { @@ -111,10 +111,10 @@ struct idf *file_head; static void list_dependencies(char *source) { - register struct idf *p = file_head; + struct idf *p = file_head; if (source) { - register char *s = strrchr(source, '.'); + char *s = strrchr(source, '.'); if (s && *(s+1)) { s++; @@ -142,7 +142,7 @@ static void list_dependencies(char *source) void add_dependency(char *s) { - register struct idf *p = str2idf(s, 0); + struct idf *p = str2idf(s, 0); if (! p->id_resmac) { p->id_resmac = K_FILE; diff --git a/lang/cem/cpp.ansi/options.c b/lang/cem/cpp.ansi/options.c index ec6698aa4e..2771911dd8 100644 --- a/lang/cem/cpp.ansi/options.c +++ b/lang/cem/cpp.ansi/options.c @@ -61,7 +61,7 @@ void do_option(char *text) break; case 'D' : /* -Dname : predefine name */ { - register char *cp = text, *name, *mactext; + char *cp = text, *name, *mactext; unsigned maclen; if (class(*cp) != STIDF && class(*cp) != STELL) { @@ -89,8 +89,8 @@ void do_option(char *text) } case 'I' : /* -Ipath : insert "path" into include list */ if (*text) { - register int i; - register char *new = text; + int i; + char *new = text; if (++inc_total > inc_max) { inctable = (char **) @@ -134,8 +134,8 @@ static int txt2int(char **tp) /* the integer pointed to by *tp is read, while increasing *tp; the resulting value is yielded. */ - register int val = 0; - register int ch; + int val = 0; + int ch; while (ch = **tp, ch >= '0' && ch <= '9') { val = val * 10 + ch - '0'; diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index 9bd27b8347..828057f57f 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -51,11 +51,11 @@ static int pragma_nr; void do_pragma(void) { - register int size = ITEXTSIZE; + int size = ITEXTSIZE; char* cur_line = Malloc((unsigned)size); - register char* c_ptr = cur_line; - register int c = GetChar(); - register int delim = 0; + char* c_ptr = cur_line; + int c = GetChar(); + int delim = 0; while (c != '\n') { @@ -129,9 +129,9 @@ char Xbuf[256]; void preprocess(char *fn) { - register int c; - register char* op = _obuf; - register char* ob = &_obuf[OBUFSIZE]; + int c; + char* op = _obuf; + char* ob = &_obuf[OBUFSIZE]; int lineno = 0; int startline; @@ -155,7 +155,7 @@ void preprocess(char *fn) /* Generate a line directive communicating the source filename */ - register char* p = Xbuf; + char* p = Xbuf; sprint(p, "%s 1 \"%s\"\n", LINE_PREFIX, FileName); while (*p) @@ -171,7 +171,7 @@ void preprocess(char *fn) lineno = LineNumber; \ if (!options['P']) \ { \ - register char* p = Xbuf; \ + char* p = Xbuf; \ sprint(Xbuf, "%s %d \"%s\"\n", LINE_PREFIX, (int)LineNumber, FileName); \ op--; \ while (op >= _obuf && (class(*op) == STSKIP || *op == '\n')) \ @@ -196,13 +196,13 @@ void preprocess(char *fn) /* first flush the saved pragma's */ if (pragma_nr) { - register int i = 0; + int i = 0; int LiNo = LineNumber; char* FiNam = FileName; while (i < pragma_nr) { - register char* c_ptr = "#pragma"; + char* c_ptr = "#pragma"; LineNumber = pragma_tab[i].pr_linnr; FileName = pragma_tab[i].pr_fil; @@ -325,7 +325,7 @@ void preprocess(char *fn) case STSTR: case STCHAR: { - register int stopc = c; + int stopc = c; int escaped; do @@ -423,9 +423,9 @@ void preprocess(char *fn) { extern int idfsize; /* ??? */ char buf[IDFSIZE + 1]; - register char* tg = &buf[0]; - register char* maxpos = &buf[idfsize]; - register struct idf* idef; + char* tg = &buf[0]; + char* maxpos = &buf[idfsize]; + struct idf* idef; int NoExpandNext = 0; #define tstmac(bx) \ @@ -542,7 +542,7 @@ void preprocess(char *fn) static char* SkipComment(char *op, int *lineno) { char* ob = &_obuf[OBUFSIZE]; - register int c, oldc = '\0'; + int c, oldc = '\0'; NoUnstack++; if (options['C']) diff --git a/lang/cem/cpp.ansi/replace.c b/lang/cem/cpp.ansi/replace.c index c6e3588e7d..900eee202a 100644 --- a/lang/cem/cpp.ansi/replace.c +++ b/lang/cem/cpp.ansi/replace.c @@ -27,16 +27,16 @@ extern int InputLevel; struct repl *ReplaceList; /* list of currently active macros */ -static int expand_macro(register struct repl *, register struct idf *); -static void expand_defined(register struct repl *); -static void getactuals(struct repl *, register struct idf *); +static int expand_macro(struct repl *, struct idf *); +static void expand_defined(struct repl *); +static void getactuals(struct repl *, struct idf *); static int actual(struct repl *); -static void macro_func(register struct idf *); -static void macro2buffer(register struct repl *, register struct idf *, register struct args *); -static char *stringify( register struct repl *, register char *, register struct args *); -static void stash(struct repl *, register int ch, int ); +static void macro_func(struct idf *); +static void macro2buffer(struct repl *, struct idf *, struct args *); +static char *stringify( struct repl *, char *, struct args *); +static void stash(struct repl *, int ch, int ); -int replace(register struct idf *idf) +int replace(struct idf *idf) { /* replace is called by the lexical analyzer to perform macro replacement. The routine actualy functions as a @@ -69,7 +69,7 @@ void unstackrepl(void) static void freeargs(struct args *args) { - register int i; + int i; /* We must don't know how many parameters were specified, so be * prepared to free all NPARAMS parameters. @@ -87,7 +87,7 @@ static void freeargs(struct args *args) void EnableMacros(void) { - register struct repl *r = ReplaceList, *prev = 0; + struct repl *r = ReplaceList, *prev = 0; assert(Unstacked > 0); while(r) { @@ -108,8 +108,8 @@ void EnableMacros(void) } static int expand_macro( - register struct repl *repl, - register struct idf *idf) + struct repl *repl, + struct idf *idf) { /* expand_macro() does the actual macro replacement. "idf" is a description of the identifier which @@ -128,9 +128,9 @@ static int expand_macro( on a single, unexpanded identifier, which may be surrounded by parenthesis. The function expand_defined() handles this. */ - register struct macro *mac = idf->id_macro; + struct macro *mac = idf->id_macro; struct args *args = repl->r_args; - register int ch; + int ch; if (mac->mc_nps != -1) { /* with parameter list */ if (mac->mc_flag & FUNC) { @@ -172,9 +172,9 @@ static int expand_macro( return 1; } -static void expand_defined(register struct repl *repl) +static void expand_defined(struct repl *repl) { - register int ch = GetChar(); + int ch = GetChar(); struct idf *id; char *str; int parens = 0; @@ -213,16 +213,16 @@ static void newarg(struct args *args) args->a_rawptr = args->a_rawbuf = Malloc((unsigned)(args->a_rawsize = ARGBUF)); } -static void getactuals(struct repl *repl, register struct idf *idf) +static void getactuals(struct repl *repl, struct idf *idf) { /* Get the actual parameters from the input stream. The hard part is done by actual(), only comma's and other syntactic trivialities are checked here. */ - register struct args *args = repl->r_args; - register int nps = idf->id_macro->mc_nps; - register int argcnt; - register int ch; + struct args *args = repl->r_args; + int nps = idf->id_macro->mc_nps; + int argcnt; + int ch; argcnt = 0; newarg(args); @@ -256,9 +256,9 @@ static void getactuals(struct repl *repl, register struct idf *idf) static void saveraw(struct repl *repl) { - register struct repl *nrepl = ReplaceList; - register struct args *ap = nrepl->r_args; - register char *p; + struct repl *nrepl = ReplaceList; + struct args *ap = nrepl->r_args; + char *p; /* stash identifier name */ for (p = nrepl->r_idf->id_text; *p != '\0'; p++) @@ -279,7 +279,7 @@ static void saveraw(struct repl *repl) */ if (ap->a_rawvec[0]) { /* stash arguments */ - register int i; + int i; for (i = 0; ap->a_rawvec[i] != (char *)0; i++) { if (i == 0) stash(repl, '(', -1); @@ -297,8 +297,8 @@ static int actual(struct repl *repl) It keeps in account the opening and closing brackets, preprocessor numbers, strings and character constants. */ - register int ch = 0; - register int level = 0, nostashraw = 0; + int ch = 0; + int level = 0, nostashraw = 0; int lastch; static int Unstacked_missed; @@ -324,9 +324,9 @@ static int actual(struct repl *repl) token is a macro, it is expanded first. */ char buf[(IDFSIZE > NUMSIZE ? IDFSIZE : NUMSIZE) + 1]; - register char *p = buf; - register struct idf *idef; - register int pos = -1; + char *p = buf; + struct idf *idef; + int pos = -1; extern int idfsize; int NoExpandMacro; @@ -463,7 +463,7 @@ a_new_line: ch = GetChar(); /* Strings are considered as ONE token, thus no replacement within strings. */ - register int match = ch; + int match = ch; stash(repl, ch, !nostashraw); while ((ch = GetChar()) != EOI) { @@ -492,14 +492,14 @@ a_new_line: ch = GetChar(); } } -static void macro_func(register struct idf *idef) +static void macro_func(struct idf *idef) { /* macro_func() performs the special actions needed with some macros. These macros are __FILE__ and __LINE__ which replacement texts must be evaluated at the time they are used. */ - register struct macro *mac = idef->id_macro; + struct macro *mac = idef->id_macro; static char FilNamBuf[PATHLENGTH]; switch (idef->id_text[2]) { @@ -521,9 +521,9 @@ static void macro_func(register struct idf *idef) } static void macro2buffer( - register struct repl *repl, - register struct idf *idf, - register struct args *args) + struct repl *repl, + struct idf *idf, + struct args *args) { /* macro2buffer expands the replacement list and places the result onto the replacement buffer. It deals with the # @@ -551,14 +551,14 @@ static void macro2buffer( linear fashion. This is VERY expensive, something smarter should be done (but even a DFA is O(|s|)). */ - register char *ptr = idf->id_macro->mc_text; + char *ptr = idf->id_macro->mc_text; int err = 0; int func = idf->id_macro->mc_nps != -1; assert(ptr[idf->id_macro->mc_length] == '\0'); while (*ptr) { if (*ptr == '\'' || *ptr == '"') { - register int delim = *ptr; + int delim = *ptr; do { add2repl(repl, *ptr); @@ -573,7 +573,7 @@ static void macro2buffer( add2repl(repl, *ptr++); } else if (*ptr == '#' && (func || *(ptr+1) == '#')) { if (*++ptr == '#') { - register int tmpindex; + int tmpindex; /* ## - paste operator */ ptr++; @@ -605,8 +605,8 @@ static void macro2buffer( /* ## occurred at the end of the replacement list. */ if (*ptr & FORMALP) { - register int n = *ptr++ & 0177; - register char *p; + int n = *ptr++ & 0177; + char *p; assert(n > 0); p = args->a_rawvec[n-1]; @@ -641,8 +641,8 @@ static void macro2buffer( } } else if (*ptr & FORMALP) { /* insert actual parameter */ - register int n = *ptr++ & 0177; - register char *p, *q; + int n = *ptr++ & 0177; + char *p, *q; assert(n > 0); @@ -673,9 +673,9 @@ static void macro2buffer( } static char *stringify( - register struct repl *repl, - register char *ptr, - register struct args *args) + struct repl *repl, + char *ptr, + struct args *args) { /* If a parameter is immediately preceded by a # token both are replaced by a single string literal that @@ -689,17 +689,17 @@ static char *stringify( as appropriate. We only escape backslashes if they occure within string tokens. */ - register int space = 1; /* skip leading spaces */ - register int delim = 0; /* string or character constant delim */ - register int backslash = 0; /* last character was a \ */ + int space = 1; /* skip leading spaces */ + int delim = 0; /* string or character constant delim */ + int backslash = 0; /* last character was a \ */ /* skip spaces macro replacement list */ while ((*ptr & FORMALP) == 0 && is_wsp(*ptr)) ptr++; if (*ptr & FORMALP) { - register int n = *ptr++ & 0177; - register char *p; + int n = *ptr++ & 0177; + char *p; assert(n != 0); p = args->a_rawvec[n-1]; @@ -742,9 +742,9 @@ static char *stringify( /* The following routine is also called from domacro.c. */ -void add2repl(register struct repl *repl, int ch) +void add2repl(struct repl *repl, int ch) { - register int index = repl->r_ptr - repl->r_text; + int index = repl->r_ptr - repl->r_text; assert(index < repl->r_size); if (index + 2 >= repl->r_size) { @@ -759,12 +759,12 @@ void add2repl(register struct repl *repl, int ch) * buffer. If the variable is zero, we must only stash into the expanded * buffer. Otherwise, we must use both buffers. */ -static void stash(struct repl *repl, register int ch, int stashraw) +static void stash(struct repl *repl, int ch, int stashraw) { /* Stash characters into the macro expansion buffer. */ - register struct args *args = repl->r_args; - register int index = args->a_expptr - args->a_expbuf; + struct args *args = repl->r_args; + int index = args->a_expptr - args->a_expbuf; if (stashraw >= 0) { assert(index < args->a_expsize); diff --git a/lang/cem/cpp.ansi/skip.c b/lang/cem/cpp.ansi/skip.c index 9baa82f0c5..4b4d3c7869 100644 --- a/lang/cem/cpp.ansi/skip.c +++ b/lang/cem/cpp.ansi/skip.c @@ -14,9 +14,9 @@ extern int InputLevel; -int skipspaces(register int ch, int skipnl) +int skipspaces(int ch, int skipnl) { - register int nlseen = 0; + int nlseen = 0; for (;;) { @@ -70,9 +70,9 @@ int skipspaces(register int ch, int skipnl) int SkipToNewLine(void) { - register int ch; - register int garbage = 0; - register int delim = 0; + int ch; + int garbage = 0; + int delim = 0; while ((ch = GetChar()) != '\n') { diff --git a/lang/cem/cpp.ansi/skip.h b/lang/cem/cpp.ansi/skip.h index d32a7be96c..c79217953d 100644 --- a/lang/cem/cpp.ansi/skip.h +++ b/lang/cem/cpp.ansi/skip.h @@ -12,7 +12,7 @@ int SkipToNewLine(void); /* Skips skips any white space and returns the first non-space character. */ -int skipspaces(register int ch, int skipnl); +int skipspaces(int ch, int skipnl); #endif /* SKIP_H_ */ diff --git a/lang/cem/ctest/ctest1/test.c b/lang/cem/ctest/ctest1/test.c index d8ded9d9d5..141d25261b 100644 --- a/lang/cem/ctest/ctest1/test.c +++ b/lang/cem/ctest/ctest1/test.c @@ -40,7 +40,7 @@ char alstr[1000] ; char *alptr = alstr ; char *alloc(size) { - register char *retval ; + char *retval ; retval=alptr ; alptr += size ; diff --git a/lang/cem/ctest/ctest2/t7.c b/lang/cem/ctest/ctest2/t7.c index 69457f2931..ff64db9cb3 100644 --- a/lang/cem/ctest/ctest2/t7.c +++ b/lang/cem/ctest/ctest2/t7.c @@ -48,8 +48,8 @@ itoa(p,ptr) int p; char *ptr; { - register int k,l; - register char *str; + int k,l; + char *str; int sign; str=ptr; @@ -74,7 +74,7 @@ char *ptr; reverse(s) char s[]; { - register int c,i,j; + int c,i,j; for (i=0, j=strlen(s)-1; i. That is why the function is defined here. */ -char* strerror(register int errnum) +char* strerror(int errnum) { extern const char* _sys_errlist[]; extern const int _sys_nerr; diff --git a/lang/cem/libcc.ansi/core/locale/localeconv.c b/lang/cem/libcc.ansi/core/locale/localeconv.c index 16da65cd61..08c7f82f77 100644 --- a/lang/cem/libcc.ansi/core/locale/localeconv.c +++ b/lang/cem/libcc.ansi/core/locale/localeconv.c @@ -11,7 +11,7 @@ extern struct lconv _lc; struct lconv* localeconv(void) { - register struct lconv* lcp = &_lc; + struct lconv* lcp = &_lc; lcp->decimal_point = "."; lcp->thousands_sep = ""; diff --git a/lang/cem/libcc.ansi/core/misc/getopt.c b/lang/cem/libcc.ansi/core/misc/getopt.c index 9c9b88e207..05d5c03840 100644 --- a/lang/cem/libcc.ansi/core/misc/getopt.c +++ b/lang/cem/libcc.ansi/core/misc/getopt.c @@ -23,8 +23,8 @@ char* optarg; int getopt(int argc, char** argv, char* opts) { static int sp = 1; - register c; - register char* cp; + int c; + char* cp; if (sp == 1) if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') diff --git a/lang/cem/libcc.ansi/core/misc/termcap.c b/lang/cem/libcc.ansi/core/misc/termcap.c index 92629fd4d9..093757eb2c 100644 --- a/lang/cem/libcc.ansi/core/misc/termcap.c +++ b/lang/cem/libcc.ansi/core/misc/termcap.c @@ -87,8 +87,8 @@ int tgetent(char* bp, const char* name) static int match_name(const char* buf, const char* name) { - register const char* tp = buf; - register const char* np; + const char* tp = buf; + const char* np; for (;;) { @@ -114,7 +114,7 @@ check_for_tc(void) const char* savcapab = capab; char buf[1024]; char terminalname[128]; - register char *p = (char*)capab + strlen(capab) - 2, *q; + char *p = (char*)capab + strlen(capab) - 2, *q; while (*p != ':') if (--p < (char*)capab) @@ -290,7 +290,7 @@ char* tgetstr(const char* id, char** const area) */ char* tgoto(const char* cm, int destcol, int destline) { - register char* rp; + char* rp; static char ret[24]; char added[16]; int* dp = &destline; @@ -421,7 +421,7 @@ static int tens_of_ms_p_char[] = { /* index as returned by gtty */ * tputs - put the string cp out onto the terminal, using the function * outc. Also handle padding. */ -int tputs(register const char* cp, int affcnt, int (*outc)(int)) +int tputs(const char* cp, int affcnt, int (*outc)(int)) { int delay = 0; if (cp == NULL) diff --git a/lang/cem/libcc.ansi/core/printf/doprnt.c b/lang/cem/libcc.ansi/core/printf/doprnt.c index df2d557e6f..baa639ce2b 100644 --- a/lang/cem/libcc.ansi/core/printf/doprnt.c +++ b/lang/cem/libcc.ansi/core/printf/doprnt.c @@ -13,9 +13,9 @@ /* gnum() is used to get the width and precision fields of a format. */ static const char* -gnum(register const char* f, int* ip, va_list* app) +gnum(const char* f, int* ip, va_list* app) { - register int i, c; + int i, c; if (*f == '*') { @@ -155,10 +155,10 @@ o_print(va_list* ap, int flags, char* s, char c, int precision, int is_signed) return s; } -int _doprnt(register const char* fmt, va_list ap) +int _doprnt(const char* fmt, va_list ap) { - register char* s; - register int j; + char* s; + int j; int i, c, width, precision, zfill, flags, between_fill; int nrchars = 0; const char* oldfmt; diff --git a/lang/cem/libcc.ansi/core/printf/doprnt.h b/lang/cem/libcc.ansi/core/printf/doprnt.h index efb056d866..c6fe5a2531 100644 --- a/lang/cem/libcc.ansi/core/printf/doprnt.h +++ b/lang/cem/libcc.ansi/core/printf/doprnt.h @@ -17,7 +17,7 @@ extern int (*_doprnt_put)(int c); -extern int _doprnt(register const char* fmt, va_list ap); +extern int _doprnt(const char* fmt, va_list ap); extern char* _f_print(va_list* ap, int flags, char* s, char c, int precision); #if ACKCONF_WANT_STDIO_FLOAT diff --git a/lang/cem/libcc.ansi/core/printf/fltpr.c b/lang/cem/libcc.ansi/core/printf/fltpr.c index 7b9f28a697..5476d4e180 100644 --- a/lang/cem/libcc.ansi/core/printf/fltpr.c +++ b/lang/cem/libcc.ansi/core/printf/fltpr.c @@ -10,11 +10,11 @@ #if ACKCONF_WANT_STDIO && ACKCONF_WANT_STDIO_FLOAT static char* -_pfloat(long double r, register char* s, int n, int flags) +_pfloat(long double r, char* s, int n, int flags) { - register char* s1; + char* s1; int sign, dp; - register int i; + int i; s1 = _fcvt(r, n, &dp, &sign); if (sign) @@ -48,10 +48,10 @@ _pfloat(long double r, register char* s, int n, int flags) } static char* -_pscien(long double r, register char* s, int n, int flags) +_pscien(long double r, char* s, int n, int flags) { int sign, dp; - register char* s1; + char* s1; s1 = _ecvt(r, n + 1, &dp, &sign); if (sign) @@ -99,9 +99,9 @@ static char* _gcvt(long double value, int ndigit, char* s, int flags) { int sign, dp; - register char *s1, *s2; - register int i; - register int nndigit = ndigit; + char *s1, *s2; + int i; + int nndigit = ndigit; s1 = _ecvt(value, ndigit, &dp, &sign); s2 = s; @@ -177,7 +177,7 @@ _gcvt(long double value, int ndigit, char* s, int flags) char* _f_print(va_list* ap, int flags, char* s, char c, int precision) { - register char* old_s = s; + char* old_s = s; long double ld_val; if (flags & FL_LONGDOUBLE) diff --git a/lang/cem/libcc.ansi/core/scanf/doscan.c b/lang/cem/libcc.ansi/core/scanf/doscan.c index 97cf777a2b..02a1d8959d 100644 --- a/lang/cem/libcc.ansi/core/scanf/doscan.c +++ b/lang/cem/libcc.ansi/core/scanf/doscan.c @@ -35,10 +35,10 @@ void (*_doscan_unget)(int c); * according to the format of the number. At the end of the function, base * is then set to 0, so strtol() will get the right argument. */ -static char* o_collect(register int c, char type, int width, int* basep) +static char* o_collect(int c, char type, int width, int* basep) { - register char* bufp = inp_buf; - register int base; + char* bufp = inp_buf; + int base; switch (type) { @@ -120,9 +120,9 @@ static char* o_collect(register int c, char type, int width, int* basep) * not necessary, although the use of the width field can cause incomplete * numbers to be passed to strtod(). (e.g. 1.3e+) */ -static char* f_collect(register int c, register int width) +static char* f_collect(int c, int width) { - register char* bufp = inp_buf; + char* bufp = inp_buf; int digit_seen = 0; if (c == '-' || c == '+') @@ -206,13 +206,13 @@ int _doscan(const char* format, va_list ap) int conv = 0; /* # of conversions */ int base; /* conversion base */ unsigned long val; /* an integer value */ - register char* str; /* temporary pointer */ + char* str; /* temporary pointer */ char* tmp_string; /* ditto */ unsigned width; /* width of field */ int flags; /* some flags */ int reverse; /* reverse the checking in [...] */ int kind; - register int ic; /* the input character */ + int ic; /* the input character */ #if ACKCONF_WANT_STDIO_FLOAT long double ld_val; #endif diff --git a/lang/cem/libcc.ansi/core/stdio/fgets.c b/lang/cem/libcc.ansi/core/stdio/fgets.c index 14ecc488a6..58fad57812 100644 --- a/lang/cem/libcc.ansi/core/stdio/fgets.c +++ b/lang/cem/libcc.ansi/core/stdio/fgets.c @@ -7,10 +7,10 @@ #if ACKCONF_WANT_STDIO -char* fgets(char* s, register int n, register FILE* stream) +char* fgets(char* s, int n, FILE* stream) { - register int ch; - register char* ptr; + int ch; + char* ptr; ptr = s; while (--n > 0 && (ch = getc(stream)) != EOF) diff --git a/lang/cem/libcc.ansi/core/stdio/fputs.c b/lang/cem/libcc.ansi/core/stdio/fputs.c index 5c4ea7caa6..3a9b25fe62 100644 --- a/lang/cem/libcc.ansi/core/stdio/fputs.c +++ b/lang/cem/libcc.ansi/core/stdio/fputs.c @@ -7,9 +7,9 @@ #if ACKCONF_WANT_STDIO -int fputs(register const char* s, register FILE* stream) +int fputs(const char* s, FILE* stream) { - register int i = 0; + int i = 0; while (*s) if (putc(*s++, stream) == EOF) diff --git a/lang/cem/libcc.ansi/core/stdio/fread.c b/lang/cem/libcc.ansi/core/stdio/fread.c index 5bdcf41acf..d5c4e198c5 100644 --- a/lang/cem/libcc.ansi/core/stdio/fread.c +++ b/lang/cem/libcc.ansi/core/stdio/fread.c @@ -8,12 +8,12 @@ #if ACKCONF_WANT_STDIO size_t -fread(void* ptr, size_t size, size_t nmemb, register FILE* stream) +fread(void* ptr, size_t size, size_t nmemb, FILE* stream) { - register char* cp = ptr; - register int c; + char* cp = ptr; + int c; size_t ndone = 0; - register size_t s; + size_t s; if (size) while (ndone < nmemb) diff --git a/lang/cem/libcc.ansi/core/stdio/fwrite.c b/lang/cem/libcc.ansi/core/stdio/fwrite.c index 02112e76a2..4b3f7adbf8 100644 --- a/lang/cem/libcc.ansi/core/stdio/fwrite.c +++ b/lang/cem/libcc.ansi/core/stdio/fwrite.c @@ -9,10 +9,10 @@ size_t fwrite(const void* ptr, size_t size, size_t nmemb, - register FILE* stream) + FILE* stream) { - register const unsigned char* cp = ptr; - register size_t s; + const unsigned char* cp = ptr; + size_t s; size_t ndone = 0; if (size) diff --git a/lang/cem/libcc.ansi/core/stdio/gets.c b/lang/cem/libcc.ansi/core/stdio/gets.c index c58db33789..8e1bb86efc 100644 --- a/lang/cem/libcc.ansi/core/stdio/gets.c +++ b/lang/cem/libcc.ansi/core/stdio/gets.c @@ -7,9 +7,9 @@ char* gets(char* s) { - register FILE* stream = stdin; - register int ch; - register char* ptr; + FILE* stream = stdin; + int ch; + char* ptr; ptr = s; while ((ch = getc(stream)) != EOF && ch != '\n') diff --git a/lang/cem/libcc.ansi/core/stdio/getw.c b/lang/cem/libcc.ansi/core/stdio/getw.c index 7b1f1f95ef..ba9f43a702 100644 --- a/lang/cem/libcc.ansi/core/stdio/getw.c +++ b/lang/cem/libcc.ansi/core/stdio/getw.c @@ -5,11 +5,11 @@ #include -int getw(register FILE* stream) +int getw(FILE* stream) { - register int cnt = sizeof(int); + int cnt = sizeof(int); int w; - register char* p = (char*)&w; + char* p = (char*)&w; while (cnt--) { diff --git a/lang/cem/libcc.ansi/core/stdio/puts.c b/lang/cem/libcc.ansi/core/stdio/puts.c index 3592e7cfe3..f0d168a6ac 100644 --- a/lang/cem/libcc.ansi/core/stdio/puts.c +++ b/lang/cem/libcc.ansi/core/stdio/puts.c @@ -7,10 +7,10 @@ #if ACKCONF_WANT_STDIO -int puts(register const char* s) +int puts(const char* s) { - register FILE* file = stdout; - register int i = 0; + FILE* file = stdout; + int i = 0; while (*s) { diff --git a/lang/cem/libcc.ansi/core/stdio/putw.c b/lang/cem/libcc.ansi/core/stdio/putw.c index d5c137df26..3a90e79c62 100644 --- a/lang/cem/libcc.ansi/core/stdio/putw.c +++ b/lang/cem/libcc.ansi/core/stdio/putw.c @@ -5,10 +5,10 @@ #include -int putw(int w, register FILE* stream) +int putw(int w, FILE* stream) { - register int cnt = sizeof(int); - register char* p = (char*)&w; + int cnt = sizeof(int); + char* p = (char*)&w; while (cnt--) { diff --git a/lang/cem/libcc.ansi/core/stdlib/abs.c b/lang/cem/libcc.ansi/core/stdlib/abs.c index 3270f087a4..d2c91973d2 100644 --- a/lang/cem/libcc.ansi/core/stdlib/abs.c +++ b/lang/cem/libcc.ansi/core/stdlib/abs.c @@ -6,7 +6,7 @@ #include -int abs(register int i) +int abs(int i) { return i >= 0 ? i : -i; } diff --git a/lang/cem/libcc.ansi/core/stdlib/atoi.c b/lang/cem/libcc.ansi/core/stdlib/atoi.c index 6cd0c8d05a..e50e8da8d9 100644 --- a/lang/cem/libcc.ansi/core/stdlib/atoi.c +++ b/lang/cem/libcc.ansi/core/stdlib/atoi.c @@ -9,7 +9,7 @@ /* We do not use strtol here for backwards compatibility in behaviour on overflow. */ -int atoi(register const char* nptr) +int atoi(const char* nptr) { int total = 0; int minus = 0; diff --git a/lang/cem/libcc.ansi/core/stdlib/atol.c b/lang/cem/libcc.ansi/core/stdlib/atol.c index 27adb34799..8437e216e2 100644 --- a/lang/cem/libcc.ansi/core/stdlib/atol.c +++ b/lang/cem/libcc.ansi/core/stdlib/atol.c @@ -9,7 +9,7 @@ /* We do not use strtol here for backwards compatibility in behaviour on overflow. */ -long atol(register const char* nptr) +long atol(const char* nptr) { long total = 0; int minus = 0; diff --git a/lang/cem/libcc.ansi/core/stdlib/bsearch.c b/lang/cem/libcc.ansi/core/stdlib/bsearch.c index 519fff9dd6..bfcc6179aa 100644 --- a/lang/cem/libcc.ansi/core/stdlib/bsearch.c +++ b/lang/cem/libcc.ansi/core/stdlib/bsearch.c @@ -6,12 +6,12 @@ #include -void* bsearch(register const void* key, register const void* base, - register size_t nmemb, register size_t size, +void* bsearch(const void* key, const void* base, + size_t nmemb, size_t size, int (*compar)(const void*, const void*)) { - register const void* mid_point; - register int cmp; + const void* mid_point; + int cmp; while (nmemb > 0) { diff --git a/lang/cem/libcc.ansi/core/stdlib/div.c b/lang/cem/libcc.ansi/core/stdlib/div.c index 42f739b0e0..55f3b4b15a 100644 --- a/lang/cem/libcc.ansi/core/stdlib/div.c +++ b/lang/cem/libcc.ansi/core/stdlib/div.c @@ -6,7 +6,7 @@ #include -div_t div(register int numer, register int denom) +div_t div(int numer, int denom) { div_t r; diff --git a/lang/cem/libcc.ansi/core/stdlib/ext_comp.c b/lang/cem/libcc.ansi/core/stdlib/ext_comp.c index 28eb213a44..45c330bcb6 100644 --- a/lang/cem/libcc.ansi/core/stdlib/ext_comp.c +++ b/lang/cem/libcc.ansi/core/stdlib/ext_comp.c @@ -27,12 +27,12 @@ static mul_ext(struct EXTEND* e1, struct EXTEND* e2, struct EXTEND* e3) /* Multiply the extended numbers e1 and e2, and put the result in e3. */ - register int i, j; /* loop control */ + int i, j; /* loop control */ unsigned short mp[4]; unsigned short mc[4]; unsigned short result[8]; /* result */ - register unsigned short* pres; + unsigned short* pres; /* first save the sign (XOR) */ e3->sign = e1->sign ^ e2->sign; @@ -272,7 +272,7 @@ b64_add(struct mantissa* e1, struct mantissa* e2) * pointers to 64 bit 'registers' */ { - register int overflow; + int overflow; int carry; /* add higher pair of 32 bits */ @@ -499,7 +499,7 @@ static add_exponent(struct EXTEND* e, int exp) void _str_ext_cvt(const char* s, char** ss, struct EXTEND* e) { /* Like strtod, but for extended precision */ - register int c; + int c; int dotseen = 0; int digitseen = 0; int exp = 0; @@ -616,8 +616,8 @@ char* _ext_str_cvt(struct EXTEND* e, int ndigit, int* decpt, int* sign, int ecvt static char buf[NDIGITS + 1]; struct EXTEND m; - register char* p = buf; - register char* pe; + char* p = buf; + char* pe; int findex = 0; if (ndigit < 0) @@ -637,7 +637,7 @@ char* _ext_str_cvt(struct EXTEND* e, int ndigit, int* decpt, int* sign, int ecvt *decpt = 0; if (e->m1 != 0) { - register struct EXTEND* pp = &big_ten_powers[1]; + struct EXTEND* pp = &big_ten_powers[1]; while (cmp_ext(e, pp) >= 0) { diff --git a/lang/cem/libcc.ansi/core/stdlib/getenv.c b/lang/cem/libcc.ansi/core/stdlib/getenv.c index 3db5c37973..a33674cca0 100644 --- a/lang/cem/libcc.ansi/core/stdlib/getenv.c +++ b/lang/cem/libcc.ansi/core/stdlib/getenv.c @@ -29,12 +29,12 @@ char* getenv(const char* name) * * This routine *should* be a static; don't use it. */ -char* _findenv(register const char* name, int* offset) +char* _findenv(const char* name, int* offset) { extern char** environ; - register int len; - register char** P; - register const char* C; + int len; + char** P; + const char* C; if (!environ) return NULL; diff --git a/lang/cem/libcc.ansi/core/stdlib/labs.c b/lang/cem/libcc.ansi/core/stdlib/labs.c index e0acaed86d..265b79d745 100644 --- a/lang/cem/libcc.ansi/core/stdlib/labs.c +++ b/lang/cem/libcc.ansi/core/stdlib/labs.c @@ -6,7 +6,7 @@ #include -long labs(register long l) +long labs(long l) { return l >= 0 ? l : -l; } diff --git a/lang/cem/libcc.ansi/core/stdlib/ldiv.c b/lang/cem/libcc.ansi/core/stdlib/ldiv.c index e35c067150..971d012586 100644 --- a/lang/cem/libcc.ansi/core/stdlib/ldiv.c +++ b/lang/cem/libcc.ansi/core/stdlib/ldiv.c @@ -7,7 +7,7 @@ #include ldiv_t -ldiv(register long numer, register long denom) +ldiv(long numer, long denom) { ldiv_t r; diff --git a/lang/cem/libcc.ansi/core/stdlib/mbstowcs.c b/lang/cem/libcc.ansi/core/stdlib/mbstowcs.c index 34d120e60d..483fd2458f 100644 --- a/lang/cem/libcc.ansi/core/stdlib/mbstowcs.c +++ b/lang/cem/libcc.ansi/core/stdlib/mbstowcs.c @@ -7,9 +7,9 @@ #include size_t -mbstowcs(register wchar_t* pwcs, register const char* s, size_t n) +mbstowcs(wchar_t* pwcs, const char* s, size_t n) { - register int i = n; + int i = n; while (--i >= 0) { diff --git a/lang/cem/libcc.ansi/core/stdlib/mbtowc.c b/lang/cem/libcc.ansi/core/stdlib/mbtowc.c index 8e80ca2631..abe7f24263 100644 --- a/lang/cem/libcc.ansi/core/stdlib/mbtowc.c +++ b/lang/cem/libcc.ansi/core/stdlib/mbtowc.c @@ -7,7 +7,7 @@ #include #include -int mbtowc(wchar_t* pwc, register const char* s, size_t n) +int mbtowc(wchar_t* pwc, const char* s, size_t n) { if (s == (const char*)NULL) return 0; diff --git a/lang/cem/libcc.ansi/core/stdlib/putenv.c b/lang/cem/libcc.ansi/core/stdlib/putenv.c index 09412f3413..5978fccd71 100644 --- a/lang/cem/libcc.ansi/core/stdlib/putenv.c +++ b/lang/cem/libcc.ansi/core/stdlib/putenv.c @@ -14,8 +14,8 @@ extern char** environ; int putenv(char* name) { - register char** v = environ; - register char* r; + char** v = environ; + char* r; static int size = 0; /* When size != 0, it contains the number of entries in the * table (including the final NULL pointer). This means that the @@ -26,7 +26,7 @@ int putenv(char* name) return 0; if (r = strchr(name, '=')) { - register const char *p, *q; + const char *p, *q; *r = '\0'; @@ -58,8 +58,8 @@ int putenv(char* name) if (!size) { - register char** p; - register int i = 0; + char** p; + int i = 0; if (v) do diff --git a/lang/cem/libcc.ansi/core/stdlib/qsort.c b/lang/cem/libcc.ansi/core/stdlib/qsort.c index b0c92fe94d..2f7c99adf0 100644 --- a/lang/cem/libcc.ansi/core/stdlib/qsort.c +++ b/lang/cem/libcc.ansi/core/stdlib/qsort.c @@ -22,10 +22,10 @@ void qsort(void* base, size_t nel, size_t width, } static void -qsort1(char* a1, char* a2, register size_t width) +qsort1(char* a1, char* a2, size_t width) { - register char *left, *right; - register char *lefteq, *righteq; + char *left, *right; + char *lefteq, *righteq; int cmp; for (;;) @@ -122,10 +122,10 @@ qsort1(char* a1, char* a2, register size_t width) } static void -qexchange(register char* p, register char* q, - register size_t n) +qexchange(char* p, char* q, + size_t n) { - register int c; + int c; while (n-- > 0) { @@ -136,10 +136,10 @@ qexchange(register char* p, register char* q, } static void -q3exchange(register char* p, register char* q, register char* r, - register size_t n) +q3exchange(char* p, char* q, char* r, + size_t n) { - register int c; + int c; while (n-- > 0) { diff --git a/lang/cem/libcc.ansi/core/stdlib/setenv.c b/lang/cem/libcc.ansi/core/stdlib/setenv.c index c973bd58a8..285f9d5a06 100644 --- a/lang/cem/libcc.ansi/core/stdlib/setenv.c +++ b/lang/cem/libcc.ansi/core/stdlib/setenv.c @@ -15,10 +15,10 @@ extern char** environ; * Set the value of the environmental variable "name" to be * "value". If rewrite is set, replace any current value. */ -int setenv(register const char* name, register const char* value, int rewrite) +int setenv(const char* name, const char* value, int rewrite) { static int alloced = 0; /* if allocated space before */ - register char* C; + char* C; int l_value, offset; @@ -38,8 +38,8 @@ int setenv(register const char* name, register const char* value, int rewrite) } else { /* create new slot */ - register int cnt = 0; - register char** P; + int cnt = 0; + char** P; if (environ) for (P = environ; *P; ++P, ++cnt) @@ -82,7 +82,7 @@ int setenv(register const char* name, register const char* value, int rewrite) */ int unsetenv(const char* name) { - register char** P; + char** P; int offset; while (_findenv(name, &offset)) /* if set multiple times */ diff --git a/lang/cem/libcc.ansi/core/stdlib/strtol.c b/lang/cem/libcc.ansi/core/stdlib/strtol.c index ce072d49da..b9a6ce2871 100644 --- a/lang/cem/libcc.ansi/core/stdlib/strtol.c +++ b/lang/cem/libcc.ansi/core/stdlib/strtol.c @@ -10,28 +10,28 @@ #include static unsigned long -string2long(register const char* nptr, char** endptr, +string2long(const char* nptr, char** endptr, int base, int is_signed); long int -strtol(register const char* nptr, char** endptr, int base) +strtol(const char* nptr, char** endptr, int base) { return (signed long)string2long(nptr, endptr, base, 1); } unsigned long int -strtoul(register const char* nptr, char** endptr, int base) +strtoul(const char* nptr, char** endptr, int base) { return (unsigned long)string2long(nptr, endptr, base, 0); } static unsigned long -string2long(register const char* nptr, char** const endptr, +string2long(const char* nptr, char** const endptr, int base, int is_signed) { - register unsigned int v; - register unsigned long val = 0; - register int c; + unsigned int v; + unsigned long val = 0; + int c; int ovfl = 0, sign = 1; const char *startnptr = nptr, *nrstart; diff --git a/lang/cem/libcc.ansi/core/stdlib/wcstombs.c b/lang/cem/libcc.ansi/core/stdlib/wcstombs.c index 2803b7b2a1..6999bebe0b 100644 --- a/lang/cem/libcc.ansi/core/stdlib/wcstombs.c +++ b/lang/cem/libcc.ansi/core/stdlib/wcstombs.c @@ -9,9 +9,9 @@ #include size_t -wcstombs(register char* s, register const wchar_t* pwcs, size_t n) +wcstombs(char* s, const wchar_t* pwcs, size_t n) { - register int i = n; + int i = n; while (--i >= 0) { diff --git a/lang/cem/libcc.ansi/core/string/memchr.c b/lang/cem/libcc.ansi/core/string/memchr.c index 0d891e83d5..0239d524e8 100644 --- a/lang/cem/libcc.ansi/core/string/memchr.c +++ b/lang/cem/libcc.ansi/core/string/memchr.c @@ -6,9 +6,9 @@ #include -void* memchr(const void* s, register int c, register size_t n) +void* memchr(const void* s, int c, size_t n) { - register const unsigned char* s1 = s; + const unsigned char* s1 = s; c = (unsigned char)c; if (n) diff --git a/lang/cem/libcc.ansi/core/string/memcmp.c b/lang/cem/libcc.ansi/core/string/memcmp.c index 625dbaafb4..217edbd7c7 100644 --- a/lang/cem/libcc.ansi/core/string/memcmp.c +++ b/lang/cem/libcc.ansi/core/string/memcmp.c @@ -8,7 +8,7 @@ int memcmp(const void* s1, const void* s2, size_t n) { - register const unsigned char *p1 = s1, *p2 = s2; + const unsigned char *p1 = s1, *p2 = s2; if (n) { diff --git a/lang/cem/libcc.ansi/core/string/memcpy.c b/lang/cem/libcc.ansi/core/string/memcpy.c index d648815cd1..e14eecb84b 100644 --- a/lang/cem/libcc.ansi/core/string/memcpy.c +++ b/lang/cem/libcc.ansi/core/string/memcpy.c @@ -6,10 +6,10 @@ #include -void* memcpy(void* s1, const void* s2, register size_t n) +void* memcpy(void* s1, const void* s2, size_t n) { - register char* p1 = s1; - register const char* p2 = s2; + char* p1 = s1; + const char* p2 = s2; if (n) { diff --git a/lang/cem/libcc.ansi/core/string/memmove.c b/lang/cem/libcc.ansi/core/string/memmove.c index 78fbd0c6a3..4e618cc40c 100644 --- a/lang/cem/libcc.ansi/core/string/memmove.c +++ b/lang/cem/libcc.ansi/core/string/memmove.c @@ -6,10 +6,10 @@ #include -void* memmove(void* s1, const void* s2, register size_t n) +void* memmove(void* s1, const void* s2, size_t n) { - register char* p1 = s1; - register const char* p2 = s2; + char* p1 = s1; + const char* p2 = s2; if (n > 0) { diff --git a/lang/cem/libcc.ansi/core/string/memset.c b/lang/cem/libcc.ansi/core/string/memset.c index 649f8c7838..57efdcde25 100644 --- a/lang/cem/libcc.ansi/core/string/memset.c +++ b/lang/cem/libcc.ansi/core/string/memset.c @@ -6,9 +6,9 @@ #include -void* memset(void* s, register int c, register size_t n) +void* memset(void* s, int c, size_t n) { - register char* s1 = s; + char* s1 = s; if (n > 0) { diff --git a/lang/cem/libcc.ansi/core/string/strcat.c b/lang/cem/libcc.ansi/core/string/strcat.c index 613050957d..af7dedfaa3 100644 --- a/lang/cem/libcc.ansi/core/string/strcat.c +++ b/lang/cem/libcc.ansi/core/string/strcat.c @@ -6,9 +6,9 @@ #include -char* strcat(char* ret, register const char* s2) +char* strcat(char* ret, const char* s2) { - register char* s1 = ret; + char* s1 = ret; while (*s1++ != '\0') /* EMPTY */; diff --git a/lang/cem/libcc.ansi/core/string/strchr.c b/lang/cem/libcc.ansi/core/string/strchr.c index da906e1363..411b128b5e 100644 --- a/lang/cem/libcc.ansi/core/string/strchr.c +++ b/lang/cem/libcc.ansi/core/string/strchr.c @@ -6,7 +6,7 @@ #include -char* strchr(register const char* s, register int c) +char* strchr(const char* s, int c) { c = (char)c; diff --git a/lang/cem/libcc.ansi/core/string/strcmp.c b/lang/cem/libcc.ansi/core/string/strcmp.c index 12406c9562..1f6936b6ac 100644 --- a/lang/cem/libcc.ansi/core/string/strcmp.c +++ b/lang/cem/libcc.ansi/core/string/strcmp.c @@ -6,7 +6,7 @@ #include -int strcmp(register const char* s1, register const char* s2) +int strcmp(const char* s1, const char* s2) { while (*s1 == *s2++) { diff --git a/lang/cem/libcc.ansi/core/string/strcoll.c b/lang/cem/libcc.ansi/core/string/strcoll.c index 6e9a634af3..657dc7228d 100644 --- a/lang/cem/libcc.ansi/core/string/strcoll.c +++ b/lang/cem/libcc.ansi/core/string/strcoll.c @@ -7,7 +7,7 @@ #include #include -int strcoll(register const char* s1, register const char* s2) +int strcoll(const char* s1, const char* s2) { while (*s1 == *s2++) { diff --git a/lang/cem/libcc.ansi/core/string/strcpy.c b/lang/cem/libcc.ansi/core/string/strcpy.c index 652f763762..d7da94ccdc 100644 --- a/lang/cem/libcc.ansi/core/string/strcpy.c +++ b/lang/cem/libcc.ansi/core/string/strcpy.c @@ -6,9 +6,9 @@ #include -char* strcpy(char* ret, register const char* s2) +char* strcpy(char* ret, const char* s2) { - register char* s1 = ret; + char* s1 = ret; while (*s1++ = *s2++) /* EMPTY */; diff --git a/lang/cem/libcc.ansi/core/string/strcspn.c b/lang/cem/libcc.ansi/core/string/strcspn.c index 37b22857e3..7c9533b52f 100644 --- a/lang/cem/libcc.ansi/core/string/strcspn.c +++ b/lang/cem/libcc.ansi/core/string/strcspn.c @@ -9,7 +9,7 @@ size_t strcspn(const char* string, const char* notin) { - register const char *s1, *s2; + const char *s1, *s2; for (s1 = string; *s1; s1++) { diff --git a/lang/cem/libcc.ansi/core/string/strlen.c b/lang/cem/libcc.ansi/core/string/strlen.c index acf3a8acf2..9c8ba4c733 100644 --- a/lang/cem/libcc.ansi/core/string/strlen.c +++ b/lang/cem/libcc.ansi/core/string/strlen.c @@ -9,7 +9,7 @@ size_t strlen(const char* org) { - register const char* s = org; + const char* s = org; while (*s++) /* EMPTY */; diff --git a/lang/cem/libcc.ansi/core/string/strncat.c b/lang/cem/libcc.ansi/core/string/strncat.c index 77013ccb00..2b4b066d28 100644 --- a/lang/cem/libcc.ansi/core/string/strncat.c +++ b/lang/cem/libcc.ansi/core/string/strncat.c @@ -6,9 +6,9 @@ #include -char* strncat(char* ret, register const char* s2, size_t n) +char* strncat(char* ret, const char* s2, size_t n) { - register char* s1 = ret; + char* s1 = ret; if (n > 0) { diff --git a/lang/cem/libcc.ansi/core/string/strncmp.c b/lang/cem/libcc.ansi/core/string/strncmp.c index b0e16b0145..5d4ea63bf0 100644 --- a/lang/cem/libcc.ansi/core/string/strncmp.c +++ b/lang/cem/libcc.ansi/core/string/strncmp.c @@ -6,7 +6,7 @@ #include -int strncmp(register const char* s1, register const char* s2, register size_t n) +int strncmp(const char* s1, const char* s2, size_t n) { if (n) { diff --git a/lang/cem/libcc.ansi/core/string/strncpy.c b/lang/cem/libcc.ansi/core/string/strncpy.c index bdf9129e76..583a7ebae0 100644 --- a/lang/cem/libcc.ansi/core/string/strncpy.c +++ b/lang/cem/libcc.ansi/core/string/strncpy.c @@ -6,9 +6,9 @@ #include -char* strncpy(char* ret, register const char* s2, register size_t n) +char* strncpy(char* ret, const char* s2, size_t n) { - register char* s1 = ret; + char* s1 = ret; if (n > 0) { diff --git a/lang/cem/libcc.ansi/core/string/strpbrk.c b/lang/cem/libcc.ansi/core/string/strpbrk.c index aa517445d4..d686217464 100644 --- a/lang/cem/libcc.ansi/core/string/strpbrk.c +++ b/lang/cem/libcc.ansi/core/string/strpbrk.c @@ -6,9 +6,9 @@ #include -char* strpbrk(register const char* string, register const char* brk) +char* strpbrk(const char* string, const char* brk) { - register const char* s1; + const char* s1; while (*string) { diff --git a/lang/cem/libcc.ansi/core/string/strrchr.c b/lang/cem/libcc.ansi/core/string/strrchr.c index b55ced1cdc..83090ab0b1 100644 --- a/lang/cem/libcc.ansi/core/string/strrchr.c +++ b/lang/cem/libcc.ansi/core/string/strrchr.c @@ -6,9 +6,9 @@ #include -char* strrchr(register const char* s, int c) +char* strrchr(const char* s, int c) { - register const char* result = NULL; + const char* result = NULL; c = (char)c; diff --git a/lang/cem/libcc.ansi/core/string/strspn.c b/lang/cem/libcc.ansi/core/string/strspn.c index 908d6f9ea5..7b3126c5e4 100644 --- a/lang/cem/libcc.ansi/core/string/strspn.c +++ b/lang/cem/libcc.ansi/core/string/strspn.c @@ -9,7 +9,7 @@ size_t strspn(const char* string, const char* in) { - register const char *s1, *s2; + const char *s1, *s2; for (s1 = string; *s1; s1++) { diff --git a/lang/cem/libcc.ansi/core/string/strstr.c b/lang/cem/libcc.ansi/core/string/strstr.c index 2b9b1178d5..fea72f63db 100644 --- a/lang/cem/libcc.ansi/core/string/strstr.c +++ b/lang/cem/libcc.ansi/core/string/strstr.c @@ -6,9 +6,9 @@ #include -char* strstr(register const char* s, register const char* wanted) +char* strstr(const char* s, const char* wanted) { - register const int len = strlen(wanted); + const int len = strlen(wanted); if (len == 0) return (char*)s; diff --git a/lang/cem/libcc.ansi/core/string/strtok.c b/lang/cem/libcc.ansi/core/string/strtok.c index 9582ea7c3b..d6a28edcf5 100644 --- a/lang/cem/libcc.ansi/core/string/strtok.c +++ b/lang/cem/libcc.ansi/core/string/strtok.c @@ -6,9 +6,9 @@ #include -char* strtok(register char* string, const char* separators) +char* strtok(char* string, const char* separators) { - register char *s1, *s2; + char *s1, *s2; static char* savestring; if (string == NULL) diff --git a/lang/cem/libcc.ansi/core/string/strxfrm.c b/lang/cem/libcc.ansi/core/string/strxfrm.c index f6163bd5b1..37b2b817b5 100644 --- a/lang/cem/libcc.ansi/core/string/strxfrm.c +++ b/lang/cem/libcc.ansi/core/string/strxfrm.c @@ -7,9 +7,9 @@ #include size_t -strxfrm(register char* s1, register const char* save, register size_t n) +strxfrm(char* s1, const char* save, size_t n) { - register const char* s2 = save; + const char* s2 = save; while (*s2) { diff --git a/lang/cem/libcc.ansi/core/time/asctime.c b/lang/cem/libcc.ansi/core/time/asctime.c index dda8b80067..c3fbbe4a84 100644 --- a/lang/cem/libcc.ansi/core/time/asctime.c +++ b/lang/cem/libcc.ansi/core/time/asctime.c @@ -10,7 +10,7 @@ #define DATE_STR "??? ??? ?? ??:??:?? ????\n" static char* -two_digits(register char* pb, int i, int nospace) +two_digits(char* pb, int i, int nospace) { *pb = (i / 10) % 10 + '0'; if (!nospace && *pb == '0') @@ -21,7 +21,7 @@ two_digits(register char* pb, int i, int nospace) } static char* -four_digits(register char* pb, int i) +four_digits(char* pb, int i) { i %= 10000; *pb++ = (i / 1000) + '0'; @@ -36,9 +36,9 @@ four_digits(register char* pb, int i) char* asctime(const struct tm* timeptr) { static char buf[26]; - register char* pb = buf; - register const char* ps; - register int n; + char* pb = buf; + const char* ps; + int n; strcpy(pb, DATE_STR); ps = _days[timeptr->tm_wday]; diff --git a/lang/cem/libcc.ansi/core/time/gmtime.c b/lang/cem/libcc.ansi/core/time/gmtime.c index 0dcb1c25d4..cc0a20653d 100644 --- a/lang/cem/libcc.ansi/core/time/gmtime.c +++ b/lang/cem/libcc.ansi/core/time/gmtime.c @@ -8,12 +8,12 @@ #include "loc_time.h" struct tm* -gmtime(register const time_t* timer) +gmtime(const time_t* timer) { static struct tm br_time; - register struct tm* timep = &br_time; + struct tm* timep = &br_time; time_t tim = *timer; - register unsigned long dayclock, dayno; + unsigned long dayclock, dayno; int year = EPOCH_YR; dayclock = (unsigned long)tim % SECS_DAY; diff --git a/lang/cem/libcc.ansi/core/time/misc.c b/lang/cem/libcc.ansi/core/time/misc.c index 6a182307f9..1b6c6e96be 100644 --- a/lang/cem/libcc.ansi/core/time/misc.c +++ b/lang/cem/libcc.ansi/core/time/misc.c @@ -125,7 +125,7 @@ static TABLE TimezoneTable[] = { static void ZoneFromTable(long timezone) { - register TABLE* tptr = TimezoneTable; + TABLE* tptr = TimezoneTable; while (tptr->tz_name != NULL) { @@ -148,9 +148,9 @@ ZoneFromTable(long timezone) #endif /* USE_TABLE */ static const char* -parseZoneName(register char* buf, register const char* p) +parseZoneName(char* buf, const char* p) { - register int n = 0; + int n = 0; if (*p == ':') return NULL; @@ -168,10 +168,10 @@ parseZoneName(register char* buf, register const char* p) } static const char* -parseTime(register long* tm, const char* p, register struct dsttype* dst) +parseTime(long* tm, const char* p, struct dsttype* dst) { - register int n = 0; - register const char* q = p; + int n = 0; + const char* q = p; char ds_type = (dst ? dst->ds_type : '\0'); if (dst) @@ -224,10 +224,10 @@ parseTime(register long* tm, const char* p, register struct dsttype* dst) } static const char* -parseDate(register char* buf, register const char* p, struct dsttype* dstinfo) +parseDate(char* buf, const char* p, struct dsttype* dstinfo) { - register const char* q; - register int n = 0; + const char* q; + int n = 0; int cnt = 0; const int bnds[3][2] = { { 1, 12 }, { 1, 5 }, @@ -283,10 +283,10 @@ parseDate(register char* buf, register const char* p, struct dsttype* dstinfo) } static const char* -parseRule(register char* buf, register const char* p) +parseRule(char* buf, const char* p) { long tim; - register const char* q; + const char* q; if (!(p = parseDate(buf, p, &dststart))) return NULL; @@ -410,7 +410,7 @@ void _tzset(void) } static int -last_sunday(register int day, register struct tm* timep) +last_sunday(int day, struct tm* timep) { int first = FIRSTSUNDAY(timep); @@ -422,11 +422,11 @@ last_sunday(register int day, register struct tm* timep) } static int -date_of(register struct dsttype* dst, struct tm* timep) +date_of(struct dsttype* dst, struct tm* timep) { int leap = LEAPYEAR(YEAR0 + timep->tm_year); int firstday, tmpday; - register int day, month; + int day, month; if (dst->ds_type != 'M') { @@ -455,10 +455,10 @@ date_of(register struct dsttype* dst, struct tm* timep) * Britain). */ unsigned -_dstget(register struct tm* timep) +_dstget(struct tm* timep) { int begindst, enddst; - register struct dsttype *dsts = &dststart, *dste = &dstend; + struct dsttype *dsts = &dststart, *dste = &dstend; int do_dst = 0; if (_daylight == -1) diff --git a/lang/cem/libcc.ansi/core/time/mktime.c b/lang/cem/libcc.ansi/core/time/mktime.c index 174d2c2669..93c69408e6 100644 --- a/lang/cem/libcc.ansi/core/time/mktime.c +++ b/lang/cem/libcc.ansi/core/time/mktime.c @@ -12,12 +12,12 @@ * that the check for overflow at the end could fail. */ time_t -mktime(register struct tm* timep) +mktime(struct tm* timep) { - register long day, year; - register int tm_year; + long day, year; + int tm_year; int yday, month; - register unsigned long seconds; + unsigned long seconds; int overflow; unsigned dst; diff --git a/lang/cem/libcc.ansi/sys/misc/mktemp.c b/lang/cem/libcc.ansi/sys/misc/mktemp.c index 41b72e5efd..26a0d2b8bd 100644 --- a/lang/cem/libcc.ansi/sys/misc/mktemp.c +++ b/lang/cem/libcc.ansi/sys/misc/mktemp.c @@ -7,8 +7,8 @@ char* mktemp(char* template) { - register int pid, k; - register char* p; + int pid, k; + char* p; pid = getpid(); /* get process id as semi-unique number */ p = template; diff --git a/lang/cem/libcc.ansi/sys/misc/popen.c b/lang/cem/libcc.ansi/sys/misc/popen.c index 4631ce85cf..c846a1d18a 100644 --- a/lang/cem/libcc.ansi/sys/misc/popen.c +++ b/lang/cem/libcc.ansi/sys/misc/popen.c @@ -24,7 +24,7 @@ FILE* popen(const char* command, const char* type) if (pid == 0) { /* child */ - register int* p; + int* p; for (p = pids; p < &pids[FOPEN_MAX]; p++) { diff --git a/lang/cem/libcc.ansi/sys/stdio/fclose.c b/lang/cem/libcc.ansi/sys/stdio/fclose.c index a805a6e848..a8b202ee21 100644 --- a/lang/cem/libcc.ansi/sys/stdio/fclose.c +++ b/lang/cem/libcc.ansi/sys/stdio/fclose.c @@ -11,7 +11,7 @@ int fclose(FILE* fp) { - register int i, retval = 0; + int i, retval = 0; for (i = 0; i < FOPEN_MAX; i++) if (fp == __iotab[i]) diff --git a/lang/cem/libcc.ansi/sys/stdio/fdopen.c b/lang/cem/libcc.ansi/sys/stdio/fdopen.c index 58fcecfcdb..07f11a1aac 100644 --- a/lang/cem/libcc.ansi/sys/stdio/fdopen.c +++ b/lang/cem/libcc.ansi/sys/stdio/fdopen.c @@ -14,7 +14,7 @@ FILE* fdopen(int fd, const char* mode) { - register int i; + int i; FILE* stream; int flags = 0; diff --git a/lang/cem/libcc.ansi/sys/stdio/fflush.c b/lang/cem/libcc.ansi/sys/stdio/fflush.c index 7746ef0fb8..e685fd6269 100644 --- a/lang/cem/libcc.ansi/sys/stdio/fflush.c +++ b/lang/cem/libcc.ansi/sys/stdio/fflush.c @@ -71,7 +71,7 @@ int fflush(FILE* stream) static void cleanup(void) { - register int i; + int i; for (i = 0; i < FOPEN_MAX; i++) if (__iotab[i] && io_testflag(__iotab[i], _IOWRITING)) diff --git a/lang/cem/libcc.ansi/sys/stdio/fillbuf.c b/lang/cem/libcc.ansi/sys/stdio/fillbuf.c index 09cc5cfc6b..6649fbc1e2 100644 --- a/lang/cem/libcc.ansi/sys/stdio/fillbuf.c +++ b/lang/cem/libcc.ansi/sys/stdio/fillbuf.c @@ -9,10 +9,10 @@ #if ACKCONF_WANT_STDIO && ACKCONF_WANT_EMULATED_FILE -int __fillbuf(register FILE* stream) +int __fillbuf(FILE* stream) { static unsigned char ch[FOPEN_MAX]; - register int i; + int i; stream->_count = 0; if (fileno(stream) < 0) diff --git a/lang/cem/libcc.ansi/sys/stdio/fopen.c b/lang/cem/libcc.ansi/sys/stdio/fopen.c index cfea441546..e588dd20c5 100644 --- a/lang/cem/libcc.ansi/sys/stdio/fopen.c +++ b/lang/cem/libcc.ansi/sys/stdio/fopen.c @@ -33,7 +33,7 @@ FILE* fopen(const char* name, const char* mode) { - register int i; + int i; int rwmode = 0, rwflags = 0; FILE* stream; int fd, flags = 0; diff --git a/lang/cem/libcc.ansi/sys/stdio/freopen.c b/lang/cem/libcc.ansi/sys/stdio/freopen.c index 1ae5befe05..f4aaaf7295 100644 --- a/lang/cem/libcc.ansi/sys/stdio/freopen.c +++ b/lang/cem/libcc.ansi/sys/stdio/freopen.c @@ -18,7 +18,7 @@ FILE* freopen(const char* name, const char* mode, FILE* stream) { - register int i; + int i; int rwmode = 0, rwflags = 0; int fd, flags = stream->_flags & (_IONBF | _IOFBF | _IOLBF | _IOMYBUF); diff --git a/lang/cem/libcc.ansi/sys/stdio/setbuf.c b/lang/cem/libcc.ansi/sys/stdio/setbuf.c index 58a99ecad3..ad7f72d40e 100644 --- a/lang/cem/libcc.ansi/sys/stdio/setbuf.c +++ b/lang/cem/libcc.ansi/sys/stdio/setbuf.c @@ -7,7 +7,7 @@ #if ACKCONF_WANT_STDIO && ACKCONF_WANT_EMULATED_FILE -void setbuf(register FILE* stream, char* buf) +void setbuf(FILE* stream, char* buf) { (void)setvbuf(stream, buf, (buf ? _IOFBF : _IONBF), (size_t)BUFSIZ); } diff --git a/lang/cem/libcc.ansi/sys/stdio/setvbuf.c b/lang/cem/libcc.ansi/sys/stdio/setvbuf.c index 439d12dd42..0cdaad8837 100644 --- a/lang/cem/libcc.ansi/sys/stdio/setvbuf.c +++ b/lang/cem/libcc.ansi/sys/stdio/setvbuf.c @@ -8,7 +8,7 @@ #if ACKCONF_WANT_STDIO && ACKCONF_WANT_EMULATED_FILE -int setvbuf(register FILE* stream, char* buf, int mode, size_t size) +int setvbuf(FILE* stream, char* buf, int mode, size_t size) { int retval = 0; diff --git a/lang/cem/libcc/gen/asctime.c b/lang/cem/libcc/gen/asctime.c index fc3ee06d41..90384e918a 100644 --- a/lang/cem/libcc/gen/asctime.c +++ b/lang/cem/libcc/gen/asctime.c @@ -13,10 +13,10 @@ static char *four_digits(); char * asctime(tm) - register struct tm *tm; + struct tm *tm; { static char buf[32]; - register char *pb = buf, *ps; + char *pb = buf, *ps; strcpy(pb, DATE_STR); ps = days[tm->tm_wday]; @@ -38,7 +38,7 @@ asctime(tm) static char * two_digits(pb, i, nospace) - register char *pb; + char *pb; { *pb = (i / 10) % 10 + '0'; if (!nospace && *pb == '0') *pb = ' '; @@ -49,7 +49,7 @@ two_digits(pb, i, nospace) static char * four_digits(pb, i) - register char *pb; + char *pb; { i %= 10000; *pb++ = (i / 1000) + '0'; diff --git a/lang/cem/libcc/gen/atof.c b/lang/cem/libcc/gen/atof.c index ae0ae672ea..9751a3014a 100644 --- a/lang/cem/libcc/gen/atof.c +++ b/lang/cem/libcc/gen/atof.c @@ -5,7 +5,7 @@ extern double strtod(); double atof(p) - register char *p; + char *p; { return strtod(p, (char **) 0); } diff --git a/lang/cem/libcc/gen/atoi.c b/lang/cem/libcc/gen/atoi.c index 6084836821..41c2203651 100644 --- a/lang/cem/libcc/gen/atoi.c +++ b/lang/cem/libcc/gen/atoi.c @@ -1,9 +1,9 @@ /* $Id$ */ atoi(s) -register char *s; +char *s; { - register int total = 0; - register unsigned digit; + int total = 0; + unsigned digit; int minus = 0; while (*s == ' ' || *s == '\t') diff --git a/lang/cem/libcc/gen/atol.c b/lang/cem/libcc/gen/atol.c index d77b932390..100b994c4f 100644 --- a/lang/cem/libcc/gen/atol.c +++ b/lang/cem/libcc/gen/atol.c @@ -1,9 +1,9 @@ /* $Id$ */ long atol(s) -register char *s; +char *s; { - register long total = 0; - register unsigned digit; + long total = 0; + unsigned digit; int minus = 0; while (*s == ' ' || *s == '\t') s++; diff --git a/lang/cem/libcc/gen/bcmp.c b/lang/cem/libcc/gen/bcmp.c index ae0fc60040..202435c884 100644 --- a/lang/cem/libcc/gen/bcmp.c +++ b/lang/cem/libcc/gen/bcmp.c @@ -1,10 +1,10 @@ /* $Id$ */ int bcmp(b1, b2, n) - register char *b1, *b2; - register int n; + char *b1, *b2; + int n; { - register int i; + int i; while (n--) { if (i = *b2++ - *b1++) return i; diff --git a/lang/cem/libcc/gen/bcopy.c b/lang/cem/libcc/gen/bcopy.c index a8154908ca..cb9cacb052 100644 --- a/lang/cem/libcc/gen/bcopy.c +++ b/lang/cem/libcc/gen/bcopy.c @@ -1,7 +1,7 @@ /* $Id$ */ bcopy(old, new, n) -register char *old, *new; -register int n; +char *old, *new; +int n; { /* Copy a block of data. */ diff --git a/lang/cem/libcc/gen/bfill.c b/lang/cem/libcc/gen/bfill.c index a37cb80ad7..dcbc3caf71 100644 --- a/lang/cem/libcc/gen/bfill.c +++ b/lang/cem/libcc/gen/bfill.c @@ -1,8 +1,8 @@ /* $Id$ */ bfill(dst, len, fill) - register char *dst; - register int len; - register int fill; + char *dst; + int len; + int fill; { while (--len >= 0) *dst++ = fill; diff --git a/lang/cem/libcc/gen/bzero.c b/lang/cem/libcc/gen/bzero.c index d2e86db920..d688a43265 100644 --- a/lang/cem/libcc/gen/bzero.c +++ b/lang/cem/libcc/gen/bzero.c @@ -1,6 +1,6 @@ /* $Id$ */ bzero(b, l) - register char *b; + char *b; { while (l-- > 0) *b++ = 0; } diff --git a/lang/cem/libcc/gen/calloc.c b/lang/cem/libcc/gen/calloc.c index 556ddd5442..d0173dbf44 100644 --- a/lang/cem/libcc/gen/calloc.c +++ b/lang/cem/libcc/gen/calloc.c @@ -4,8 +4,8 @@ char * calloc(nelem, elsize) unsigned int nelem, elsize; { - register char *p; - register long *q; + char *p; + long *q; unsigned int size = ALIGN(nelem * elsize); extern char *malloc(); diff --git a/lang/cem/libcc/gen/closedir.c b/lang/cem/libcc/gen/closedir.c index a2d194d4ef..8976f6e7ed 100644 --- a/lang/cem/libcc/gen/closedir.c +++ b/lang/cem/libcc/gen/closedir.c @@ -6,7 +6,7 @@ * close a directory. */ closedir(dirp) -register DIR *dirp; +DIR *dirp; { if (dirp->dd_fd >= 0) close(dirp->dd_fd); dirp->dd_fd = -1; diff --git a/lang/cem/libcc/gen/crypt.c b/lang/cem/libcc/gen/crypt.c index 452cf80a29..7f86ede7a2 100644 --- a/lang/cem/libcc/gen/crypt.c +++ b/lang/cem/libcc/gen/crypt.c @@ -116,9 +116,9 @@ static int rots[] = { static transpose(data, t, n) - register struct block *data; - register struct ordering *t; - register int n; + struct block *data; + struct ordering *t; + int n; { struct block x; @@ -131,10 +131,10 @@ transpose(data, t, n) static rotate(key) - register struct block *key; + struct block *key; { - register unsigned char *p = key->b_data; - register unsigned char *ep = &(key->b_data[55]); + unsigned char *p = key->b_data; + unsigned char *ep = &(key->b_data[55]); int data0 = key->b_data[0], data28 = key->b_data[28]; while (p++ < ep) *(p-1) = *p; @@ -147,11 +147,11 @@ static struct ordering *EP = &etr; static f(i, key, a, x) struct block *key, *a; - register struct block *x; + struct block *x; { struct block e, ikey, y; int k; - register unsigned char *p, *q, *r; + unsigned char *p, *q, *r; e = *a; transpose(&e, EP, 48); @@ -166,7 +166,7 @@ f(i, key, a, x) } q = x->b_data; for (k = 0; k < 8; k++) { - register int xb, r; + int xb, r; r = *p++ << 5; r += *p++ << 3; @@ -186,7 +186,7 @@ f(i, key, a, x) } setkey(k) - register char *k; + char *k; { key = *((struct block *) k); @@ -196,13 +196,13 @@ setkey(k) encrypt(blck, edflag) char *blck; { - register struct block *p = (struct block *) blck; - register int i; + struct block *p = (struct block *) blck; + int i; transpose(p, &InitialTr, 64); for (i = 15; i>= 0; i--) { int j = edflag ? i : 15 - i; - register int k; + int k; struct block b, x; b = *p; @@ -220,7 +220,7 @@ encrypt(blck, edflag) char * crypt(pw,salt) - register char *pw; + char *pw; char *salt; { /* Unfortunately, I had to look at the sources of V7 crypt. @@ -230,12 +230,12 @@ crypt(pw,salt) char pwb[66]; static char result[16]; - register char *p = pwb; + char *p = pwb; struct ordering new_etr; - register int i; + int i; while (*pw && p < &pwb[64]) { - register int j = 7; + int j = 7; while (j--) { *p++ = (*pw >> j) & 01; @@ -252,8 +252,8 @@ crypt(pw,salt) new_etr = etr; EP = &new_etr; for (i = 0; i < 2; i++) { - register char c = *salt++; - register int j; + char c = *salt++; + int j; result[i] = c; if ( c > 'Z') c -= 6 + 7 + '.'; /* c was a lower case letter */ @@ -278,8 +278,8 @@ crypt(pw,salt) p = pwb; pw = result+2; while (p < &pwb[66]) { - register int c = 0; - register int j = 6; + int c = 0; + int j = 6; while (j--) { c <<= 1; diff --git a/lang/cem/libcc/gen/execvp.c b/lang/cem/libcc/gen/execvp.c index 438b791b3a..dfe807a8f4 100644 --- a/lang/cem/libcc/gen/execvp.c +++ b/lang/cem/libcc/gen/execvp.c @@ -12,15 +12,15 @@ execvp(name, argv) char *name, **argv; { char *path = getenv("PATH"); - register char *c = ""; + char *c = ""; char progname[1024]; if (path == 0) path = ":/bin:/usr/bin"; if (! index(name, '/')) c = path; do { - register char *p = progname; - register char *n = name; + char *p = progname; + char *n = name; char *c1 = c; while (*c && *c != ':') { diff --git a/lang/cem/libcc/gen/ext_comp.c b/lang/cem/libcc/gen/ext_comp.c index c4cd66c4fa..6b54571358 100644 --- a/lang/cem/libcc/gen/ext_comp.c +++ b/lang/cem/libcc/gen/ext_comp.c @@ -36,12 +36,12 @@ struct EXTEND *e1,*e2,*e3; /* Multiply the extended numbers e1 and e2, and put the result in e3. */ - register int i,j; /* loop control */ + int i,j; /* loop control */ unsigned short mp[4]; unsigned short mc[4]; unsigned short result[8]; /* result */ - register unsigned short *pres; + unsigned short *pres; /* first save the sign (XOR) */ e3->sign = e1->sign ^ e2->sign; @@ -249,7 +249,7 @@ b64_add(e1,e2) */ struct mantissa *e1,*e2; { - register int overflow; + int overflow; int carry; /* add higher pair of 32 bits */ @@ -473,7 +473,7 @@ _str_ext_cvt(s, ss, e) struct EXTEND *e; { /* Like strtod, but for extended precision */ - register int c; + int c; int dotseen = 0; int digitseen = 0; int exp = 0; @@ -552,8 +552,8 @@ _ext_str_cvt(e, ndigit, decpt, sign, ecvtflag) /* Like cvt(), but for extended precision */ static char buf[NDIGITS+1]; - register char *p = buf; - register char *pe; + char *p = buf; + char *pe; int findex = 0; if (ndigit < 0) ndigit = 0; @@ -569,7 +569,7 @@ _ext_str_cvt(e, ndigit, decpt, sign, ecvtflag) *decpt = 0; if (e->m1 != 0) { - register struct EXTEND *pp = &big_ten_powers[1]; + struct EXTEND *pp = &big_ten_powers[1]; while(cmp_ext(e,pp) >= 0) pp++; pp--; @@ -674,7 +674,7 @@ _dbl_ext_cvt(value, e) /* Convert double to extended */ int exponent; - register int i; + int i; value = frexp(value, &exponent); e->sign = value < 0.0; diff --git a/lang/cem/libcc/gen/ffc.c b/lang/cem/libcc/gen/ffc.c index 8bd5c74a0b..1a6f4dbf84 100644 --- a/lang/cem/libcc/gen/ffc.c +++ b/lang/cem/libcc/gen/ffc.c @@ -1,8 +1,8 @@ /* $Id$ */ ffc(i) - register int i; + int i; { - register int n; + int n; for (n = 8*sizeof(int); n > 0; n--, i >>= 1) if (!(i&1)) diff --git a/lang/cem/libcc/gen/ffs.c b/lang/cem/libcc/gen/ffs.c index c80313ae15..3eb4717d50 100644 --- a/lang/cem/libcc/gen/ffs.c +++ b/lang/cem/libcc/gen/ffs.c @@ -1,8 +1,8 @@ /* $Id$ */ ffs(i) - register int i; + int i; { - register int n; + int n; for (n = 8*sizeof(int); n > 0; n--, i >>= 1) if ((i&1)) diff --git a/lang/cem/libcc/gen/gcvt.c b/lang/cem/libcc/gen/gcvt.c index fda0ba44a8..896b55670d 100644 --- a/lang/cem/libcc/gen/gcvt.c +++ b/lang/cem/libcc/gen/gcvt.c @@ -11,9 +11,9 @@ gcvt(value, ndigit, buf) int ndigit; { int sign, dp; - register char *s1, *s2; - register int i; - register int nndigit = ndigit; + char *s1, *s2; + int i; + int nndigit = ndigit; s1 = ecvt(value, ndigit, &dp, &sign); s2 = buf; diff --git a/lang/cem/libcc/gen/getenv.c b/lang/cem/libcc/gen/getenv.c index 8e81b23d00..4eb4f275ee 100644 --- a/lang/cem/libcc/gen/getenv.c +++ b/lang/cem/libcc/gen/getenv.c @@ -1,9 +1,9 @@ /* $Id$ */ char *getenv(name) -register char *name; +char *name; { extern char **environ; - register char **v = environ, *p, *q; + char **v = environ, *p, *q; if (v == 0 || name == 0) return 0; while ((p = *v++) != 0) { diff --git a/lang/cem/libcc/gen/getlogin.c b/lang/cem/libcc/gen/getlogin.c index 9d5d4f02f3..1895440478 100644 --- a/lang/cem/libcc/gen/getlogin.c +++ b/lang/cem/libcc/gen/getlogin.c @@ -32,7 +32,7 @@ getlogin() static char name[sizeof(ut.ut_name) + 1]; int slotno = ttyslot(); int fd; - register char *p, *q; + char *p, *q; if (! slotno || !(fd = open(UTMPFILE, 0))) return 0; lseek(fd, (long) slotno * sizeof(ut), 0); diff --git a/lang/cem/libcc/gen/gmtime.c b/lang/cem/libcc/gen/gmtime.c index b46bda8cc9..c397d93204 100644 --- a/lang/cem/libcc/gen/gmtime.c +++ b/lang/cem/libcc/gen/gmtime.c @@ -14,8 +14,8 @@ gmtime(clock) long cl = *clock; long dayclock, dayno; static struct tm tm_buf; - register struct tm *pbuf = &tm_buf; - register int *months = monthsize; + struct tm *pbuf = &tm_buf; + int *months = monthsize; int year = 1970; dayclock = cl % SECS_DAY; diff --git a/lang/cem/libcc/gen/index.c b/lang/cem/libcc/gen/index.c index f5c938a1a4..345f0cd1a0 100644 --- a/lang/cem/libcc/gen/index.c +++ b/lang/cem/libcc/gen/index.c @@ -1,6 +1,6 @@ /* $Id$ */ char *index(s, c) -register char *s, c; +char *s, c; { do { if (*s == c) diff --git a/lang/cem/libcc/gen/l3.c b/lang/cem/libcc/gen/l3.c index e634991a5f..80a30d947d 100644 --- a/lang/cem/libcc/gen/l3.c +++ b/lang/cem/libcc/gen/l3.c @@ -1,8 +1,8 @@ /* $Id$ */ ltol3(cp, lp, n) -register char *cp; -register long *lp; -register int n; +char *cp; +long *lp; +int n; { while (n-- > 0) { *cp++ = (*lp >> 16); @@ -12,9 +12,9 @@ register int n; } l3tol(lp, cp, n) -register long *lp; +long *lp; char *cp; -register int n; +int n; { unsigned char *a = (unsigned char *) cp; diff --git a/lang/cem/libcc/gen/localtime.c b/lang/cem/libcc/gen/localtime.c index 3ebf0a04f0..b24bebaead 100644 --- a/lang/cem/libcc/gen/localtime.c +++ b/lang/cem/libcc/gen/localtime.c @@ -7,8 +7,8 @@ static int last_sunday(d, t) - register int d; - register struct tm *t; + int d; + struct tm *t; { int first = FIRSTSUNDAY(t); @@ -29,7 +29,7 @@ struct tm * localtime(clock) long *clock; { - register struct tm *gmt; + struct tm *gmt; long cl; int begindst, enddst; extern int __daylight; diff --git a/lang/cem/libcc/gen/malloc.c b/lang/cem/libcc/gen/malloc.c index d7555e3896..2e35085cfc 100644 --- a/lang/cem/libcc/gen/malloc.c +++ b/lang/cem/libcc/gen/malloc.c @@ -44,7 +44,7 @@ static char *_bottom, *_top, *_empty; static grow(len) unsigned len; { - register char *p; + char *p; ASSERT(NextSlot(_top) == 0); p = (char *) Align((ptrint)_top + len, BRKSIZE); @@ -60,8 +60,8 @@ unsigned len; char *malloc(size) unsigned size; { - register char *prev, *p, *next, *new; - register unsigned len, ntries; + char *prev, *p, *next, *new; + unsigned len, ntries; if (size == 0) size = PTRSIZE; /* avoid slots less that 2*PTRSIZE */ @@ -108,8 +108,8 @@ char *realloc(old, size) char *old; unsigned size; { - register char *prev, *p, *next, *new; - register unsigned len, n; + char *prev, *p, *next, *new; + unsigned len, n; len = Align(size, PTRSIZE) + PTRSIZE; next = NextSlot(old); @@ -153,7 +153,7 @@ unsigned size; free(p) char *p; { - register char *prev, *next; + char *prev, *next; ASSERT(NextSlot(p) > p); for (prev = 0, next = _empty; next != 0; prev = next, next = NextFree(next)) diff --git a/lang/cem/libcc/gen/memccpy.c b/lang/cem/libcc/gen/memccpy.c index 0e5bb2950a..17964c0ff9 100644 --- a/lang/cem/libcc/gen/memccpy.c +++ b/lang/cem/libcc/gen/memccpy.c @@ -1,8 +1,8 @@ /* $Id$ */ char * memccpy(dst, src, c, n) - register char *dst, *src; - register int n; + char *dst, *src; + int n; { while (n-- > 0) { if ((*dst++ = *src++) == c) return (char *) dst; diff --git a/lang/cem/libcc/gen/memchr.c b/lang/cem/libcc/gen/memchr.c index 41ad36964e..60d2fc5edb 100644 --- a/lang/cem/libcc/gen/memchr.c +++ b/lang/cem/libcc/gen/memchr.c @@ -2,9 +2,9 @@ char * memchr(s, c, n) char *s; -register int n; +int n; { - register unsigned char *s1 = (unsigned char *) s; + unsigned char *s1 = (unsigned char *) s; c &= 0377; while (n-- > 0) { diff --git a/lang/cem/libcc/gen/memcmp.c b/lang/cem/libcc/gen/memcmp.c index 2e4ed6718f..2a5d8055d3 100644 --- a/lang/cem/libcc/gen/memcmp.c +++ b/lang/cem/libcc/gen/memcmp.c @@ -1,7 +1,7 @@ /* $Id$ */ int memcmp(s1, s2, n) -register char *s1, *s2; +char *s1, *s2; { /* Compare 2 strings. */ diff --git a/lang/cem/libcc/gen/memcpy.c b/lang/cem/libcc/gen/memcpy.c index de5ad1731f..d637dda933 100644 --- a/lang/cem/libcc/gen/memcpy.c +++ b/lang/cem/libcc/gen/memcpy.c @@ -1,8 +1,8 @@ /* $Id$ */ char * memcpy(s1, s2, n) -register char *s1, *s2; -register int n; +char *s1, *s2; +int n; { /* Copy a block of data. */ diff --git a/lang/cem/libcc/gen/memset.c b/lang/cem/libcc/gen/memset.c index 2ffec45fd1..405ea7db18 100644 --- a/lang/cem/libcc/gen/memset.c +++ b/lang/cem/libcc/gen/memset.c @@ -2,9 +2,9 @@ char * memset(s, c, n) char *s; - register int n; + int n; { - register char *s1 = s; + char *s1 = s; while (n--) { *s1++ = c; diff --git a/lang/cem/libcc/gen/mktemp.c b/lang/cem/libcc/gen/mktemp.c index 3504ee8515..e0709bd8e7 100644 --- a/lang/cem/libcc/gen/mktemp.c +++ b/lang/cem/libcc/gen/mktemp.c @@ -4,8 +4,8 @@ char *mktemp(template) char *template; { - register int pid, k; - register char *p; + int pid, k; + char *p; pid = getpid(); /* get process id as semi-unique number */ p = template; diff --git a/lang/cem/libcc/gen/opendir.c b/lang/cem/libcc/gen/opendir.c index ba61e0a9f8..44b631048f 100644 --- a/lang/cem/libcc/gen/opendir.c +++ b/lang/cem/libcc/gen/opendir.c @@ -9,8 +9,8 @@ DIR *opendir(name) char *name; { - register DIR *dirp; - register int fd; + DIR *dirp; + int fd; struct stat stbuf; long siz; extern char *malloc(); diff --git a/lang/cem/libcc/gen/procentry.c b/lang/cem/libcc/gen/procentry.c index ef0e168e7f..d830f3db23 100644 --- a/lang/cem/libcc/gen/procentry.c +++ b/lang/cem/libcc/gen/procentry.c @@ -21,7 +21,7 @@ static int level = 0 ; static wrs() ; procentry(name) char *name ; { - register int count ; + int count ; count=level++ ; while ( count-- ) { @@ -30,7 +30,7 @@ procentry(name) char *name ; { wrs("Entering ");wrs(name);wrs("\n") ; } procexit(name) char *name ; { - register int count ; + int count ; count= --level ; while ( count-- ) { @@ -38,6 +38,6 @@ procexit(name) char *name ; { } wrs("Leaving ");wrs(name);wrs("\n") ; } -static wrs(s) register char *s ; { +static wrs(s) char *s ; { write(2,s,strlen(s)) ; } diff --git a/lang/cem/libcc/gen/qsort.c b/lang/cem/libcc/gen/qsort.c index d058cd253a..c29c315217 100644 --- a/lang/cem/libcc/gen/qsort.c +++ b/lang/cem/libcc/gen/qsort.c @@ -18,10 +18,10 @@ qsort(base, nel, width, compar) static qsort1(a1, a2, width) char *a1, *a2; - register int width; + int width; { - register char *left, *right; - register char *lefteq, *righteq; + char *left, *right; + char *lefteq, *righteq; int cmp; for (;;) { @@ -114,10 +114,10 @@ qsort1(a1, a2, width) static qexchange(p, q, n) - register char *p, *q; - register int n; + char *p, *q; + int n; { - register int c; + int c; while (n-- > 0) { c = *p; @@ -128,10 +128,10 @@ qexchange(p, q, n) static q3exchange(p, q, r, n) - register char *p, *q, *r; - register int n; + char *p, *q, *r; + int n; { - register int c; + int c; while (n-- > 0) { c = *p; diff --git a/lang/cem/libcc/gen/readdir.c b/lang/cem/libcc/gen/readdir.c index 0d96b9a215..b9693579c2 100644 --- a/lang/cem/libcc/gen/readdir.c +++ b/lang/cem/libcc/gen/readdir.c @@ -20,9 +20,9 @@ struct olddirect { * get next entry in a directory. */ struct direct *readdir(dirp) -register DIR *dirp; +DIR *dirp; { - register struct olddirect *dp; + struct olddirect *dp; static struct direct dir; for (;;) { diff --git a/lang/cem/libcc/gen/rindex.c b/lang/cem/libcc/gen/rindex.c index f346f397de..66ed60157d 100644 --- a/lang/cem/libcc/gen/rindex.c +++ b/lang/cem/libcc/gen/rindex.c @@ -1,8 +1,8 @@ /* $Id$ */ char *rindex(s, c) -register char *s, c; +char *s, c; { - register char *result; + char *result; result = 0; do diff --git a/lang/cem/libcc/gen/seekdir.c b/lang/cem/libcc/gen/seekdir.c index 1c32a2aac1..a932018507 100644 --- a/lang/cem/libcc/gen/seekdir.c +++ b/lang/cem/libcc/gen/seekdir.c @@ -7,7 +7,7 @@ * Only values returned by "telldir" should be passed to seekdir. */ seekdir(dirp, loc) -register DIR *dirp; +DIR *dirp; long loc; { long curloc, base, offset; diff --git a/lang/cem/libcc/gen/stb.c b/lang/cem/libcc/gen/stb.c index 3b55ff5721..3efbdd16d0 100644 --- a/lang/cem/libcc/gen/stb.c +++ b/lang/cem/libcc/gen/stb.c @@ -2,7 +2,7 @@ /* library routine for copying structs */ __stb(n, f, t) - register char *f, *t; register n; + char *f, *t; n; { if (n > 0) do diff --git a/lang/cem/libcc/gen/strcat.c b/lang/cem/libcc/gen/strcat.c index 1251567150..ae8b9cd318 100644 --- a/lang/cem/libcc/gen/strcat.c +++ b/lang/cem/libcc/gen/strcat.c @@ -1,6 +1,6 @@ /* $Id$ */ char *strcat(s1, s2) -register char *s1, *s2; +char *s1, *s2; { /* Append s2 to the end of s1. */ diff --git a/lang/cem/libcc/gen/strchr.c b/lang/cem/libcc/gen/strchr.c index ab0fe7c3dd..80a715fd74 100644 --- a/lang/cem/libcc/gen/strchr.c +++ b/lang/cem/libcc/gen/strchr.c @@ -1,6 +1,6 @@ /* $Id$ */ char *strchr(s, c) -register char *s, c; +char *s, c; { do { if (*s == c) diff --git a/lang/cem/libcc/gen/strcmp.c b/lang/cem/libcc/gen/strcmp.c index 6dcfffe066..4e13d6936a 100644 --- a/lang/cem/libcc/gen/strcmp.c +++ b/lang/cem/libcc/gen/strcmp.c @@ -1,7 +1,7 @@ /* $Id$ */ int strcmp(s, t) - register char *s, *t; + char *s, *t; { while (*s == *t++) if (*s++ == '\0') diff --git a/lang/cem/libcc/gen/strcpy.c b/lang/cem/libcc/gen/strcpy.c index 1533dbad34..3b2008ddf5 100644 --- a/lang/cem/libcc/gen/strcpy.c +++ b/lang/cem/libcc/gen/strcpy.c @@ -1,6 +1,6 @@ /* $Id$ */ char *strcpy(s1, s2) -register char *s1, *s2; +char *s1, *s2; { /* Copy s2 to s1. */ char *original = s1; diff --git a/lang/cem/libcc/gen/strcspn.c b/lang/cem/libcc/gen/strcspn.c index 98b5fbff42..d4e31cd6a8 100644 --- a/lang/cem/libcc/gen/strcspn.c +++ b/lang/cem/libcc/gen/strcspn.c @@ -4,7 +4,7 @@ strcspn(string, notin) char *string; char *notin; { - register char *s1, *s2; + char *s1, *s2; for (s1 = string; *s1; s1++) { for(s2 = notin; *s2 != *s1 && *s2; s2++) /* nothing */ ; diff --git a/lang/cem/libcc/gen/strlen.c b/lang/cem/libcc/gen/strlen.c index fb829eedf1..5e752d109e 100644 --- a/lang/cem/libcc/gen/strlen.c +++ b/lang/cem/libcc/gen/strlen.c @@ -3,7 +3,7 @@ int strlen(s) char *s; { - register char *b = s; + char *b = s; while (*b++) ; diff --git a/lang/cem/libcc/gen/strncat.c b/lang/cem/libcc/gen/strncat.c index e37f75b50d..b33e8f2ac3 100644 --- a/lang/cem/libcc/gen/strncat.c +++ b/lang/cem/libcc/gen/strncat.c @@ -1,6 +1,6 @@ /* $Id$ */ char *strncat(s1, s2, n) -register char *s1, *s2; +char *s1, *s2; int n; { /* Append s2 to the end of s1, but no more than n characters */ diff --git a/lang/cem/libcc/gen/strncmp.c b/lang/cem/libcc/gen/strncmp.c index d8796b5ff9..552f70922c 100644 --- a/lang/cem/libcc/gen/strncmp.c +++ b/lang/cem/libcc/gen/strncmp.c @@ -1,8 +1,8 @@ /* $Id$ */ int strncmp(s, t, n) - register char *s, *t; - register int n; + char *s, *t; + int n; { while (n-- > 0) { if (*s == *t++) { diff --git a/lang/cem/libcc/gen/strncpy.c b/lang/cem/libcc/gen/strncpy.c index b7e293b7d2..d10abf9750 100644 --- a/lang/cem/libcc/gen/strncpy.c +++ b/lang/cem/libcc/gen/strncpy.c @@ -1,7 +1,7 @@ /* $Id$ */ char *strncpy(s1, s2, n) -register char *s1, *s2; +char *s1, *s2; int n; { /* Copy s2 to s1, but at most n characters. */ diff --git a/lang/cem/libcc/gen/strpbrk.c b/lang/cem/libcc/gen/strpbrk.c index f2436fdda9..dedda64c01 100644 --- a/lang/cem/libcc/gen/strpbrk.c +++ b/lang/cem/libcc/gen/strpbrk.c @@ -1,9 +1,9 @@ /* $Id$ */ char * strpbrk(string, brk) - register char *string, *brk; + char *string, *brk; { - register char *s1; + char *s1; while (*string) { for (s1 = brk; *s1 && *s1 != *string; s1++) /* nothing */ ; diff --git a/lang/cem/libcc/gen/strrchr.c b/lang/cem/libcc/gen/strrchr.c index d119b67e32..eec6791837 100644 --- a/lang/cem/libcc/gen/strrchr.c +++ b/lang/cem/libcc/gen/strrchr.c @@ -1,8 +1,8 @@ /* $Id$ */ char *strrchr(s, c) -register char *s, c; +char *s, c; { - register char *result; + char *result; result = 0; do diff --git a/lang/cem/libcc/gen/strspn.c b/lang/cem/libcc/gen/strspn.c index cca92a2ecd..1c3dfb8757 100644 --- a/lang/cem/libcc/gen/strspn.c +++ b/lang/cem/libcc/gen/strspn.c @@ -4,7 +4,7 @@ strspn(string, in) char *string; char *in; { - register char *s1, *s2; + char *s1, *s2; for (s1 = string; *s1; s1++) { for (s2 = in; *s2 && *s2 != *s1; s2++) /* nothing */ ; diff --git a/lang/cem/libcc/gen/strstr.c b/lang/cem/libcc/gen/strstr.c index 28ff3a5b8e..e5ad24e684 100644 --- a/lang/cem/libcc/gen/strstr.c +++ b/lang/cem/libcc/gen/strstr.c @@ -2,7 +2,7 @@ /* find first occurrence of wanted in s */ char * strstr(s, wanted) - register char *s, *wanted; + char *s, *wanted; { int len = strlen(wanted); diff --git a/lang/cem/libcc/gen/strtok.c b/lang/cem/libcc/gen/strtok.c index 1555e3e1c0..3c9c067754 100644 --- a/lang/cem/libcc/gen/strtok.c +++ b/lang/cem/libcc/gen/strtok.c @@ -3,10 +3,10 @@ extern char *strpbrk(); char * strtok(string, separators) - register char *string; + char *string; char *separators; { - register char *s1, *s2; + char *s1, *s2; static char *savestring; if (!string) string = savestring; diff --git a/lang/cem/libcc/gen/strtol.c b/lang/cem/libcc/gen/strtol.c index 5c93f59e7b..2561fea83a 100644 --- a/lang/cem/libcc/gen/strtol.c +++ b/lang/cem/libcc/gen/strtol.c @@ -8,12 +8,12 @@ long int strtol(nptr, endptr, base) - register char *nptr; + char *nptr; char **endptr; { - register int v; - register long val = 0; - register int c; + int v; + long val = 0; + int c; int sign = 1; char *startnptr = nptr, *nrstart; diff --git a/lang/cem/libcc/gen/swab.c b/lang/cem/libcc/gen/swab.c index cc59a0a044..a6507a8248 100644 --- a/lang/cem/libcc/gen/swab.c +++ b/lang/cem/libcc/gen/swab.c @@ -1,6 +1,6 @@ /* $Id$ */ swab(from, to, nbytes) - register char *from, *to; + char *from, *to; { nbytes /= 2; while (nbytes-- > 0) { diff --git a/lang/cem/libcc/gen/ttyname.c b/lang/cem/libcc/gen/ttyname.c index ad991ac293..2d88f5407e 100644 --- a/lang/cem/libcc/gen/ttyname.c +++ b/lang/cem/libcc/gen/ttyname.c @@ -12,7 +12,7 @@ ttyname(filedes) { static char result[MAXNAMLEN + 1 + 5]; DIR *dirp; - register struct direct *dp; + struct direct *dp; struct stat fdstat; ino_t inode; dev_t device; diff --git a/lang/cem/libcc/gen/ttyslot.c b/lang/cem/libcc/gen/ttyslot.c index 9dd90b4d3d..fd29e5944d 100644 --- a/lang/cem/libcc/gen/ttyslot.c +++ b/lang/cem/libcc/gen/ttyslot.c @@ -25,7 +25,7 @@ char *rindex(); ttyslot() { - register char *tp, *p; + char *tp, *p; int fd; int retval = 1; #ifdef __USG diff --git a/lang/cem/libcc/gen/tzset.c b/lang/cem/libcc/gen/tzset.c index 388c1af6c8..fc01f656c2 100644 --- a/lang/cem/libcc/gen/tzset.c +++ b/lang/cem/libcc/gen/tzset.c @@ -55,10 +55,10 @@ tzset() { extern char *getenv(); - register char *p = getenv("TZ"); + char *p = getenv("TZ"); if (p && *p) { - register int n = 0; + int n = 0; int sign = 1; strncpy(__tzname[0], p, 3); diff --git a/lang/cem/libcc/math/jn.c b/lang/cem/libcc/math/jn.c index 49d8343646..b863864b53 100644 --- a/lang/cem/libcc/math/jn.c +++ b/lang/cem/libcc/math/jn.c @@ -26,7 +26,7 @@ yn(n, x) int negative = 0; extern double y0(), y1(); double yn1, yn2; - register int i; + int i; if (x <= 0) { errno = EDOM; @@ -83,7 +83,7 @@ jn(n, x) increasing n, so we use that. */ double jn2 = j0(x), jn1 = j1(x); - register int i; + int i; for (i = 1; i < n; i++) { double tmp = jn1; @@ -94,7 +94,7 @@ jn(n, x) } { /* we first compute j(n,x)/j(n-1,x) */ - register int i; + int i; double quotient = 0.0; double xsqr = x*x; double jn1, jn2; diff --git a/lang/cem/libcc/math/test.c b/lang/cem/libcc/math/test.c index e681f092ed..a281e2304c 100644 --- a/lang/cem/libcc/math/test.c +++ b/lang/cem/libcc/math/test.c @@ -177,7 +177,7 @@ testbessel() #define J10__PI_2 0.00000002326614794865976450546482206 /* j10(pi/2) */ extern double j0(), j1(), jn(), yn(); - register int n; + int n; double x; extern char *sprintf(); char buf[100]; diff --git a/lang/cem/libcc/stdio/doprnt.c b/lang/cem/libcc/stdio/doprnt.c index 0000e8c67d..3fa80592fa 100644 --- a/lang/cem/libcc/stdio/doprnt.c +++ b/lang/cem/libcc/stdio/doprnt.c @@ -11,8 +11,8 @@ extern char *gcvt(); # define wsize(par) ( (sizeof par) / sizeof (int) ) -static char *gnum(f,ip,app) register char *f; int *ip; va_list *app; { - register int i,c; +static char *gnum(f,ip,app) char *f; int *ip; va_list *app; { + int i,c; if (*f == '*') { *ip = va_arg((*app), int); @@ -64,9 +64,9 @@ static char *l_compute(l1,d,s) long l1; char *s; { #endif _doprnt(fmt,ap,stream) - register char *fmt; va_list ap ; FILE *stream; + char *fmt; va_list ap ; FILE *stream; { - register char *s; + char *s; #ifndef NOLONG long l; int lflag ; @@ -79,7 +79,7 @@ _doprnt(fmt,ap,stream) #endif int inte ; unsigned int uint ; - register int j ; + int j ; int i,c,rjust,width,ndigit,ndfnd,zfill; char *oldfmt,*s1,buf[1025]; @@ -223,7 +223,7 @@ _doprnt(fmt,ap,stream) } #ifndef NOFLOAT if (capitalE) { - register char *p = buf; + char *p = buf; capitalE=0; while (*p && *p != 'e') p++; if (*p == 'e') *p = 'E'; diff --git a/lang/cem/libcc/stdio/doscan.c b/lang/cem/libcc/stdio/doscan.c index 30419ac787..e392180e0f 100644 --- a/lang/cem/libcc/stdio/doscan.c +++ b/lang/cem/libcc/stdio/doscan.c @@ -21,7 +21,7 @@ static char Xtable[128]; */ _doscanf (iop, format, ap) -register FILE *iop; +FILE *iop; char *format; /* the format control string */ va_list ap; { @@ -37,7 +37,7 @@ va_list ap; int done_some; /* true if we have seen some data */ int reverse; /* reverse the checking in [...] */ int kind; - register int ic; + int ic; #ifndef NOFLOAT extern double atof(); int dotseen; @@ -155,7 +155,7 @@ va_list ap; case 'c': if (!widflag) width = 1; - { register char *p; + { char *p; if (do_assign) p = va_arg(ap, char *); while (width-- && ic >= 0) { @@ -173,7 +173,7 @@ va_list ap; case 's': if (!widflag) width = 0xffff; - { register char *p; + { char *p; if (do_assign) p = va_arg(ap, char *); while (width-- && !isspace (ic) && ic > 0) { @@ -202,7 +202,7 @@ va_list ap; } else reverse = 0; - { register char *c; + { char *c; for (c = Xtable; c < &Xtable[128]; c++) *c = 0; } while (*format && *format != ']') { @@ -211,7 +211,7 @@ va_list ap; if (!*format) goto quit; - { register char *p; + { char *p; if (do_assign) p = va_arg(ap, char *); while (width-- && ic > 0 && @@ -234,7 +234,7 @@ va_list ap; #ifndef NOFLOAT: case 'e': case 'f': { - register char *c = buffer; + char *c = buffer; if (!widflag) width = 127; if (width >= 128) width = 127; diff --git a/lang/cem/libcc/stdio/fclose.c b/lang/cem/libcc/stdio/fclose.c index fddfe6a8db..46978de7cd 100644 --- a/lang/cem/libcc/stdio/fclose.c +++ b/lang/cem/libcc/stdio/fclose.c @@ -4,7 +4,7 @@ fclose(fp) FILE *fp; { - register int i; + int i; for (i=0; i<_NFILES; i++) if (fp == _io_table[i]) { diff --git a/lang/cem/libcc/stdio/fdopen.c b/lang/cem/libcc/stdio/fdopen.c index 1aa1499f67..ed251d5d45 100644 --- a/lang/cem/libcc/stdio/fdopen.c +++ b/lang/cem/libcc/stdio/fdopen.c @@ -4,7 +4,7 @@ FILE *fdopen(fd,mode) char *mode; { - register int i; + int i; FILE *fp; char *malloc(); int flags = 0; diff --git a/lang/cem/libcc/stdio/fgetc.c b/lang/cem/libcc/stdio/fgetc.c index d7b08e44a5..a2dcb8433d 100644 --- a/lang/cem/libcc/stdio/fgetc.c +++ b/lang/cem/libcc/stdio/fgetc.c @@ -2,7 +2,7 @@ #include fgetc(f) - register FILE *f; + FILE *f; { return getc(f); } diff --git a/lang/cem/libcc/stdio/fgets.c b/lang/cem/libcc/stdio/fgets.c index fb0d17e209..dfeb2d95e5 100644 --- a/lang/cem/libcc/stdio/fgets.c +++ b/lang/cem/libcc/stdio/fgets.c @@ -6,8 +6,8 @@ char *str; unsigned n; FILE *file; { - register int ch; - register char *ptr; + int ch; + char *ptr; ptr = str; while ( --n > 0 && (ch = getc(file)) != EOF){ diff --git a/lang/cem/libcc/stdio/fillbuf.c b/lang/cem/libcc/stdio/fillbuf.c index c42104eafe..4fc43afb2d 100644 --- a/lang/cem/libcc/stdio/fillbuf.c +++ b/lang/cem/libcc/stdio/fillbuf.c @@ -4,7 +4,7 @@ char *malloc(); _fillbuf(iop) -register FILE *iop; +FILE *iop; { static unsigned char ch[_NFILES]; diff --git a/lang/cem/libcc/stdio/fltpr.c b/lang/cem/libcc/stdio/fltpr.c index cab5253c77..7da2c70a21 100644 --- a/lang/cem/libcc/stdio/fltpr.c +++ b/lang/cem/libcc/stdio/fltpr.c @@ -6,11 +6,11 @@ extern char *ecvt(); char * _pfloat(r,s,n,b) double r; - register char *s; + char *s; { - register char *s1; + char *s1; int sign,dp; - register int i; + int i; if (b == 0) n = 6; @@ -35,9 +35,9 @@ _pfloat(r,s,n,b) return(s); } -char *_pscien(r,s,n,b) float r; register char *s; { +char *_pscien(r,s,n,b) float r; char *s; { int sign,dp; - register char *s1; + char *s1; if (b == 0) n = 7; diff --git a/lang/cem/libcc/stdio/flushbuf.c b/lang/cem/libcc/stdio/flushbuf.c index d5d5188d3c..e9146ea754 100644 --- a/lang/cem/libcc/stdio/flushbuf.c +++ b/lang/cem/libcc/stdio/flushbuf.c @@ -3,7 +3,7 @@ int _flushbuf(c, iop) - register FILE *iop; + FILE *iop; { if (fileno(iop) < 0) return EOF; if (! io_testflag(iop, IO_UNBUFF)) { @@ -57,7 +57,7 @@ _flushbuf(c, iop) _cleanup() { - register int i; + int i; for ( i = 0 ; i < _NFILES ; i++ ) if ( _io_table[i] != NULL ) diff --git a/lang/cem/libcc/stdio/fopen.c b/lang/cem/libcc/stdio/fopen.c index 073ac83828..aa81800f88 100644 --- a/lang/cem/libcc/stdio/fopen.c +++ b/lang/cem/libcc/stdio/fopen.c @@ -7,7 +7,7 @@ FILE *fopen(name,mode) char *name , *mode; { - register int i; + int i; FILE *fp; char *malloc(); int fd, diff --git a/lang/cem/libcc/stdio/fputc.c b/lang/cem/libcc/stdio/fputc.c index 7dd5d93ad3..36116b1c6a 100644 --- a/lang/cem/libcc/stdio/fputc.c +++ b/lang/cem/libcc/stdio/fputc.c @@ -2,7 +2,7 @@ #include fputc(c, iop) - register FILE *iop; + FILE *iop; { return putc(c, iop); } diff --git a/lang/cem/libcc/stdio/fputs.c b/lang/cem/libcc/stdio/fputs.c index f19f7bef9b..5a3327ca8f 100644 --- a/lang/cem/libcc/stdio/fputs.c +++ b/lang/cem/libcc/stdio/fputs.c @@ -2,8 +2,8 @@ #include fputs(s,file) -register char *s; -register FILE *file; +char *s; +FILE *file; { while ( *s ) putc(*s++,file); diff --git a/lang/cem/libcc/stdio/fread.c b/lang/cem/libcc/stdio/fread.c index 2c75a797c1..d4ce84648d 100644 --- a/lang/cem/libcc/stdio/fread.c +++ b/lang/cem/libcc/stdio/fread.c @@ -2,9 +2,9 @@ #include fread(ptr, size, count, file) -register char *ptr; +char *ptr; unsigned size, count; -register FILE *file; +FILE *file; { int c; unsigned ndone = 0, s; diff --git a/lang/cem/libcc/stdio/freopen.c b/lang/cem/libcc/stdio/freopen.c index 5a4da1a352..8c685711ff 100644 --- a/lang/cem/libcc/stdio/freopen.c +++ b/lang/cem/libcc/stdio/freopen.c @@ -6,7 +6,7 @@ FILE *freopen(name,mode,fp) char *name , *mode; -register FILE *fp; +FILE *fp; { int fd, flags = fp->_flags & ~(IO_WRITEMODE|IO_READMODE|IO_ERR|IO_EOF|IO_PERPRINTF); @@ -38,7 +38,7 @@ register FILE *fp; } if (fd < 0) { - register int i; + int i; for (i = 0; i < _NFILES; i++) { if (fp == _io_table[i]) { diff --git a/lang/cem/libcc/stdio/fwrite.c b/lang/cem/libcc/stdio/fwrite.c index 25f451c8db..a63fffd26d 100644 --- a/lang/cem/libcc/stdio/fwrite.c +++ b/lang/cem/libcc/stdio/fwrite.c @@ -3,8 +3,8 @@ fwrite(ptr, size, count, file) unsigned size, count; -register char *ptr; -register FILE *file; +char *ptr; +FILE *file; { unsigned s; unsigned ndone = 0; diff --git a/lang/cem/libcc/stdio/getgrent.c b/lang/cem/libcc/stdio/getgrent.c index e9d3093240..09c1bd0421 100644 --- a/lang/cem/libcc/stdio/getgrent.c +++ b/lang/cem/libcc/stdio/getgrent.c @@ -7,16 +7,16 @@ #include -#define PRIVATE static - -PRIVATE char _gr_file[] = "/etc/group"; -PRIVATE char _grbuf[256]; -PRIVATE char _buffer[1024]; -PRIVATE char *_pnt; -PRIVATE char *_buf; -PRIVATE int _gfd = -1; -PRIVATE int _bufcnt; -PRIVATE struct group grp; +#define static static + +static char _gr_file[] = "/etc/group"; +static char _grbuf[256]; +static char _buffer[1024]; +static char *_pnt; +static char *_buf; +static int _gfd = -1; +static int _bufcnt; +static struct group grp; setgrent () { diff --git a/lang/cem/libcc/stdio/getopt.c b/lang/cem/libcc/stdio/getopt.c index f7b3b084d5..272970a198 100644 --- a/lang/cem/libcc/stdio/getopt.c +++ b/lang/cem/libcc/stdio/getopt.c @@ -17,8 +17,8 @@ getopt (argc, argv, opts) char **argv, *opts; { static int sp = 1; - register c; - register char *cp; + c; + char *cp; if (sp == 1) if (optind >= argc || diff --git a/lang/cem/libcc/stdio/getpw.c b/lang/cem/libcc/stdio/getpw.c index 732cc465ae..e55f693b1d 100644 --- a/lang/cem/libcc/stdio/getpw.c +++ b/lang/cem/libcc/stdio/getpw.c @@ -5,9 +5,9 @@ getpw(uid, buf) int uid; char buf[]; { - register FILE *pwf; - register int ch, i; - register char *bp; + FILE *pwf; + int ch, i; + char *bp; pwf = fopen("/etc/passwd", "r"); if (pwf == NULL) return(1); diff --git a/lang/cem/libcc/stdio/getpwent.c b/lang/cem/libcc/stdio/getpwent.c index 4fd7ee50a8..e6803a9a3d 100644 --- a/lang/cem/libcc/stdio/getpwent.c +++ b/lang/cem/libcc/stdio/getpwent.c @@ -9,17 +9,17 @@ #include -#define PRIVATE static +#define static static -PRIVATE char _pw_file[] = "/etc/passwd"; -PRIVATE char _pwbuf[256]; -PRIVATE char _buffer[1024]; -PRIVATE char *_pnt; -PRIVATE char *_buf; -PRIVATE int _pw = -1; -PRIVATE int _bufcnt; -PRIVATE struct passwd pwd; +static char _pw_file[] = "/etc/passwd"; +static char _pwbuf[256]; +static char _buffer[1024]; +static char *_pnt; +static char *_buf; +static int _pw = -1; +static int _bufcnt; +static struct passwd pwd; setpwent() { diff --git a/lang/cem/libcc/stdio/gets.c b/lang/cem/libcc/stdio/gets.c index 925e7c93b6..79effdb157 100644 --- a/lang/cem/libcc/stdio/gets.c +++ b/lang/cem/libcc/stdio/gets.c @@ -4,8 +4,8 @@ char *gets(str) char *str; { - register int ch; - register char *ptr; + int ch; + char *ptr; ptr = str; while ((ch = getc(stdin)) != EOF && ch != '\n') diff --git a/lang/cem/libcc/stdio/getw.c b/lang/cem/libcc/stdio/getw.c index a7c9630239..4e75ac27c5 100644 --- a/lang/cem/libcc/stdio/getw.c +++ b/lang/cem/libcc/stdio/getw.c @@ -2,11 +2,11 @@ #include int getw(iop) - register FILE *iop; + FILE *iop; { - register int cnt = sizeof(int); + int cnt = sizeof(int); int w; - register char *p = (char *) &w; + char *p = (char *) &w; while (cnt--) { *p++ = getc(iop); diff --git a/lang/cem/libcc/stdio/popen.c b/lang/cem/libcc/stdio/popen.c index fd73d63059..fd8347cbd5 100644 --- a/lang/cem/libcc/stdio/popen.c +++ b/lang/cem/libcc/stdio/popen.c @@ -18,7 +18,7 @@ popen(command, type) if (pid == 0) { /* child */ - register int *p; + int *p; for (p = pids; p < &pids[20]; p++) { if (*p) close(p - pids); diff --git a/lang/cem/libcc/stdio/puts.c b/lang/cem/libcc/stdio/puts.c index 90c2a2fff3..a34bc9a5e1 100644 --- a/lang/cem/libcc/stdio/puts.c +++ b/lang/cem/libcc/stdio/puts.c @@ -2,9 +2,9 @@ #include puts(s) -register char *s; +char *s; { - register FILE *file = stdout; + FILE *file = stdout; while ( *s ) putc(*s++,file); putc('\n', file); diff --git a/lang/cem/libcc/stdio/putw.c b/lang/cem/libcc/stdio/putw.c index aa18590c49..18d139e406 100644 --- a/lang/cem/libcc/stdio/putw.c +++ b/lang/cem/libcc/stdio/putw.c @@ -3,10 +3,10 @@ int putw(w, iop) - register FILE *iop; + FILE *iop; { - register int cnt = sizeof(int); - register char *p = (char *) &w; + int cnt = sizeof(int); + char *p = (char *) &w; while (cnt--) { putc(*p++, iop); diff --git a/lang/cem/libcc/stdio/setbuf.c b/lang/cem/libcc/stdio/setbuf.c index a6703eb332..107a3f2db1 100644 --- a/lang/cem/libcc/stdio/setbuf.c +++ b/lang/cem/libcc/stdio/setbuf.c @@ -2,7 +2,7 @@ #include setbuf(iop, buffer) -register FILE *iop; +FILE *iop; char *buffer; { if ( iop->_buf && io_testflag(iop,IO_MYBUF) ) diff --git a/lang/cem/libcc/stdio/termcap.c b/lang/cem/libcc/stdio/termcap.c index 5174a8b88f..907a17f99e 100644 --- a/lang/cem/libcc/stdio/termcap.c +++ b/lang/cem/libcc/stdio/termcap.c @@ -84,8 +84,8 @@ match_name(buf, name) char *buf; char *name; { - register char *tp = buf; - register char *np; + char *tp = buf; + char *np; for (;;) { for (np = name; *np && *tp == *np; np++, tp++) { } @@ -106,7 +106,7 @@ check_for_tc() char *savcapab = capab; char buf[1024]; char terminalname[128]; - register char *p = capab + strlen(capab) - 2, *q; + char *p = capab + strlen(capab) - 2, *q; while (*p != ':') if (--p < capab) @@ -281,7 +281,7 @@ char *cm; int destcol; int destline; { - register char *rp; + char *rp; static char ret[24]; char added[16]; int *dp = &destline; @@ -402,7 +402,7 @@ static int tens_of_ms_p_char[] = { /* index as returned by gtty */ */ int tputs(cp, affcnt, outc) -register char *cp; +char *cp; int affcnt; int (*outc)(); { diff --git a/lang/cem/libcc/stdio/timezone.c b/lang/cem/libcc/stdio/timezone.c index 230dcfeb19..4c9d3672fa 100644 --- a/lang/cem/libcc/stdio/timezone.c +++ b/lang/cem/libcc/stdio/timezone.c @@ -28,9 +28,9 @@ static struct zonetable { char * timezone(zone, dst) { - register struct zonetable *p = zonetable; + struct zonetable *p = zonetable; static char buf[16]; - register char *c; + char *c; int i; while (p->offset != -1) { diff --git a/lang/cem/libcc/stdio/ungetc.c b/lang/cem/libcc/stdio/ungetc.c index 0e3303d4ce..419f006993 100644 --- a/lang/cem/libcc/stdio/ungetc.c +++ b/lang/cem/libcc/stdio/ungetc.c @@ -3,7 +3,7 @@ ungetc(ch, iop) int ch; -register FILE *iop; +FILE *iop; { unsigned char *p; diff --git a/lang/cem/lint/lpass2/checkargs.c b/lang/cem/lint/lpass2/checkargs.c index 6e0c774fad..c97c0cd6a9 100644 --- a/lang/cem/lint/lpass2/checkargs.c +++ b/lang/cem/lint/lpass2/checkargs.c @@ -14,14 +14,14 @@ extern char *strcpy(); #define streq(s1,s2) (strcmp(s1, s2) == 0) /* a format is developed into a normal parameter definition */ -PRIVATE int is_formatargs; /* present or not */ -PRIVATE char formatargs[1000]; /* the definitions */ +static int is_formatargs; /* present or not */ +static char formatargs[1000]; /* the definitions */ -PRIVATE chk_argtps(); -PRIVATE char *next_argtype(); -PRIVATE int type_match(); -PRIVATE form_type(); -PRIVATE conv_format(); +static chk_argtps(); +static char *next_argtype(); +static int type_match(); +static form_type(); +static conv_format(); int type_equal(act, form) @@ -54,7 +54,7 @@ chk_args(id, def) if (is_formatargs) { /* there was a format */ - register int i; + int i; /* skip over the actuals already covered */ for (i = 0; i < nrargs; i++) { @@ -67,7 +67,7 @@ chk_args(id, def) } } -PRIVATE chk_argtps(id, def, nrargs, act_tp, form_tp) +static chk_argtps(id, def, nrargs, act_tp, form_tp) struct inpdef *id; /* the actual call */ struct inpdef *def; /* 0 for format-derived definition */ int *nrargs; /* in-out parameter, counting */ @@ -75,8 +75,8 @@ PRIVATE chk_argtps(id, def, nrargs, act_tp, form_tp) char *form_tp; /* formal type definitions */ { while (*act_tp && *form_tp && *form_tp != '.') { - register char *act_start = act_tp; - register char *form_start = form_tp; + char *act_start = act_tp; + char *form_start = form_tp; /* isolate actual argument type */ act_tp = next_argtype(act_tp); @@ -121,7 +121,7 @@ PRIVATE chk_argtps(id, def, nrargs, act_tp, form_tp) } } -PRIVATE char * +static char * next_argtype(tp) char *tp; { @@ -135,7 +135,7 @@ next_argtype(tp) } int -PRIVATE type_match(id, act, form) +static type_match(id, act, form) struct inpdef *id; char *act, *form; { @@ -167,18 +167,18 @@ PRIVATE type_match(id, act, form) return 0; } -PRIVATE conv_format(id, act, form) +static conv_format(id, act, form) struct inpdef *id; char *act, *form; { /* convert the actual format into a def-list, using the formal format (form) as a map to convert from %X to type */ - register char *fmt = &formatargs[0]; + char *fmt = &formatargs[0]; is_formatargs = 1; while (*act) { - register char *map; + char *map; /* find next conversion specification */ while (*act && *act != '%') { @@ -218,7 +218,7 @@ PRIVATE conv_format(id, act, form) map = form; while (*map) { - register char *cs = act; + char *cs = act; /* find next conversion mapping */ while (*map && *map != '%') { @@ -232,7 +232,7 @@ PRIVATE conv_format(id, act, form) } while (*map && *map != '=') { - register int match = 0; + int match = 0; if (*map == '[') { while (*map && *map != ']') { @@ -265,7 +265,7 @@ PRIVATE conv_format(id, act, form) *fmt++ = '\0'; } -PRIVATE form_type(buff, tp) +static form_type(buff, tp) char buff[]; char *tp; { /* store a formatted version of tp in buff diff --git a/lang/cem/lint/lpass2/lpass2.c b/lang/cem/lint/lpass2/lpass2.c index 6775f170b8..0103f9dc51 100644 --- a/lang/cem/lint/lpass2/lpass2.c +++ b/lang/cem/lint/lpass2/lpass2.c @@ -16,24 +16,24 @@ extern char *strcpy(); #define streq(s1,s2) (strcmp(s1, s2) == 0) -PRIVATE char cur_name[NAMESIZE]; -PRIVATE struct inpdef *dot, *lib, *proto, *ext, *sta; - -PRIVATE one_name(); -PRIVATE chk_def(); -PRIVATE ext_decls(); -PRIVATE proto_defs(); -PRIVATE chk_proto(); -PRIVATE ext_def(); -PRIVATE get_dot(); -PRIVATE init(); -PRIVATE lib_def(); -PRIVATE one_ext_decl(); -PRIVATE one_func_call(); -PRIVATE one_var_usage(); -PRIVATE stat_def(); -PRIVATE statics(); -PRIVATE usage(); +static char cur_name[NAMESIZE]; +static struct inpdef *dot, *lib, *proto, *ext, *sta; + +static one_name(); +static chk_def(); +static ext_decls(); +static proto_defs(); +static chk_proto(); +static ext_def(); +static get_dot(); +static init(); +static lib_def(); +static one_ext_decl(); +static one_func_call(); +static one_var_usage(); +static stat_def(); +static statics(); +static usage(); #define same_name() (dot && streq(cur_name, dot->id_name)) #define same_obj(stnr) (same_name() && dot->id_statnr == stnr) @@ -71,7 +71,7 @@ main(argc, argv) char loptions[128]; static char *table[] = {0}; -PRIVATE init(argc, argv) +static init(argc, argv) char *argv[]; { /* @@ -83,8 +83,8 @@ PRIVATE init(argc, argv) init_class(); while (argc > 1 && argv[1][0] == '-') { - register char *arg = &argv[1][1]; - register char ch; + char *arg = &argv[1][1]; + char ch; while (ch = *arg++) { switch (ch) { @@ -106,7 +106,7 @@ PRIVATE init(argc, argv) } } -PRIVATE get_dot() +static get_dot() { if (!get_id(dot)) { free_inpdef(dot); @@ -118,7 +118,7 @@ PRIVATE get_dot() } } -PRIVATE one_name() +static one_name() { strcpy(cur_name, dot->id_name); lib_def(); @@ -142,7 +142,7 @@ PRIVATE one_name() /******** L I B R A R Y ********/ -PRIVATE lib_def() +static lib_def() { if (same_obj(0) && is_class(dot, CL_LIB)) { lib = dot; @@ -158,7 +158,7 @@ PRIVATE lib_def() /******** P R O T O T Y P E S ********/ -PRIVATE proto_defs() +static proto_defs() { if (same_obj(0) && dot->id_class == PFDF) { if (lib) { @@ -175,7 +175,7 @@ PRIVATE proto_defs() } } -PRIVATE chk_proto(def) +static chk_proto(def) struct inpdef *def; { if (proto->id_args) { @@ -190,7 +190,7 @@ PRIVATE chk_proto(def) /******** E X T E R N ********/ -PRIVATE ext_def() +static ext_def() { if (same_obj(0) && is_class(dot, CL_EXT|CL_DEF)) { if (lib && !proto) { @@ -211,7 +211,7 @@ PRIVATE ext_def() } } -PRIVATE ext_decls() +static ext_decls() { while (same_obj(0) && dot->id_class == EFDC) { one_ext_decl("function", "variable", CL_VAR); @@ -226,7 +226,7 @@ PRIVATE ext_decls() } } -PRIVATE one_ext_decl(kind, other_kind, other_class) +static one_ext_decl(kind, other_kind, other_class) char *kind; char *other_kind; int other_class; @@ -268,13 +268,13 @@ PRIVATE one_ext_decl(kind, other_kind, other_class) /******** U S A G E ********/ -PRIVATE usage(stnr) +static usage(stnr) int stnr; { - register struct inpdef *def = + struct inpdef *def = (stnr ? sta : proto ? proto : ext ? ext : lib ? lib : 0); - register int VU_count = 0; - register int VU_samefile = 0; + int VU_count = 0; + int VU_samefile = 0; while (same_obj(stnr) && dot->id_class == FC) { one_func_call(def); @@ -289,7 +289,7 @@ PRIVATE usage(stnr) } if (def && loptions['h']) { - register char *fn = def->id_file; + char *fn = def->id_file; if ( stnr == 0 && VU_count == 1 @@ -305,7 +305,7 @@ PRIVATE usage(stnr) } } -PRIVATE one_func_call(def) +static one_func_call(def) struct inpdef *def; { if (!def) { @@ -347,7 +347,7 @@ PRIVATE one_func_call(def) get_dot(); } -PRIVATE one_var_usage(def) +static one_var_usage(def) struct inpdef *def; { if (!def) { @@ -367,7 +367,7 @@ PRIVATE one_var_usage(def) /******** S T A T I C ********/ -PRIVATE statics() +static statics() { while (same_name()) { int stnr = dot->id_statnr; @@ -394,7 +394,7 @@ PRIVATE statics() } } -PRIVATE stat_def(stnr) +static stat_def(stnr) int stnr; { if (same_obj(stnr) && is_class(dot, CL_STAT|CL_DEF)) { @@ -423,7 +423,7 @@ PRIVATE stat_def(stnr) } } -PRIVATE chk_def(def) +static chk_def(def) struct inpdef *def; { if (!def) diff --git a/lang/cem/lint/lpass2/private.h b/lang/cem/lint/lpass2/private.h index 3341e86098..08f656ed0d 100644 --- a/lang/cem/lint/lpass2/private.h +++ b/lang/cem/lint/lpass2/private.h @@ -4,4 +4,4 @@ */ /* $Id$ */ -#define PRIVATE static /* or empty, for adb and profile */ +#define static static /* or empty, for adb and profile */ diff --git a/lang/cem/lint/lpass2/read.c b/lang/cem/lint/lpass2/read.c index e772617962..4e84603b6c 100644 --- a/lang/cem/lint/lpass2/read.c +++ b/lang/cem/lint/lpass2/read.c @@ -26,12 +26,12 @@ int LineNr = 1; #define pushback(ch) PushBack(); if (ch=='\n') LineNr-- /* all the ReadX() functions return 0 upon EOI */ -PRIVATE int ReadString(); -PRIVATE int ReadInt(); -PRIVATE int ReadArgs(); -PRIVATE int ReadArg(); +static int ReadString(); +static int ReadInt(); +static int ReadArgs(); +static int ReadArg(); -PRIVATE SkipChar(); +static SkipChar(); int get_id(id) @@ -85,7 +85,7 @@ get_id(id) return 1; } -PRIVATE int +static int ReadString(buf, delim, maxsize) char *buf; { @@ -119,7 +119,7 @@ ReadString(buf, delim, maxsize) return 1; } -PRIVATE int +static int ReadInt(ip) int *ip; { @@ -152,7 +152,7 @@ ReadInt(ip) return 1; } -PRIVATE int +static int ReadArgs(nrargs, buf) char *buf; { @@ -182,7 +182,7 @@ ReadArgs(nrargs, buf) return 1; } -PRIVATE int +static int ReadArg(buf, size) char *buf; int size; @@ -208,7 +208,7 @@ ReadArg(buf, size) } } -PRIVATE SkipChar(ch) +static SkipChar(ch) { int c; diff --git a/lang/cem/lint/lpass2/report.c b/lang/cem/lint/lpass2/report.c index 779b63cae6..3188ffe91c 100644 --- a/lang/cem/lint/lpass2/report.c +++ b/lang/cem/lint/lpass2/report.c @@ -22,7 +22,7 @@ extern panic(char *, ...); extern int LineNr; -PRIVATE rep_loc(); +static rep_loc(); #if __STDC__ /* VARARGS */ @@ -43,8 +43,8 @@ report(va_alist) { char *fmt = va_arg(ap, char*); #endif - register char *f = fmt; - register char fc; + char *f = fmt; + char fc; /* First see if the first arg is an inpdef with a global file name not ending in .c; if so, @@ -52,9 +52,9 @@ report(va_alist) */ if (f[0] == '%' && f[1] == 'L') { /* it is an inpdef */ - register struct inpdef *id = + struct inpdef *id = va_arg(ap, struct inpdef *); - register char *fn = id->id_file; + char *fn = id->id_file; f += 2; @@ -75,9 +75,9 @@ report(va_alist) while ((fc = *f++)) { if (fc == '%') { switch (*f++) { - register struct inpdef *id; - register char *s; - register int i; + struct inpdef *id; + char *s; + int i; case 'L': /* a location item */ id = va_arg(ap, struct inpdef *); rep_loc(id); @@ -105,7 +105,7 @@ report(va_alist) va_end(ap); } -PRIVATE +static rep_loc(id) struct inpdef *id; { diff --git a/lang/fortran/comp/data.c b/lang/fortran/comp/data.c index 8d64ceb937..a12e3fc329 100644 --- a/lang/fortran/comp/data.c +++ b/lang/fortran/comp/data.c @@ -30,11 +30,11 @@ static char *cur_varname; /* another initializer, called from parser */ dataval(repp, valp) -register expptr repp, valp; +expptr repp, valp; { int i, nrep; ftnint elen; - register Addrp p; + Addrp p; Addrp nextdata(); if (parstate < INDATA) { @@ -81,13 +81,13 @@ register expptr repp, valp; Addrp nextdata(elenp) ftnint *elenp; { - register struct Impldoblock *ip; + struct Impldoblock *ip; struct Primblock *pp; - register Namep np; - register struct Rplblock *rp; + Namep np; + struct Rplblock *rp; tagptr p; expptr neltp; - register expptr q; + expptr q; int skip; ftnint off, vlen; @@ -222,17 +222,17 @@ LOCAL FILEP dfile; setdata(varp, valp, elen) -register Addrp varp; +Addrp varp; ftnint elen; -register Constp valp; +Constp valp; { struct Constblock con; - register int type; + int type; int i, k, valtype; ftnint offset; char *dataname(), *varname; static Addrp badvar; - register unsigned char *s; + unsigned char *s; static int last_lineno; static char *last_varname; @@ -346,7 +346,7 @@ char *dataname(stg,memno) long memno; { static char varname[64]; - register char *s, *t; + char *s, *t; char buf[16], *memname(); if (stg == STGCOMMON) { @@ -370,8 +370,8 @@ char *dataname(stg,memno) frdata(p0) chainp p0; { - register struct Chain *p; - register tagptr q; + struct Chain *p; + tagptr q; for(p = p0 ; p ; p = p->nextp) { @@ -403,10 +403,10 @@ int type; void make_param(p, e) - register struct Paramblock *p; + struct Paramblock *p; expptr e; { - register expptr q; + expptr q; p->vclass = CLPARAM; impldcl((Namep)p); diff --git a/lang/fortran/comp/equiv.c b/lang/fortran/comp/equiv.c index 65d6a2734f..b7553e2e6b 100644 --- a/lang/fortran/comp/equiv.c +++ b/lang/fortran/comp/equiv.c @@ -32,7 +32,7 @@ LOCAL eqvcommon(), eqveqv(), nsubs(); */ doequiv() { - register int i; + int i; int inequiv; /* True if one namep occurs in several EQUIV declarations */ int comno; /* Index into Extsym table of the last @@ -42,10 +42,10 @@ doequiv() ftnint comoffset; /* Index into the COMMON block */ ftnint offset; /* Offset from array base */ ftnint leng; - register struct Equivblock *equivdecl; - register struct Eqvchain *q; + struct Equivblock *equivdecl; + struct Eqvchain *q; struct Primblock *primp; - register Namep np; + Namep np; int k, k1, ns, pref, t; chainp cp; extern int type_pref[]; @@ -235,8 +235,8 @@ ftnint comoffset; { int ovarno; ftnint k, offq; - register Namep np; - register struct Eqvchain *q; + Namep np; + struct Eqvchain *q; if(comoffset + p->eqvbottom < 0) { @@ -308,8 +308,8 @@ LOCAL eqveqv(nvarno, ovarno, delta) int ovarno, nvarno; ftnint delta; { - register struct Equivblock *neweqv, *oldeqv; - register Namep np; + struct Equivblock *neweqv, *oldeqv; + Namep np; struct Eqvchain *q, *q1; neweqv = eqvclass + nvarno; @@ -338,9 +338,9 @@ ftnint delta; freqchain(p) -register struct Equivblock *p; +struct Equivblock *p; { - register struct Eqvchain *q, *oq; + struct Eqvchain *q, *oq; for(q = p->equivs ; q ; q = oq) { @@ -358,10 +358,10 @@ register struct Equivblock *p; list) */ LOCAL nsubs(p) -register struct Listblock *p; +struct Listblock *p; { - register int n; - register chainp q; + int n; + chainp q; n = 0; if(p) diff --git a/lang/fortran/comp/exec.c b/lang/fortran/comp/exec.c index 60a38b2337..dc78fa9525 100644 --- a/lang/fortran/comp/exec.c +++ b/lang/fortran/comp/exec.c @@ -55,7 +55,7 @@ expptr p; exelse() { - register struct Ctlframe *c; + struct Ctlframe *c; for(c = ctlstack; c->ctltype == CTLIFX; --c); if(c->ctltype == CTLIF) { @@ -101,7 +101,7 @@ new_endif() pushctl(code) int code; { - register int i; + int i; if(++ctlstack >= lastctl) many("loops or if-then-elses", 'c', maxctl); @@ -127,7 +127,7 @@ popctl() LOCAL poplab() { - register struct Labelblock *lp; + struct Labelblock *lp; for(lp = labeltab ; lp < highlabtab ; ++lp) if(lp->labdefined) @@ -161,8 +161,8 @@ struct Labelblock *lab; exequals(lp, rp) -register struct Primblock *lp; -register expptr rp; +struct Primblock *lp; +expptr rp; { if(lp->tag != TPRIM) { @@ -199,8 +199,8 @@ mkstfunct(lp, rp) struct Primblock *lp; expptr rp; { - register struct Primblock *p; - register Namep np; + struct Primblock *p; + Namep np; chainp args; laststfcn = thisstno; @@ -261,7 +261,7 @@ struct Listblock *args; int nstars; struct Labelblock *labels[ ]; { - register expptr p; + expptr p; if (name->vtype != TYSUBR) { if (name->vinfproc && !name->vcalled) { @@ -292,7 +292,7 @@ struct Labelblock *labels[ ]; exstop(stop, p) int stop; -register expptr p; +expptr p; { char *str; int n; @@ -359,10 +359,10 @@ int range; /* end label */ Namep loopname; chainp spec; /* input spec must have at least 2 exprs */ { - register expptr p; - register Namep np; + expptr p; + Namep np; chainp cp; /* loops over the fields in spec */ - register int i; + int i; int dotype; /* type of the index variable */ int incsign; /* sign of the increment, if it's constant */ @@ -471,7 +471,7 @@ chainp spec; /* input spec must have at least 2 exprs */ not yet consistent */ /* Declare the loop initialization value, casting it properly and declaring a - register if need be */ + if need be */ if (ISCONST (DOINIT) || !onetripflag) /* putx added 6-29-89 (mwm), not sure if fixtype is required, but I doubt it @@ -587,11 +587,11 @@ exenddo(np) enddo(here) int here; { - register struct Ctlframe *q; + struct Ctlframe *q; Namep np; /* name of the current DO index */ Addrp ap; - register int i; - register expptr e; + int i; + expptr e; /* Many DO's can end at the same statement, so keep looping over all nested indicies */ @@ -641,16 +641,16 @@ int here; } exassign(vname, labelval) - register Namep vname; + Namep vname; struct Labelblock *labelval; { Addrp p; expptr mkaddcon(); - register Addrp q; + Addrp q; static char nullstr[] = ""; char *fs; - register chainp cp, cpprev; - register ftnint k, stno; + chainp cp, cpprev; + ftnint k, stno; p = mkplace(vname); if( ! ONEOF(p->vtype, MSKINT|MSKADDR) ) { @@ -727,7 +727,7 @@ exarif(expr, neglab, zerlab, poslab) expptr expr; struct Labelblock *neglab, *zerlab, *poslab; { - register int lm, lz, lp; + int lm, lz, lp; lm = neglab->stateno; lz = zerlab->stateno; @@ -796,7 +796,7 @@ exar2(op, e, l1, l2) implement the alternate return mechanism */ exreturn(p) -register expptr p; +expptr p; { if(procclass != CLPROC) warn("RETURN statement in main or block data"); @@ -819,7 +819,7 @@ register expptr p; exasgoto(labvar) Namep labvar; { - register Addrp p; + Addrp p; void p1_asgoto(); p = mkplace(labvar); diff --git a/lang/fortran/comp/expr.c b/lang/fortran/comp/expr.c index 3b0939959a..9abf3efad2 100644 --- a/lang/fortran/comp/expr.c +++ b/lang/fortran/comp/expr.c @@ -38,9 +38,9 @@ extern char dflttype[26]; /* little routines to create constant blocks */ Constp mkconst(t) -register int t; +int t; { - register Constp p; + Constp p; p = ALLOC(Constblock); p->tag = TCONST; @@ -52,9 +52,9 @@ register int t; /* mklogcon -- Make Logical Constant */ expptr mklogcon(l) -register int l; +int l; { - register Constp p; + Constp p; p = mkconst(TYLOGICAL); p->Const.ci = l; @@ -68,7 +68,7 @@ register int l; expptr mkintcon(l) ftnint l; { - register Constp p; + Constp p; p = mkconst(tyint); p->Const.ci = l; @@ -81,9 +81,9 @@ ftnint l; /* mkaddcon -- Make Address Constant, given integer value */ expptr mkaddcon(l) -register long l; +long l; { - register Constp p; + Constp p; p = mkconst(TYADDR); p->Const.ci = l; @@ -96,10 +96,10 @@ register long l; to be TYREAL or TYDREAL */ expptr mkrealcon(t, d) - register int t; + int t; char *d; { - register Constp p; + Constp p; p = mkconst(t); p->Const.cds[0] = cds(d,CNULL); @@ -119,8 +119,8 @@ int shift; int leng; char *s; { - register Constp p; - register long x; + Constp p; + long x; p = mkconst(TYLONG); x = 0; @@ -144,10 +144,10 @@ char *s; expptr mkstrcon(l,v) int l; -register char *v; +char *v; { - register Constp p; - register char *s; + Constp p; + char *s; p = mkconst(TYCHAR); p->vleng = ICON(l); @@ -165,10 +165,10 @@ register char *v; values, each of which may be integer, real or double. */ expptr mkcxcon(realp,imagp) -register expptr realp, imagp; +expptr realp, imagp; { int rtype, itype; - register Constp p; + Constp p; expptr errnode(); rtype = realp->headblock.vtype; @@ -232,11 +232,11 @@ expptr errnode() bytes. */ expptr mkconv(t, p) -register int t; -register expptr p; +int t; +expptr p; { - register expptr q; - register int pt, charwarn = 1; + expptr q; + int pt, charwarn = 1; expptr opconv(); if (t >= 100) { @@ -286,7 +286,7 @@ expptr opconv(p, t) expptr p; int t; { - register expptr q; + expptr q; if (t == TYSUBR) err("illegal use of subroutine name"); @@ -310,11 +310,11 @@ expptr p; /* cpexpr - Returns a new copy of input expression p */ tagptr cpexpr(p) -register tagptr p; +tagptr p; { - register tagptr e; + tagptr e; int tag; - register chainp ep, pp; + chainp ep, pp; tagptr cpblock(); /* This table depends on the ordering of the T macros, e.g. TNAME */ @@ -397,9 +397,9 @@ register tagptr p; /* frexpr -- Free expression -- frees up memory used by expression p */ frexpr(p) -register tagptr p; +tagptr p; { - register chainp q; + chainp q; if(p == NULL) return; @@ -472,7 +472,7 @@ wronginf(np) names to address blocks */ expptr fixtype(p) -register tagptr p; +tagptr p; { if(p == 0) @@ -547,11 +547,11 @@ cplenexpr(p) returned */ expptr fixexpr(p) -register Exprp p; +Exprp p; { expptr lp; - register expptr rp; - register expptr q; + expptr rp; + expptr q; int opcode, ltype, rtype, ptype, mtype; if( ISERROR(p) ) @@ -747,9 +747,9 @@ fixargs(doput, p0) int doput; /* doput is true if constants need to be passed by reference */ struct Listblock *p0; { - register chainp p; - register tagptr q, t; - register int qtag; + chainp p; + tagptr q, t; + int qtag; int nargs; Addrp mkscalar(); @@ -799,9 +799,9 @@ struct Listblock *p0; io.c */ Addrp mkscalar(np) -register Namep np; +Namep np; { - register Addrp ap; + Addrp ap; vardcl(np); ap = mkaddr(np); @@ -811,7 +811,7 @@ register Namep np; */ if( !checksubs && np->vstg==STGARG) { - register struct Dimblock *dp; + struct Dimblock *dp; dp = np->vdim; frexpr(ap->memoffset); ap->memoffset = mkexpr(OPSTAR, @@ -828,10 +828,10 @@ register Namep np; adjust_arginfo(np) /* adjust arginfo to omit the length arg for the arg that we now know to be a character-valued function */ - register Namep np; + Namep np; { struct Entrypoint *ep; - register chainp args; + chainp args; Argtypes *at; for(ep = entries; ep; ep = ep->entnextp) @@ -846,12 +846,12 @@ adjust_arginfo(np) /* adjust arginfo to omit the length arg for the expptr mkfunct(p0) expptr p0; { - register struct Primblock *p = (struct Primblock *)p0; + struct Primblock *p = (struct Primblock *)p0; struct Entrypoint *ep; Addrp ap; Extsym *extp; - register Namep np; - register expptr q; + Namep np; + expptr q; expptr intrcall(); extern chainp new_procs; int k, nargs; @@ -983,13 +983,13 @@ LOCAL expptr stfcall(np, actlist) Namep np; struct Listblock *actlist; { - register chainp actuals; + chainp actuals; int nargs; chainp oactp, formals; int type; expptr Ln, Lq, q, q1, rhs, ap; Namep tnp; - register struct Rplblock *rp; + struct Rplblock *rp; struct Rplblock *tlist; static int inv_count; @@ -1098,10 +1098,10 @@ static int replaced; return an addrp with the appropriate stuff */ Addrp mkplace(np) -register Namep np; +Namep np; { - register Addrp s; - register struct Rplblock *rp; + Addrp s; + struct Rplblock *rp; int regn; /* is name on the replace list? */ @@ -1150,10 +1150,10 @@ register Namep np; translator will need this only to worry about the subscript stuff */ expptr mklhs(p) -register struct Primblock *p; +struct Primblock *p; { expptr suboffset(); - register Addrp s; + Addrp s; Namep np; if(p->tag != TPRIM) @@ -1227,9 +1227,9 @@ Namep np; objects are passed through untouched */ Addrp memversion(np) -register Namep np; +Namep np; { - register Addrp s; + Addrp s; if(np->vdovar==NO || (inregister(np)<0) ) return(NULL); @@ -1244,9 +1244,9 @@ register Namep np; /* inregister -- looks for the input name in the global list regnamep */ inregister(np) -register Namep np; +Namep np; { - register int i; + int i; for(i = 0 ; i < nregvar ; ++i) if(regnamep[i] == np) @@ -1260,7 +1260,7 @@ register Namep np; subscripts as arguments */ expptr suboffset(p) -register struct Primblock *p; +struct Primblock *p; { int n; expptr si, size; @@ -1269,7 +1269,7 @@ register struct Primblock *p; expptr subcheck(); struct Dimblock *dimp; expptr sub[MAXDIM+1]; - register Namep np; + Namep np; np = p->namep; offp = ICON(0); @@ -1335,7 +1335,7 @@ register struct Primblock *p; expptr subcheck(np, p) Namep np; -register expptr p; +expptr p; { struct Dimblock *dimp; expptr t, checkvar, checkcond, badcall; @@ -1401,10 +1401,10 @@ register expptr p; Addrp mkaddr(p) -register Namep p; +Namep p; { Extsym *extp; - register Addrp t; + Addrp t; Addrp intraddr(); int k; @@ -1478,7 +1478,7 @@ register Namep p; Addrp mkarg(type, argno) int type, argno; { - register Addrp p; + Addrp p; p = ALLOC(Addrblock); p->tag = TADDR; @@ -1511,8 +1511,8 @@ expptr mkprim(v0, args, substr) struct Nameblock nameblock; struct Headblock headblock; } *Primu; - register Primu v = (Primu)v0; - register struct Primblock *p; + Primu v = (Primu)v0; + struct Primblock *p; if(v->headblock.vclass == CLPARAM) { @@ -1560,7 +1560,7 @@ expptr mkprim(v0, args, substr) recursive references to the same function */ vardcl(v) -register Namep v; +Namep v; { struct Dimblock *t; expptr neltp; @@ -1629,9 +1629,9 @@ register Namep v; letter */ impldcl(p) -register Namep p; +Namep p; { - register int k; + int k; int type; ftnint leng; @@ -1683,9 +1683,9 @@ inferdcl(np,type) expptr mkexpr(opcode, lp, rp) int opcode; -register expptr lp, rp; +expptr lp, rp; { - register expptr e, e1; + expptr e, e1; int etype; int ltype, rtype; int ltag, rtag; @@ -1998,7 +1998,7 @@ register expptr lp, rp; /* cktype -- Check and return the type of the expression */ cktype(op, lt, rt) -register int op, lt, rt; +int op, lt, rt; { char *errs; @@ -2151,10 +2151,10 @@ register int op, lt, rt; LOCAL expptr fold(e) - register expptr e; + expptr e; { Constp p; - register expptr lp, rp; + expptr lp, rp; int etype, mtype, ltype, rtype, opcode; int i, bl, ll, lr; char *q, *s; @@ -2332,10 +2332,10 @@ fold(e) consconv(lt, lc, rc) int lt; - register Constp lc, rc; + Constp lc, rc; { int rt = rc->vtype; - register union Constant *lv = &lc->Const, *rv = &rc->Const; + union Constant *lv = &lc->Const, *rv = &rc->Const; lc->vtype = lt; if (ONEOF(lt, MSKREAL|MSKCOMPLEX) && ONEOF(rt, MSKREAL|MSKCOMPLEX)) { @@ -2394,9 +2394,9 @@ consconv(lt, lc, rc) /* Negate constant value -- changes the input node's value */ consnegop(p) -register Constp p; +Constp p; { - register char *s; + char *s; if (p->vstg) { if (ISCOMPLEX(p->vtype)) { @@ -2438,8 +2438,8 @@ conspower(p, ap, n) Constp p, ap; ftnint n; { - register union Constant *powp = &p->Const; - register int type; + union Constant *powp = &p->Const; + int type; struct Constblock x, x0; if (n == 1) { @@ -2524,7 +2524,7 @@ consbinop(opcode, type, cpp, app, bpp) int opcode, type; Constp cpp, app, bpp; { - register union Constant *ap = &app->Const, + union Constant *ap = &app->Const, *bp = &bpp->Const, *cp = &cpp->Const; int k; @@ -2714,9 +2714,9 @@ consbinop(opcode, type, cpp, app, bpp) /* conssgn - returns the sign of a Fortran constant */ conssgn(p) -register expptr p; +expptr p; { - register char *s; + char *s; if( ! ISCONST(p) ) Fatal( "sgn(nonconstant)" ); @@ -2763,9 +2763,9 @@ char *powint[ ] = { "pow_ii", "pow_ri", "pow_di", "pow_ci", "pow_zi" }; LOCAL expptr mkpower(p) -register expptr p; +expptr p; { - register expptr q, lp, rp; + expptr q, lp, rp; int ltype, rtype, mtype, tyi; lp = p->exprblock.leftp; @@ -2853,7 +2853,7 @@ register expptr p; LOCAL void zdiv(c, a, b) - register dcomplex *a, *b, *c; + dcomplex *a, *b, *c; { double ratio, den; double abr, abi; diff --git a/lang/fortran/comp/format.c b/lang/fortran/comp/format.c index 53cdcf8821..67cdc3762c 100644 --- a/lang/fortran/comp/format.c +++ b/lang/fortran/comp/format.c @@ -1083,7 +1083,7 @@ char *finalnl; write_formats(outfile) FILE *outfile; { - register struct Labelblock *lp; + struct Labelblock *lp; int first = 1; char *fs; @@ -1107,8 +1107,8 @@ write_formats(outfile) write_ioblocks(outfile) FILE *outfile; { - register iob_data *L; - register char *f, **s, *sep; + iob_data *L; + char *f, **s, *sep; nice_printf(outfile, "/* Fortran I/O blocks */\n"); L = iob_list = (iob_data *)revchain((chainp)iob_list); @@ -1137,7 +1137,7 @@ write_ioblocks(outfile) write_assigned_fmts(outfile) FILE *outfile; { - register chainp cp; + chainp cp; Namep np; int did_one = 0; @@ -1156,11 +1156,11 @@ write_assigned_fmts(outfile) static char * to_upper(s) - register char *s; + char *s; { static char buf[64]; - register char *t = buf; - register int c; + char *t = buf; + int c; while(*t++ = (c = *s++) >= 'a' && c <= 'z' ? c + 'A' - 'a' : c); return buf; } @@ -1206,8 +1206,8 @@ write_namelists(nmch, outfile) struct Dimblock *dimp; int i, nd, type; char *comma, *name; - register chainp q; - register Namep v; + chainp q; + Namep v; nice_printf(outfile, "/* Namelist stuff */\n\n"); for (entry = hashtab; entry < lasthash; ++entry) { @@ -1927,7 +1927,7 @@ p1getf(infile, result) { char buf[1324]; - register int k; + int k; k = fscanf (infile, "%s", buf); if (k < 1) diff --git a/lang/fortran/comp/formatdata.c b/lang/fortran/comp/formatdata.c index 408f07c451..718ef23062 100644 --- a/lang/fortran/comp/formatdata.c +++ b/lang/fortran/comp/formatdata.c @@ -397,7 +397,7 @@ int type; prev_val = vals = CHNULL; while (*pointer) { - register char *end_ptr, old_val; + char *end_ptr, old_val; /* Move pointer to the start of the next word */ @@ -600,7 +600,7 @@ make_one_const(type, storage, values) chainp values; { union Constant *Const; - register char **L; + char **L; if (type == TYCHAR) { char *str, *str_ptr; @@ -659,7 +659,7 @@ FILE *infile; int *vargroupp; char *name; { - register int i, c; + int i, c; c = getc (infile); @@ -685,7 +685,7 @@ rdlong (infile, n) FILE *infile; ftnint *n; { - register int c; + int c; for (c = getc (infile); !feof (infile) && isspace (c); c = getc (infile)) ; @@ -738,10 +738,10 @@ memno2info (memno, info) static chainp do_string(outfile, v, nloc) FILEP outfile; - register chainp v; + chainp v; ftnint *nloc; { - register chainp cp, v0; + chainp cp, v0; ftnint dloc, k, loc; unsigned long uk; char buf[8], *comma; @@ -787,10 +787,10 @@ do_string(outfile, v, nloc) static chainp Ado_string(outfile, v, nloc) FILEP outfile; - register chainp v; + chainp v; ftnint *nloc; { - register chainp cp, v0; + chainp cp, v0; ftnint dloc, k, loc; nice_printf(outfile, "\""); @@ -848,8 +848,8 @@ wr_equiv_init(outfile, memno, Values, iscomm) char *equiv_name (); int curtype, dtype, filltype, filltype1, j, k, wasblank, xtype; static char Blank[] = ""; - register char *comma = Blank; - register chainp cp, v; + char *comma = Blank; + chainp cp, v; chainp sentinel, values, v1; ftnint L, L1, dL, dloc, loc, loc0; union Constant Const; diff --git a/lang/fortran/comp/init.c b/lang/fortran/comp/init.c index 590ba13fa5..a197ef2e96 100644 --- a/lang/fortran/comp/init.c +++ b/lang/fortran/comp/init.c @@ -237,8 +237,8 @@ char *wh_first, *wh_next, *wh_last; fileinit() { - register char *s; - register int i, j; + char *s; + int i, j; extern void fmt_init(), mem_init(), np_init(); lastiolabno = 100000; @@ -287,10 +287,10 @@ fileinit() hashclear() /* clear hash table */ { - register struct Hashentry *hp; - register Namep p; - register struct Dimblock *q; - register int i; + struct Hashentry *hp; + Namep p; + struct Dimblock *q; + int i; for(hp = hashtab ; hp < lasthash ; ++hp) if(p = hp->varp) @@ -317,7 +317,7 @@ hashclear() /* clear hash table */ procinit() { - register struct Labelblock *lp; + struct Labelblock *lp; struct Chain *cp; int i; extern struct memblock *curmemblock, *firstmemblock; diff --git a/lang/fortran/comp/intr.c b/lang/fortran/comp/intr.c index 4920dee8c7..a3a6d8a76c 100644 --- a/lang/fortran/comp/intr.c +++ b/lang/fortran/comp/intr.c @@ -408,8 +408,8 @@ char *callbyvalue[ ] = void r8fix() /* adjust tables for -r8 */ { - register struct Intrblock *I; - register struct Specblock *S; + struct Intrblock *I; + struct Specblock *S; for(I = intrtab; I->intrfname[0]; I++) if (I->intrval.intrgroup != INTRGEN) @@ -483,8 +483,8 @@ int nargs; { int i, rettype; Addrp ap; - register struct Specblock *sp; - register struct Chain *cp; + struct Specblock *sp; + struct Chain *cp; expptr Inline(), mkcxcon(), mkrealcon(); expptr q, ep; int mtype; @@ -717,7 +717,7 @@ realcon contains intrfunct(s) char *s; { - register struct Intrblock *p; + struct Intrblock *p; for(p = intrtab; p->intrval.intrgroup!=INTREND ; ++p) { @@ -742,7 +742,7 @@ Addrp intraddr(np) Namep np; { Addrp q; - register struct Specblock *sp; + struct Specblock *sp; int f3field; if(np->vclass!=CLPROC || np->vprocclass!=PINTRINSIC) @@ -805,7 +805,7 @@ int fno; int type; struct Chain *args; { - register expptr q, t, t1; + expptr q, t, t1; switch(fno) { diff --git a/lang/fortran/comp/io.c b/lang/fortran/comp/io.c index f346b7f1b8..bf179cfaa8 100644 --- a/lang/fortran/comp/io.c +++ b/lang/fortran/comp/io.c @@ -283,7 +283,7 @@ LOCAL io_setup io_stuff[] = { fmtstmt(lp) -register struct Labelblock *lp; +struct Labelblock *lp; { if(lp == NULL) { @@ -309,8 +309,8 @@ struct Labelblock *lp; { int n; char *s0, *lexline(); - register char *s, *se, *t; - register k; + char *s, *se, *t; + k; s0 = s = lexline(&n); se = t = s + n; @@ -372,7 +372,7 @@ struct Labelblock *lp; startioctl() { - register int i; + int i; inioctl = YES; nioctl = 0; @@ -511,7 +511,7 @@ endioctl() iocname() { - register int i; + int i; int found, mask; found = 0; @@ -539,8 +539,8 @@ iocname() ioclause(n, p) -register int n; -register expptr p; +int n; +expptr p; { struct Ioclist *iocp; @@ -635,9 +635,9 @@ doiolist(p0) chainp p0; { chainp p; - register tagptr q; - register expptr qe; - register Namep qn; + tagptr q; + expptr qe; + Namep qn; Addrp tp, mkscalar(); int range; extern char *ohalign; @@ -722,12 +722,12 @@ doiolist(p0) LOCAL void putio(nelt, addr) expptr nelt; - register expptr addr; + expptr addr; { int type; - register expptr q; + expptr q; extern Constp mkconst(); - register Addrp c = 0; + Addrp c = 0; type = addr->headblock.vtype; if(ioformatted!=LISTDIRECTED && ISCOMPLEX(type) ) @@ -804,7 +804,7 @@ endio() LOCAL void putiocall(q) - register expptr q; + expptr q; { int tyintsave; @@ -828,10 +828,10 @@ putiocall(q) void fmtname(np, q) Namep np; - register Addrp q; + Addrp q; { - register int k; - register char *s, *t; + int k; + char *s, *t; extern chainp assigned_fmts; if (!np->vfmt_asg) { @@ -853,7 +853,7 @@ fmtname(np, q) LOCAL Addrp asg_addr(p) union Expression *p; { - register Addrp q; + Addrp q; if (p->tag != TPRIM) badtag("asg_addr", p->tag); @@ -870,10 +870,10 @@ LOCAL Addrp asg_addr(p) startrw() { - register expptr p; - register Namep np; - register Addrp unitp, fmtp, recp; - register expptr nump; + expptr p; + Namep np; + Addrp unitp, fmtp, recp; + expptr nump; Addrp mkscalar(); expptr mkaddcon(); int iostmt1; @@ -1119,7 +1119,7 @@ startrw() LOCAL void dofopen() { - register expptr p; + expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) ioset(TYIOINT, XUNIT, cpexpr(p) ); @@ -1153,7 +1153,7 @@ dofopen() LOCAL void dofclose() { - register expptr p; + expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { @@ -1169,7 +1169,7 @@ dofclose() LOCAL void dofinquire() { - register expptr p; + expptr p; if(p = V(IOSUNIT)) { if( V(IOSFILE) ) @@ -1203,7 +1203,7 @@ dofinquire() dofmove(subname) char *subname; { - register expptr p; + expptr p; if( (p = V(IOSUNIT)) && ISINT(p->headblock.vtype) ) { @@ -1219,11 +1219,11 @@ static int ioset_assign = OPASSIGN; LOCAL void ioset(type, offset, p) int type, offset; - register expptr p; + expptr p; { offset /= SZLONG; if(statstruct && ISCONST(p)) { - register char *s; + char *s; switch(type) { case TYADDR: /* stmt label */ s = "fmt_"; @@ -1239,7 +1239,7 @@ ioset(type, offset, p) frexpr(p); } else { - register Addrp q; + Addrp q; q = ALLOC(Addrblock); q->tag = TADDR; @@ -1255,7 +1255,7 @@ ioset(type, offset, p) if (type == TYADDR && p->tag == TCONST && p->constblock.vtype == TYADDR) { /* kludge */ - register Addrp p1; + Addrp p1; p1 = ALLOC(Addrblock); p1->tag = TADDR; p1->vtype = type; @@ -1281,7 +1281,7 @@ ioset(type, offset, p) LOCAL void iosetc(offset, p) int offset; - register expptr p; + expptr p; { extern Addrp putchop(); @@ -1300,7 +1300,7 @@ iosetc(offset, p) LOCAL void ioseta(offset, p) int offset; - register Addrp p; + Addrp p; { char *s, *s1; static char who[] = "ioseta"; @@ -1388,7 +1388,7 @@ ioseta(offset, p) iosetip(i, offset) int i, offset; { - register expptr p; + expptr p; if(p = V(i)) if(p->tag==TADDR && @@ -1409,7 +1409,7 @@ iosetip(i, offset) iosetlc(i, offp, offl) int i, offp, offl; { - register expptr p; + expptr p; if( (p = V(i)) && p->headblock.vtype==TYCHAR) ioset(TYIOINT, offl, cpexpr(p->headblock.vleng) ); iosetc(offp, p); diff --git a/lang/fortran/comp/lex.c b/lang/fortran/comp/lex.c index 12f171eb82..f7f565f238 100644 --- a/lang/fortran/comp/lex.c +++ b/lang/fortran/comp/lex.c @@ -316,8 +316,8 @@ char *name; LOCAL popinclude() { struct Inclfile *t; - register char *p; - register int k; + char *p; + int k; if(infile != stdin) clf(&infile, infname, 1); /* Close the input file */ @@ -358,7 +358,7 @@ putlineno() static char *lastfile = "??", *lastfile0 = "?"; static char fbuf[P1_FILENAME_MAX]; extern int gflag; - register char *s0, *s1; + char *s0, *s1; if (gflag) { if (lastline) { @@ -465,7 +465,7 @@ merged into one long card (hence the size of the buffer named sbuf) */ LOCAL int getcds() { - register char *p, *q; + char *p, *q; flush_comments (); top: @@ -529,10 +529,10 @@ getcds() static void bang(a,b,c,d,e) /* save ! comments */ char *a, *b, *c; - register char *d, *e; + char *d, *e; { char buf[COMMENT_BUFFER_SIZE + 1]; - register char *p, *pe; + char *p, *pe; p = buf; pe = buf + COMMENT_BUFFER_SIZE; @@ -565,10 +565,10 @@ It assumes that b points to currently empty storage somewhere in sbuf */ LOCAL int getcd(b, nocont) - register char *b; + char *b; { - register int c; - register char *p, *bend; + int c; + char *p, *bend; int speclin; /* Special line - true when the line is allowed to have more than 66 characters (e.g. the "&" shorthand for continuation, use of a "\t" @@ -827,7 +827,7 @@ getcd(b, nocont) LOCAL void crunch() { - register char *i, *j, *j0, *j1, *prvstr; + char *i, *j, *j0, *j1, *prvstr; int k, ten, nh, nh0, quote; /* i is the next input character to be looked at @@ -964,7 +964,7 @@ crunch() LOCAL void analyz() { - register char *i; + char *i; if(parlev != 0) { @@ -1038,8 +1038,8 @@ analyz() LOCAL int getkwd() { - register char *i, *j; - register struct Keylist *pk, *pend; + char *i, *j; + struct Keylist *pk, *pend; int k; if(! isalpha_(* USC nextch) ) @@ -1066,9 +1066,9 @@ getkwd() initkey() { - register struct Keylist *p; - register int i,j; - register char *s; + struct Keylist *p; + int i,j; + char *s; for(i = 0 ; i<26 ; ++i) keystart[i] = NULL; @@ -1092,8 +1092,8 @@ initkey() hexcheck(key) int key; { - register int radix; - register char *p; + int radix; + char *p; char *kind; switch(key) { @@ -1139,7 +1139,7 @@ int havdot, havexp, havdbl; int radix, val; struct Punctlist *pp; struct Dotlist *pd; - register int ch; + int ch; char *i, *j, *n1, *p; @@ -1411,8 +1411,8 @@ store_comment(str) static void flush_comments() { - register char *s, *s1; - register comment_buf *cb; + char *s, *s1; + comment_buf *cb; if (cbnext == cbinit) return; cbcur->last = cbnext; @@ -1434,7 +1434,7 @@ flush_comments() void unclassifiable() { - register char *s, *se; + char *s, *se; s = sbuf; se = lastch; diff --git a/lang/fortran/comp/main.c b/lang/fortran/comp/main.c index e8f4148b1b..bf3165ce48 100644 --- a/lang/fortran/comp/main.c +++ b/lang/fortran/comp/main.c @@ -286,8 +286,8 @@ comm2dcl() write_typedefs(outfile) FILE *outfile; { - register int i; - register char *s, *p = 0; + int i; + char *s, *p = 0; static char st[4] = { TYREAL, TYCOMPLEX, TYDCOMPLEX, TYCHAR }; static char stl[4] = { 'E', 'C', 'Z', 'H' }; @@ -320,10 +320,10 @@ write_typedefs(outfile) static void commonprotos(outfile) - register FILE *outfile; + FILE *outfile; { - register Extsym *e, *ee; - register Argtypes *at; + Extsym *e, *ee; + Argtypes *at; Atype *a, *ae; int k; extern int proc_protochanges; diff --git a/lang/fortran/comp/malloc.c b/lang/fortran/comp/malloc.c index e4414dad9a..7268bdcade 100644 --- a/lang/fortran/comp/malloc.c +++ b/lang/fortran/comp/malloc.c @@ -42,9 +42,9 @@ struct { char * malloc(size) -register unsigned size; +unsigned size; { - register struct mem *p, *q, *r, *s; + struct mem *p, *q, *r, *s; unsigned register k, m; extern char *sbrk(); char *top, *top1; diff --git a/lang/fortran/comp/mem.c b/lang/fortran/comp/mem.c index b90af8a14c..4ac96d7c31 100644 --- a/lang/fortran/comp/mem.c +++ b/lang/fortran/comp/mem.c @@ -86,7 +86,7 @@ mem(n, round) int n, round; { memblock *b; - register char *rv, *s; + char *rv, *s; if (round) #ifdef CRAY @@ -124,12 +124,12 @@ mem(n, round) char * tostring(s,n) - register char *s; + char *s; int n; { - register char *s1, *se, **sf; + char *s1, *se, **sf; char *rv, *s0; - register int k = n + 2, t; + int k = n + 2, t; sf = str_fmt; sf['%'] = "%"; @@ -155,18 +155,18 @@ tostring(s,n) char * cpstring(s) - register char *s; + char *s; { return strcpy(mem(strlen(s)+1,0), s); } void new_iob_data(ios, name) - register io_setup *ios; + io_setup *ios; char *name; { - register iob_data *iod; - register char **s, **se; + iob_data *iod; + char **s, **se; iod = (iob_data *) mem(sizeof(iob_data) + ios->nelt*sizeof(char *), 1); diff --git a/lang/fortran/comp/memset.c b/lang/fortran/comp/memset.c index 98a7ce72a7..82ab53061d 100644 --- a/lang/fortran/comp/memset.c +++ b/lang/fortran/comp/memset.c @@ -31,10 +31,10 @@ this software. int memcmp(s1, s2, n) - register char *s1, *s2; + char *s1, *s2; int n; { - register char *se; + char *se; for(se = s1 + n; s1 < se; s1++, s2++) if (*s1 != *s2) @@ -44,10 +44,10 @@ memcmp(s1, s2, n) char * memcpy(s1, s2, n) - register char *s1, *s2; + char *s1, *s2; int n; { - register char *s0 = s1, *se = s1 + n; + char *s0 = s1, *se = s1 + n; while(s1 < se) *s1++ = *s2++; @@ -55,11 +55,11 @@ memcpy(s1, s2, n) } memset(s, c, n) - register char *s; - register int c; + char *s; + int c; int n; { - register char *se = s + n; + char *se = s + n; while(s < se) *s++ = c; diff --git a/lang/fortran/comp/misc.c b/lang/fortran/comp/misc.c index c71ebe3007..1f71e3614d 100644 --- a/lang/fortran/comp/misc.c +++ b/lang/fortran/comp/misc.c @@ -71,7 +71,7 @@ Alloc(n) /* error-checking version of malloc */ int n; { char errbuf[32]; - register char *rv; + char *rv; rv = malloc(n); if (!rv) { @@ -83,8 +83,8 @@ Alloc(n) /* error-checking version of malloc */ cpn(n, a, b) -register int n; -register char *a, *b; +int n; +char *a, *b; { while(--n >= 0) *b++ = *a++; @@ -93,8 +93,8 @@ register char *a, *b; eqn(n, a, b) -register int n; -register char *a, *b; +int n; +char *a, *b; { while(--n >= 0) if(*a++ != *b++) @@ -109,10 +109,10 @@ register char *a, *b; cmpstr(a, b, la, lb) /* compare two strings */ -register char *a, *b; +char *a, *b; ftnint la, lb; { - register char *aend, *bend; + char *aend, *bend; aend = a + la; bend = b + lb; @@ -158,9 +158,9 @@ ftnint la, lb; /* hookup -- Same as LISP NCONC, that is a destructive append of two lists */ chainp hookup(x,y) -register chainp x, y; +chainp x, y; { - register chainp p; + chainp p; if(x == NULL) return(y); @@ -176,7 +176,7 @@ register chainp x, y; struct Listblock *mklist(p) chainp p; { - register struct Listblock *q; + struct Listblock *q; q = ALLOC(Listblock); q->tag = TLIST; @@ -186,10 +186,10 @@ chainp p; chainp mkchain(p,q) -register char * p; -register chainp q; +char * p; +chainp q; { - register chainp r; + chainp r; if(chains) { @@ -206,9 +206,9 @@ register chainp q; chainp revchain(next) - register chainp next; + chainp next; { - register chainp p, prev = 0; + chainp p, prev = 0; while(p = next) { next = p->nextp; @@ -225,9 +225,9 @@ revchain(next) char * addunder(s) - register char *s; + char *s; { - register int c, i; + int c, i; char *s0 = s; i = 0; @@ -247,10 +247,10 @@ addunder(s) /* copyn -- return a new copy of the input Fortran-string */ char *copyn(n, s) -register int n; -register char *s; +int n; +char *s; { - register char *p, *q; + char *p, *q; p = q = (char *) Alloc(n); while(--n >= 0) @@ -274,8 +274,8 @@ char *s; legal number, with no trailing blanks */ ftnint convci(n, s) -register int n; -register char *s; +int n; +char *s; { ftnint sum; sum = 0; @@ -290,7 +290,7 @@ char *convic(n) ftnint n; { static char s[20]; - register char *t; + char *t; s[19] = '\0'; t = s+19; @@ -309,12 +309,12 @@ ftnint n; hash table. */ Namep mkname(s) -register char *s; +char *s; { struct Hashentry *hp; - register Namep q; - register int c, hash, i; - register char *t; + Namep q; + int c, hash, i; + char *t; char *s0; char errbuf[64]; @@ -369,7 +369,7 @@ register char *s; struct Labelblock *mklabel(l) ftnint l; { - register struct Labelblock *lp; + struct Labelblock *lp; if(l <= 0) return(NULL); @@ -405,7 +405,7 @@ newlabel() struct Labelblock *execlab(stateno) ftnint stateno; { - register struct Labelblock *lp; + struct Labelblock *lp; if(lp = mklabel(stateno)) { @@ -459,8 +459,8 @@ Addrp builtin(t, s, dbi) int t, dbi; char *s; { - register Extsym *p; - register Addrp q; + Extsym *p; + Addrp q; extern chainp used_builtins; p = mkext(s,s); @@ -525,9 +525,9 @@ chainp *list_store; frchain(p) -register chainp *p; +chainp *p; { - register chainp q; + chainp q; if(p==0 || *p==0) return; @@ -541,9 +541,9 @@ register chainp *p; void frexchain(p) - register chainp *p; + chainp *p; { - register chainp q, r; + chainp q, r; if (q = *p) { for(;;q = r) { @@ -559,10 +559,10 @@ frexchain(p) tagptr cpblock(n,p) -register int n; -register char * p; +int n; +char * p; { - register ptr q; + ptr q; memcpy((char *)(q = ckalloc(n)), (char *)p, n); return( (tagptr) q); @@ -639,7 +639,7 @@ int type; char *name; chainp args; { - register expptr p; + expptr p; p = mkexpr(OPCALL, (expptr)builtin(callk_kludge ? callk_kludge : type, name, 0), @@ -717,7 +717,7 @@ char *name; struct Impldoblock *mkiodo(dospec, list) chainp dospec, list; { - register struct Impldoblock *q; + struct Impldoblock *q; q = ALLOC(Impldoblock); q->tag = TIMPLDO; @@ -733,9 +733,9 @@ chainp dospec, list; memory error */ ptr ckalloc(n) -register int n; +int n; { - register ptr p; + ptr p; if( p = (ptr)calloc(1, (unsigned) n) ) return(p); fprintf(stderr, "failing to get %d bytes\n",n); @@ -746,7 +746,7 @@ register int n; isaddr(p) -register expptr p; +expptr p; { if(p->tag == TADDR) return(YES); @@ -776,7 +776,7 @@ register expptr p; isstatic(p) -register expptr p; +expptr p; { extern int useauto; if(p->headblock.vleng && !ISCONST(p->headblock.vleng)) @@ -803,7 +803,7 @@ register expptr p; referenced by constant values */ addressable(p) -register expptr p; +expptr p; { switch(p->tag) { @@ -905,7 +905,7 @@ ffilecopy (infp, outfp) FILE *infp, *outfp; { while (!feof (infp)) { - register c = getc (infp); + c = getc (infp); if (!feof (infp)) putc (c, outfp); } /* while */ @@ -924,9 +924,9 @@ char *str; { extern int n_keywords; extern char *c_keywords[]; - register int n = n_keywords; - register char **K = c_keywords; - register int n1, t; + int n = n_keywords; + char **K = c_keywords; + int n1, t; do { n1 = n >> 1; @@ -1006,8 +1006,8 @@ chainp s1, s2; if (s1 == CHNULL && s2 == CHNULL) return YES; for(; s1 && s2; s1 = s1->nextp, s2 = s2->nextp) { - register Namep v1 = (Namep) s1 -> datap; - register Namep v2 = (Namep) s2 -> datap; + Namep v1 = (Namep) s1 -> datap; + Namep v2 = (Namep) s2 -> datap; if (v1 == (Namep) NULL || v1 -> tag != TNAME || v2 == (Namep) NULL || v2 -> tag != TNAME) diff --git a/lang/fortran/comp/names.c b/lang/fortran/comp/names.c index bc69c86fec..bad19eafab 100644 --- a/lang/fortran/comp/names.c +++ b/lang/fortran/comp/names.c @@ -335,7 +335,7 @@ FILE *outfile; ftnint commlen(vl) - register chainp vl; + chainp vl; { ftnint size; int type; @@ -359,8 +359,8 @@ commlen(vl) pad_common(c) Extsym *c; { - register chainp cvl; - register Namep v; + chainp cvl; + Namep v; long L = c->maxleng; int type; struct Dimblock *t; diff --git a/lang/fortran/comp/niceprintf.c b/lang/fortran/comp/niceprintf.c index ab722d9454..f028278e2b 100644 --- a/lang/fortran/comp/niceprintf.c +++ b/lang/fortran/comp/niceprintf.c @@ -115,9 +115,9 @@ np_init() static char * adjust_pointer_in_string(pointer) - register char *pointer; + char *pointer; { - register char *s, *s1, *se, *s0; + char *s, *s1, *se, *s0; /* arrange not to break \002 */ s1 = string_start ? string_start : output_buf; @@ -144,7 +144,7 @@ adjust_pointer_in_string(pointer) static void fwd_strcpy(t, s) - register char *t, *s; + char *t, *s; { while(*t++ = *s++); } /* isident -- true iff character could belong to a unit. C allows @@ -166,7 +166,7 @@ long b, c, d, e, f, g; extern int max_line_len; extern FILEP c_file; extern char tr_tab[]; /* in output.c */ - register char *Tr = tr_tab; + char *Tr = tr_tab; int ch, inc, ind; static int extra_indent, last_indent, set_cursor = 1; diff --git a/lang/fortran/comp/output.c b/lang/fortran/comp/output.c index 4330e44d9d..2ff39af990 100644 --- a/lang/fortran/comp/output.c +++ b/lang/fortran/comp/output.c @@ -297,8 +297,8 @@ expptr left, right; static int samefpconst(c1, c2, n) - register Constp c1, c2; - register int n; + Constp c1, c2; + int n; { char *s1, *s2; if (!c1->vstg && !c2->vstg) @@ -310,7 +310,7 @@ samefpconst(c1, c2, n) static int sameconst(c1, c2) - register Constp c1, c2; + Constp c1, c2; { switch(c1->vtype) { case TYCOMPLEX: @@ -399,7 +399,7 @@ static char *Longfmt = "%ld"; void out_const(fp, cp) FILE *fp; - register Constp cp; + Constp cp; { static char real_buf[50], imag_buf[50]; unsigned int k; @@ -709,9 +709,9 @@ struct Exprblock *e; static char * findconst(m) - register long m; + long m; { - register struct Literal *litp, *litpe; + struct Literal *litp, *litpe; litp = litpool; for(litpe = litp + nliterals; litp < litpe; litp++) @@ -727,9 +727,9 @@ opconv_fudge(fp,e) struct Exprblock *e; { /* special handling for ichar and character*1 */ - register expptr lp = e->leftp; - register union Expression *Offset; - register char *cp; + expptr lp = e->leftp; + union Expression *Offset; + char *cp; int lt = lp->headblock.vtype; char buf[8]; unsigned int k; @@ -925,7 +925,7 @@ expptr len, name, args; routine */ int done_once; /* Used for writing commas to outfile */ int narg, t; - register expptr q; + expptr q; long L; Argtypes *at; Atype *A; @@ -1169,7 +1169,7 @@ char tr_tab[Table_size]; void out_init () { extern int tab_size; - register char *s; + char *s; s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_+-."; while(*s) @@ -1318,7 +1318,7 @@ output_rbrace(outfile, s) char *s; { extern int last_was_label; - register char *fmt; + char *fmt; if (last_was_label) { last_was_label = 0; diff --git a/lang/fortran/comp/p1output.c b/lang/fortran/comp/p1output.c index 0d381fc133..da36c626ff 100644 --- a/lang/fortran/comp/p1output.c +++ b/lang/fortran/comp/p1output.c @@ -44,7 +44,7 @@ static void p1putddd (/* int, int, int, int */); void p1_comment (str) char *str; { - register unsigned char *pointer, *ustr; + unsigned char *pointer, *ustr; if (!str) return; @@ -139,7 +139,7 @@ expptr expr; static void p1_const(cp) - register Constp cp; + Constp cp; { int type = cp->vtype; expptr vleng = cp->vleng; @@ -201,7 +201,7 @@ ftnint stateno; static void p1_addr (addrp) - register struct Addrblock *addrp; + struct Addrblock *addrp; { int stg; @@ -435,7 +435,7 @@ struct Labelblock *labels[]; { struct Constblock c; int i; - register struct Labelblock *L; + struct Labelblock *L; p1put (P1_COMP_GOTO); p1_expr (index); diff --git a/lang/fortran/comp/parse_args.c b/lang/fortran/comp/parse_args.c index 77ec6f02fc..193f7fd68b 100644 --- a/lang/fortran/comp/parse_args.c +++ b/lang/fortran/comp/parse_args.c @@ -262,7 +262,7 @@ int entries; in length ONLY IF a match was found. */ int match_table (norm_input, table, entries, use_prefix, length) -register char *norm_input; +char *norm_input; arg_info table[]; int entries; boolean use_prefix; @@ -271,7 +271,7 @@ int *length; extern int match (/* char *, char *, arg_info *, boolean */); char low_input[MAX_INPUT_SIZE]; - register int i; + int i; int best_index = -1, best_length = 0; /* FUNCTION BODY */ @@ -330,7 +330,7 @@ boolean use_prefix; /* Pointers for the required strings (lowered or nonlowered) */ - register char *input, *prefix, *string; + char *input, *prefix, *string; /* FUNCTION BODY */ @@ -371,7 +371,7 @@ char *lower_string (dest, src) char *dest, *src; { char *result = dest; - register int c; + int c; if (dest == NULL || src == NULL) result = NULL; diff --git a/lang/fortran/comp/pread.c b/lang/fortran/comp/pread.c index 9cde0d48de..64063d4a42 100644 --- a/lang/fortran/comp/pread.c +++ b/lang/fortran/comp/pread.c @@ -156,10 +156,10 @@ Pnotboth(e) static int numread(pf, n) - register FILE *pf; + FILE *pf; int *n; { - register int c, k; + int c, k; if ((c = getc(pf)) < '0' || c > '9') return c; @@ -180,11 +180,11 @@ numread(pf, n) static int readref(pf, e, ftype) - register FILE *pf; + FILE *pf; Extsym *e; int ftype; { - register int c, *t; + int c, *t; int i, nargs, type; Argtypes *at; Atype *a, *ae; @@ -252,10 +252,10 @@ readref(pf, e, ftype) static int comlen(pf) - register FILE *pf; + FILE *pf; { - register int c; - register char *s, *se; + int c; + char *s, *se; char buf[128], cbuf[128]; int refread; long L; @@ -339,8 +339,8 @@ Ptoken(pf, canend) FILE *pf; int canend; { - register int c; - register char *s, *se; + int c; + char *s, *se; top: for(;;) { @@ -611,8 +611,8 @@ Ptype(pf) static char * trimunder() { - register char *s; - register int n; + char *s; + int n; static char buf[128]; s = Ptok + strlen(Ptok) - 1; @@ -661,9 +661,9 @@ argverify(ftype, p) Extsym *p; { Argtypes *at; - register Atype *aty; + Atype *aty; int i, j, k; - register int *t, *te; + int *t, *te; char buf1[32], buf2[32]; int type_fixup(); @@ -740,8 +740,8 @@ newarg(ftype, p) Extsym *p; { Argtypes *at; - register Atype *aty; - register int *t, *te; + Atype *aty; + int *t, *te; int i, k; if (p->extstg == STGCOMMON) { @@ -843,8 +843,8 @@ read_Pfiles(ffiles) { char **f1files, **f1files0, *s; int k; - register Extsym *e, *ee; - register Argtypes *at; + Extsym *e, *ee; + Argtypes *at; extern int retcode; f1files0 = f1files = ffiles; diff --git a/lang/fortran/comp/proc.c b/lang/fortran/comp/proc.c index 3c1718b078..663e2b2ed2 100644 --- a/lang/fortran/comp/proc.c +++ b/lang/fortran/comp/proc.c @@ -44,7 +44,7 @@ changedtype(q) { char buf[200]; int qtype, type1; - register Extsym *e; + Extsym *e; Argtypes *at; if (q->vtypewarned) @@ -79,11 +79,11 @@ changedtype(q) void unamstring(q, s) - register Addrp q; - register char *s; + Addrp q; + char *s; { - register int k; - register char *t; + int k; + char *t; k = strlen(s); if (k < IDENT_LEN) { @@ -261,8 +261,8 @@ newproc() static void zap_changes() { - register chainp cp; - register Argtypes *at; + chainp cp; + Argtypes *at; /* arrange to get correct count of prototypes that would change by running f2c again */ @@ -329,7 +329,7 @@ endproc() enddcl() { - register struct Entrypoint *ep; + struct Entrypoint *ep; struct Entrypoint *ep0; extern void freetemps(); chainp cp; @@ -379,7 +379,7 @@ startproc(progname, class) Extsym * progname; int class; { - register struct Entrypoint *p; + struct Entrypoint *p; p = ALLOC(Entrypoint); if(class == CLMAIN) { @@ -406,10 +406,10 @@ int class; /* subroutine or function statement */ Extsym *newentry(v, substmsg) - register Namep v; + Namep v; int substmsg; { - register Extsym *p; + Extsym *p; char buf[128], badname[64]; static int nbad = 0; static char already[] = "external name already used"; @@ -447,8 +447,8 @@ ftnint length; Extsym *entry; chainp args; { - register Namep q; - register struct Entrypoint *p; + Namep q; + struct Entrypoint *p; extern int types3[]; if(class != CLENTRY) @@ -525,9 +525,9 @@ LOCAL epicode() /* generate code to return value of type t */ LOCAL retval(t) -register int t; +int t; { - register Addrp p; + Addrp p; switch(t) { @@ -577,9 +577,9 @@ FILE *outfile; dim_finish(v) Namep v; { - register struct Dimblock *p; - register expptr q; - register int i, nd; + struct Dimblock *p; + expptr q; + int i, nd; extern expptr make_int_expr(); p = v->vdim; @@ -607,10 +607,10 @@ duparg(q) LOCAL doentry(ep) struct Entrypoint *ep; { - register int type; - register Namep np; + int type; + Namep np; chainp p, p1; - register Namep q; + Namep q; Addrp mkarg(), rs; int it, k; extern char dflttype[26]; @@ -780,7 +780,7 @@ int type; dim_check(q) Namep q; { - register struct Dimblock *vdim = q->vdim; + struct Dimblock *vdim = q->vdim; if(!vdim->nelt || !ISICON(vdim->nelt)) dclerr("adjustable dimension on non-argument", q); @@ -790,8 +790,8 @@ dim_check(q) LOCAL dobss() { - register struct Hashentry *p; - register Namep q; + struct Hashentry *p; + Namep q; int qstg, qclass, qtype; Extsym *e; @@ -833,8 +833,8 @@ LOCAL dobss() donmlist() { - register struct Hashentry *p; - register Namep q; + struct Hashentry *p; + Namep q; for(p=hashtab; pvarp) && q->vclass==CLNAMELIST) @@ -845,7 +845,7 @@ donmlist() /* iarrlen -- Returns the size of the array in bytes, or -1 */ ftnint iarrlen(q) -register Namep q; +Namep q; { ftnint leng; @@ -866,8 +866,8 @@ register Namep q; namelist(np) Namep np; { - register chainp q; - register Namep v; + chainp q; + Namep v; int y; if (!np->visused) @@ -894,11 +894,11 @@ Namep np; LOCAL docommon() { - register Extsym *extptr; - register chainp q, q1; + Extsym *extptr; + chainp q, q1; struct Dimblock *t; expptr neltp; - register Namep comvar; + Namep comvar; ftnint size; int i, k, pref, type; extern int type_pref[]; @@ -1007,7 +1007,7 @@ chainp list; LOCAL docomleng() { - register Extsym *p; + Extsym *p; for(p = extsymtab ; p < nextext ; ++p) if(p->extstg == STGCOMMON) @@ -1035,9 +1035,9 @@ Addrp p; void freetemps() { - register chainp p, p1; - register Addrp q; - register int t; + chainp p, p1; + Addrp q; + int t; p1 = holdtemps; while(p = p1) { @@ -1058,14 +1058,14 @@ freetemps() /* allocate an automatic variable slot for each of nelt variables */ Addrp autovar(nelt0, t, lengp, name) -register int nelt0, t; +int nelt0, t; expptr lengp; char *name; { ftnint leng; - register Addrp q; + Addrp q; char *temp_name (); - register int nelt = nelt0 > 0 ? nelt0 : 1; + int nelt = nelt0 > 0 ? nelt0 : 1; extern char *av_pfix[]; if(t == TYCHAR) @@ -1108,12 +1108,12 @@ char *name; Addrp mktmpn(nelt, type, lengp) int nelt; -register int type; +int type; expptr lengp; { ftnint leng; chainp p, oldp; - register Addrp q; + Addrp q; if(type==TYUNKNOWN || type==TYERROR) badtype("mktmpn", type); @@ -1188,11 +1188,11 @@ expptr lengp; s will be NULL if the block is unnamed */ Extsym *comblock(s) - register char *s; + char *s; { Extsym *p; - register char *t; - register int c, i; + char *t; + int c, i; char cbuf[256], *s0; /* Give the unnamed common block a unique name */ @@ -1251,9 +1251,9 @@ Namep v; in will only attempt to fill out more information give the other params */ settype(v, type, length) -register Namep v; -register int type; -register ftnint length; +Namep v; +int type; +ftnint length; { int type1; @@ -1318,10 +1318,10 @@ register ftnint length; type and length specifier */ lengtype(type, len) -register int type; +int type; ftnint len; { - register int length = (int)len; + int length = (int)len; switch(type) { case TYREAL: @@ -1383,7 +1383,7 @@ ftnint len; /* setintr -- Set Intrinsic function */ setintr(v) -register Namep v; +Namep v; { int k; @@ -1417,7 +1417,7 @@ register Namep v; procedures */ setext(v) -register Namep v; +Namep v; { if(v->vclass == CLUNKNOWN) v->vclass = CLPROC; @@ -1436,12 +1436,12 @@ register Namep v; /* create dimensions block for array variable */ setbound(v, nd, dims) -register Namep v; +Namep v; int nd; struct Dims dims[ ]; { - register expptr q, t; - register struct Dimblock *p; + expptr q, t; + struct Dimblock *p; int i; extern chainp new_vars; char buf[256]; diff --git a/lang/fortran/comp/put.c b/lang/fortran/comp/put.c index fcab40042a..793e4adea9 100644 --- a/lang/fortran/comp/put.c +++ b/lang/fortran/comp/put.c @@ -130,7 +130,7 @@ Addrp a, b; Addrp mkfield(res, f, ty) -register Addrp res; +Addrp res; char *f; int ty; { @@ -141,9 +141,9 @@ int ty; Addrp realpart(p) -register Addrp p; +Addrp p; { - register Addrp q; + Addrp q; expptr mkrealcon(); if (p -> uname_tag == UNAM_CONST && ISCOMPLEX (p->vtype)) { @@ -163,9 +163,9 @@ register Addrp p; expptr imagpart(p) -register Addrp p; +Addrp p; { - register Addrp q; + Addrp q; expptr mkrealcon(); if( ISCOMPLEX(p->vtype) ) @@ -192,7 +192,7 @@ register Addrp p; /* ncat -- computes the number of adjacent concatenation operations */ ncat(p) -register expptr p; +expptr p; { if(p->tag==TEXPR && p->exprblock.opcode==OPCONCAT) return( ncat(p->exprblock.leftp) + ncat(p->exprblock.rightp) ); @@ -206,7 +206,7 @@ register expptr p; substring must have a static (i.e. compile-time) fixed length */ ftnint lencat(p) -register expptr p; +expptr p; { if(p->tag==TEXPR && p->exprblock.opcode==OPCONCAT) return( lencat(p->exprblock.leftp) + lencat(p->exprblock.rightp) ); @@ -231,9 +231,9 @@ register expptr p; */ Addrp putconst(p) -register Constp p; +Constp p; { - register Addrp q; + Addrp q; struct Literal *litp, *lastlit; int k, len, type; int litflavor; diff --git a/lang/fortran/comp/putpcc.c b/lang/fortran/comp/putpcc.c index b306bb1baa..08390c552b 100644 --- a/lang/fortran/comp/putpcc.c +++ b/lang/fortran/comp/putpcc.c @@ -65,10 +65,10 @@ int class; } putif(p, else_if_p) - register expptr p; + expptr p; int else_if_p; { - register int k; + int k; int n; long where; @@ -145,10 +145,10 @@ struct Labelblock *labs[]; static expptr krput(p) - register expptr p; + expptr p; { - register expptr e, e1; - register unsigned op; + expptr e, e1; + unsigned op; int t = krparens == 2 ? TYDREAL : p->exprblock.vtype; op = p->exprblock.opcode; @@ -173,7 +173,7 @@ krput(p) } expptr putx(p) - register expptr p; + expptr p; { int opc; int k; @@ -521,7 +521,7 @@ expptr p; LOCAL Addrp intdouble(p) Addrp p; { - register Addrp t; + Addrp t; t = mktmp(TYDREAL, ENULL); putout (putassign(cpexpr((expptr)t), (expptr)p)); @@ -535,9 +535,9 @@ Addrp p; /* Complex-type variable assignment */ LOCAL Addrp putcxeq(p) -register expptr p; +expptr p; { - register Addrp lp, rp; + Addrp lp, rp; expptr code; if(p->tag != TEXPR) @@ -572,11 +572,11 @@ expptr p; #define PAIR(x,y) mkexpr (OPCOMMA, (x), (y)) LOCAL Addrp putcx1(p) -register expptr p; +expptr p; { expptr q; Addrp lp, rp; - register Addrp resp; + Addrp resp; int opcode; int ltype, rtype; long ts; @@ -770,10 +770,10 @@ register expptr p; are not defined */ LOCAL expptr putcxcmp(p) -register expptr p; +expptr p; { int opcode; - register Addrp lp, rp; + Addrp lp, rp; expptr q; if(p->tag != TEXPR) @@ -796,7 +796,7 @@ register expptr p; /* putch1 -- Forces constants into the literal pool, among other things */ LOCAL Addrp putch1(p) -register expptr p; +expptr p; { Addrp t; expptr e; @@ -868,7 +868,7 @@ expptr p; LOCAL expptr putcheq(p) -register expptr p; +expptr p; { expptr lp, rp; @@ -900,7 +900,7 @@ register expptr p; LOCAL expptr putchcmp(p) -register expptr p; +expptr p; { expptr lp, rp; @@ -941,9 +941,9 @@ register expptr p; LOCAL expptr putcat(lhs0, rhs) expptr lhs0; - register expptr rhs; + expptr rhs; { - register Addrp lhs = (Addrp)lhs0; + Addrp lhs = (Addrp)lhs0; int n, tyi; Addrp length_var, string_var; expptr p; @@ -984,8 +984,8 @@ LOCAL expptr putcat(lhs0, rhs) LOCAL putct1(q, length_var, string_var, ip) -register expptr q; -register Addrp length_var, string_var; +expptr q; +Addrp length_var, string_var; int *ip; { int i; @@ -1023,7 +1023,7 @@ int *ip; LOCAL expptr putaddr(p0) expptr p0; { - register Addrp p; + Addrp p; if (!(p = (Addrp)p0)) return ENULL; @@ -1048,13 +1048,13 @@ addrfix(e) /* fudge character string length if it's a TADDR */ LOCAL int typekludge(ccall, q, at, j) int ccall; - register expptr q; + expptr q; Atype *at; int j; /* alternate type */ { - register int i, k; + int i, k; extern int iocalladdr; - register Namep np; + Namep np; /* Return value classes: * < 100 ==> Fortran arg (pointer to type) @@ -1176,7 +1176,7 @@ atype_squawk(at, msg) Argtypes *at; char *msg; { - register Atype *a, *ae; + Atype *a, *ae; warn(msg); for(a = at->atypes, ae = a + at->nargs; a < ae; a++) frchain(&a->cp); @@ -1207,7 +1207,7 @@ type_fixup(at,a,k) Atype *a; int k; { - register struct Entrypoint *ep; + struct Entrypoint *ep; if (!infertypes) return 0; for(ep = entries; ep; ep = ep->entnextp) @@ -1364,7 +1364,7 @@ save_argtypes(arglist, at0, at1, ccall, fname, stg, nchargs, type, zap) void saveargtypes(p) /* for writing prototypes */ - register Exprp p; + Exprp p; { Addrp a; Argtypes **at0, **at1; @@ -1419,14 +1419,14 @@ LOCAL expptr putcall(p0, temp) expptr p0; Addrp *temp; { - register Exprp p = (Exprp)p0; + Exprp p = (Exprp)p0; chainp arglist; /* Pointer to actual arguments, if any */ chainp charsp; /* List of copies of the variables which hold the lengths of character parameters (other than procedure parameters) */ chainp cp; /* Iterator over argument lists */ - register expptr q; /* Pointer to the current argument */ + expptr q; /* Pointer to the current argument */ Addrp fval; /* Function return value */ int type; /* type of the call - presumably this was set elsewhere */ @@ -1621,7 +1621,7 @@ LOCAL expptr putcall(p0, temp) CONST */ LOCAL expptr putmnmx(p) -register expptr p; +expptr p; { int op, op2, type; expptr arg, qp, temp; diff --git a/lang/fortran/comp/sysdep.c b/lang/fortran/comp/sysdep.c index dc5e06f74a..78b273893c 100644 --- a/lang/fortran/comp/sysdep.c +++ b/lang/fortran/comp/sysdep.c @@ -260,8 +260,8 @@ fmt_init() { static char *str1fmt[6] = { "\\b", "\\t", "\\n", "\\f", "\\r", "\\%03o" }; - register int i, j; - register char *s; + int i, j; + char *s; /* str_fmt */ @@ -370,8 +370,8 @@ dsort(from, to) }; typedef struct Memb memb; memb *mb, *mb1; - register char *x, *x0, *xe; - register int c, n; + char *x, *x0, *xe; + int c, n; FILE *f; char **z, **z0; int nn = 0; diff --git a/lang/fortran/comp/vax.c b/lang/fortran/comp/vax.c index f1e44071a7..670cdc7a98 100644 --- a/lang/fortran/comp/vax.c +++ b/lang/fortran/comp/vax.c @@ -169,10 +169,10 @@ write_comment() static int * count_args() { - register int *ac; - register chainp cp; - register struct Entrypoint *ep; - register Namep q; + int *ac; + chainp cp; + struct Entrypoint *ep; + Namep q; ac = (int *)ckalloc(nallargs*sizeof(int)); @@ -185,12 +185,12 @@ count_args() prolog(outfile, p) FILE *outfile; - register chainp p; + chainp p; { int addif, addif0, i, nd, size; int *ac; - register Namep q; - register struct Dimblock *dp; + Namep q; + struct Dimblock *dp; if(procclass == CLBLOCK) return; diff --git a/lang/fortran/comp/xsum.c b/lang/fortran/comp/xsum.c index 3e824e9294..b072aa16fe 100644 --- a/lang/fortran/comp/xsum.c +++ b/lang/fortran/comp/xsum.c @@ -73,11 +73,11 @@ typedef unsigned char uchar; long sum32(sum, x, n) - register long sum; - register uchar *x; + long sum; + uchar *x; int n; { - register uchar *xe; + uchar *xe; static long crc_table[256] = { 0, 151466134, 302932268, 453595578, -9583591, -160762737, -312236747, -463170141, @@ -155,7 +155,7 @@ process(s, x) char *s; int x; { - register int n; + int n; uchar buf[16*1024]; long fsize, sum; diff --git a/lang/fortran/lib/libF77/getarg_.c b/lang/fortran/lib/libF77/getarg_.c index 849570f8ca..50756560b2 100644 --- a/lang/fortran/lib/libF77/getarg_.c +++ b/lang/fortran/lib/libF77/getarg_.c @@ -8,13 +8,13 @@ VOID getarg_(n, s, ls) long int *n; -register char *s; +char *s; long int ls; { extern int xargc; extern char **xargv; -register char *t; -register int i; +char *t; +int i; if(*n>=0 && *n0) *sign=0; else if(value<0) { value = -value; diff --git a/lang/fortran/lib/libI77/lread.c b/lang/fortran/lib/libI77/lread.c index 4f92cde2df..6231d944b2 100644 --- a/lang/fortran/lib/libI77/lread.c +++ b/lang/fortran/lib/libI77/lread.c @@ -166,8 +166,8 @@ l_R(poststar) int poststar; { char s[FMAX+EXPMAXDIGS+4]; - register int ch; - register char *sp, *spe, *sp1; + int ch; + char *sp, *spe, *sp1; long e, exp; double atof(); int havenum, se; @@ -275,7 +275,7 @@ l_R(poststar) static int rd_count(ch) - register int ch; + int ch; { if (ch < '0' || ch > '9') return 1; diff --git a/lang/fortran/lib/libI77/lwrite.c b/lang/fortran/lib/libI77/lwrite.c index ee931e15ec..b5f201db3d 100644 --- a/lang/fortran/lib/libI77/lwrite.c +++ b/lang/fortran/lib/libI77/lwrite.c @@ -59,7 +59,7 @@ l_g(buf, absn) char *buf; double absn; static void l_put(s) register char *s; { - register int c, (*pn)() = putn; + int c, (*pn)() = putn; while(c = *s++) (*pn)(c); } diff --git a/lang/fortran/lib/libI77/rdfmt.c b/lang/fortran/lib/libI77/rdfmt.c index d8070ab603..23a897858f 100644 --- a/lang/fortran/lib/libI77/rdfmt.c +++ b/lang/fortran/lib/libI77/rdfmt.c @@ -120,8 +120,8 @@ ftnlen len; ufloat *p; { char s[FMAX+EXPMAXDIGS+4]; - register int ch; - register char *sp, *spe, *sp1; + int ch; + char *sp, *spe, *sp1; double atof(), x; int scale1, se; long e, exp; diff --git a/lang/fortran/lib/libI77/rsne.c b/lang/fortran/lib/libI77/rsne.c index 5a99c23840..2cd7efafaf 100644 --- a/lang/fortran/lib/libI77/rsne.c +++ b/lang/fortran/lib/libI77/rsne.c @@ -42,10 +42,10 @@ static Vardesc * hash(ht, s) hashtab *ht; - register char *s; + char *s; { - register int c, x; - register hashentry *h; + int c, x; + hashentry *h; char *s0 = s; for(x = 0; c = *s++; x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1) @@ -113,8 +113,8 @@ static char Alpha[256], Alphanum[256]; static void nl_init() { - register char *s; - register int c; + char *s; + int c; if(!init) f_init(); @@ -133,11 +133,11 @@ nl_init() { static int getname(s, slen) - register char *s; + char *s; int slen; { - register char *se = s + slen - 1; - register int ch; + char *se = s + slen - 1; + int ch; GETC(ch); if (!(*s++ = Alpha[ch & 0xff])) { @@ -160,8 +160,8 @@ getnum(chp, val) int *chp; ftnlen *val; { - register int ch, sign; - register ftnlen x; + int ch, sign; + ftnlen x; while(GETC(ch) <= ' ' && ch >= 0); if (ch == '-') { @@ -193,7 +193,7 @@ getdimen(chp, d, delta, extent, x1) dimen *d; ftnlen delta, extent, *x1; { - register int k; + int k; ftnlen x2, x3; if (k = getnum(chp, x1)) diff --git a/lang/m2/comp/LLlex.c b/lang/m2/comp/LLlex.c index 7fe87216dd..aa85ba04cc 100644 --- a/lang/m2/comp/LLlex.c +++ b/lang/m2/comp/LLlex.c @@ -53,8 +53,8 @@ static void SkipComment(void) /* Skip Modula-2 comments (* ... *). Note that comments may be nested (par. 3.5). */ - register int ch, c; - register int CommentLevel = 0; + int ch, c; + int CommentLevel = 0; LoadChar(ch); if (ch == '$') { @@ -125,11 +125,11 @@ static struct string *GetString(int upto) { /* Read a Modula-2 string, delimited by the character "upto". */ - register int ch; - register struct string *str = (struct string *) + int ch; + struct string *str = (struct string *) Malloc((unsigned) sizeof(struct string)); - register char *p; - register int len; + char *p; + int len; len = ISTRSIZE; str->s_str = p = Malloc((unsigned int) ISTRSIZE); @@ -169,7 +169,7 @@ static char *s_error = "illegal line directive"; static int getch(void) { - register int ch; + int ch; while (LoadChar(ch), (ch & 0200) && ch != EOI) { error("non-ascii '\\%03o' read", ch & 0377); @@ -179,10 +179,10 @@ static int getch(void) void CheckForLineDirective(void) { - register int ch = getch(); - register int i = 0; + int ch = getch(); + int i = 0; char buf[IDFSIZE]; - register char *c = buf; + char *c = buf; for (;;) { @@ -240,7 +240,7 @@ void CheckForLineDirective(void) static void CheckForLet(void) { - register int ch; + int ch; LoadChar(ch); if (ch != EOI) { @@ -256,9 +256,9 @@ int LLlex(void) /* LLlex() is the Lexical Analyzer. The putting aside of tokens is taken into account. */ - register t_token *tk = ˙ + t_token *tk = ˙ char buf[(IDFSIZE > NUMSIZE ? IDFSIZE : NUMSIZE) + 2]; - register int ch, nch; + int ch, nch; toktype = error_type; @@ -345,8 +345,8 @@ int LLlex(void) case STIDF: { - register char *tag = &buf[0]; - register struct idf *id; + char *tag = &buf[0]; + struct idf *id; do { if (tag - buf < idfsize) *tag++ = ch; @@ -367,7 +367,7 @@ int LLlex(void) } case STSTR: { - register struct string *str = GetString(ch); + struct string *str = GetString(ch); if (str->s_length == 1) { tk->TOK_INT = *(str->s_str) & 0377; @@ -393,9 +393,9 @@ int LLlex(void) complex finite automaton. */ enum statetp {Oct,OptHex,Hex,Dec,OctEndOrHex,End,OptReal,Real}; - register enum statetp state; - register int base = 8; - register char *np = &buf[0]; + enum statetp state; + int base = 8; + char *np = &buf[0]; *np++ = ch; state = is_oct(ch) ? Oct : Dec; diff --git a/lang/m2/comp/LLmessage.c b/lang/m2/comp/LLmessage.c index 09af3d5775..d17c6b3941 100644 --- a/lang/m2/comp/LLmessage.c +++ b/lang/m2/comp/LLmessage.c @@ -27,12 +27,12 @@ #include "Lpars.h" #include "misc.h" -void LLmessage(register int tk) +void LLmessage(int tk) { if (tk > 0) { /* if (tk > 0), it represents the token to be inserted. */ - register t_token *dotp = ˙ + t_token *dotp = ˙ #ifndef LLNONCORR error("%s missing before %s", symbol2str(tk), symbol2str(dotp->tk_symb)); diff --git a/lang/m2/comp/casestat.c b/lang/m2/comp/casestat.c index 76c391d615..2d55242309 100644 --- a/lang/m2/comp/casestat.c +++ b/lang/m2/comp/casestat.c @@ -89,8 +89,8 @@ static int compact(int nr, arith low, arith up) static void AddOneCase(struct switch_hdr *sh, struct node *lnode, struct node *rnode, label lbl) { - register struct case_entry *ce = new_case_entry(); - register struct case_entry *c1 = sh->sh_entries, *c2 = 0; + struct case_entry *ce = new_case_entry(); + struct case_entry *c1 = sh->sh_entries, *c2 = 0; int fund = sh->sh_type->tp_fund; arith diff; @@ -204,7 +204,7 @@ node_error(rnode, "multiple case entry for value %ld", (long)(ce->ce_up)); } -static void AddCases(struct switch_hdr *sh, register struct node *node, label lbl) +static void AddCases(struct switch_hdr *sh, struct node *node, label lbl) { /* Add case labels to the case label list */ @@ -233,7 +233,7 @@ static void FreeSh(struct switch_hdr *sh) { /* free the allocated switch structure */ - register struct case_entry *ce; + struct case_entry *ce; ce = sh->sh_entries; while (ce) { @@ -253,10 +253,10 @@ int CaseCode(struct node *nd, label exitlabel, int end_reached) "exitlabel" is the exit-label of the closest enclosing LOOP-statement, or 0. */ - register struct switch_hdr *sh = new_switch_hdr(); - register struct node *pnode = nd; - register struct case_entry *ce; - register arith val; + struct switch_hdr *sh = new_switch_hdr(); + struct node *pnode = nd; + struct case_entry *ce; + arith val; label CaseDescrLab; int rval; diff --git a/lang/m2/comp/chk_expr.c b/lang/m2/comp/chk_expr.c index d0b5545d78..b79e29b7ad 100644 --- a/lang/m2/comp/chk_expr.c +++ b/lang/m2/comp/chk_expr.c @@ -54,7 +54,7 @@ static int ChkCast(struct node **); static void df_error( struct node *nd, /* node on which error occurred */ char *mess, /* error message */ - register struct def *edf) /* do we have a name? */ + struct def *edf) /* do we have a name? */ { if (edf) { if (edf->df_kind != D_ERROR) { @@ -64,7 +64,7 @@ static void df_error( else node_error(nd, mess); } -void MkCoercion(struct node **pnd, register struct type *tp) +void MkCoercion(struct node **pnd, struct type *tp) { /* Make a coercion from the node indicated by *pnd to the type indicated by tp. If the node indicated by *pnd @@ -74,8 +74,8 @@ void MkCoercion(struct node **pnd, register struct type *tp) - we are in the second pass and the coercion might cause an error */ - register struct node *nd = *pnd; - register struct type *nd_tp = nd->nd_type; + struct node *nd = *pnd; + struct type *nd_tp = nd->nd_type; extern int pass_1; char *wmess = 0; arith op; @@ -170,12 +170,12 @@ void MkCoercion(struct node **pnd, register struct type *tp) *pnd = nd; } -int ChkVariable(register struct node **expp, int flags) +int ChkVariable(struct node **expp, int flags) { /* Check that "expp" indicates an item that can be assigned to. */ - register struct node *exp; + struct node *exp; if (! ChkDesig(expp, flags)) return 0; @@ -193,8 +193,8 @@ static int ChkArrow(struct node **expp, int flags) /* Check an application of the '^' operator. The operand must be a variable of a pointer type. */ - register struct type *tp; - register struct node *exp = *expp; + struct type *tp; + struct node *exp = *expp; assert(exp->nd_class == Arrow); assert(exp->nd_symb == '^'); @@ -223,8 +223,8 @@ static int ChkArr(struct node **expp, int flags) assignment compatible with the array-index. */ - register struct type *tpl; - register struct node *exp = *expp; + struct type *tpl; + struct node *exp = *expp; assert(exp->nd_class == Arrsel); assert(exp->nd_symb == '[' || exp->nd_symb == ','); @@ -278,8 +278,8 @@ static int ChkSelOrName(struct node **expp, int flags) /* Check either an ID or a construction of the form ID.ID [ .ID ]* */ - register struct def *df; - register struct node *exp = *expp; + struct def *df; + struct node *exp = *expp; exp->nd_type = error_type; @@ -296,7 +296,7 @@ static int ChkSelOrName(struct node **expp, int flags) /* A selection from a record or a module. Modules also have a record type. */ - register struct node *left; + struct node *left; assert(exp->nd_symb == '.'); @@ -351,8 +351,8 @@ static int ChkExSelOrName(struct node **expp, int flags) /* Check either an ID or an ID.ID [.ID]* occurring in an expression. */ - register struct def *df; - register struct node *exp; + struct def *df; + struct node *exp; if (! ChkSelOrName(expp, D_USED)) return 0; @@ -418,7 +418,7 @@ static int ChkExSelOrName(struct node **expp, int flags) return 1; } -static int ChkEl(register struct node **expp, struct type *tp) +static int ChkEl(struct node **expp, struct type *tp) { return ChkExpression(expp) && ChkCompat(expp, tp, "set element"); @@ -430,9 +430,9 @@ static int ChkElement(struct node **expp, struct type *tp, arith *set) recursively. Also try to compute the set! */ - register struct node *expr = *expp; + struct node *expr = *expp; struct type *el_type = ElementType(tp); - register unsigned int i; + unsigned int i; arith low, high; if (expr->nd_class == Link && expr->nd_symb == UPTO) { @@ -485,7 +485,7 @@ static int ChkElement(struct node **expp, struct type *tp, arith *set) arith *MkSet(unsigned int size) { - register arith *s, *t; + arith *s, *t; s = t = (arith *) Malloc(size); s++; @@ -495,7 +495,7 @@ arith *MkSet(unsigned int size) return s; } -void FreeSet(register arith *s) +void FreeSet(arith *s) { dec_refcount(s); if (refcount(s) <= 0) { @@ -509,10 +509,10 @@ static int ChkSet(struct node **expp, int flags) /* Check the legality of a SET aggregate, and try to evaluate it compile time. Unfortunately this is all rather complicated. */ - register struct type *tp; - register struct node *exp = *expp; - register struct node *nd; - register struct def *df; + struct type *tp; + struct node *exp = *expp; + struct node *nd; + struct def *df; int retval = 1; int SetIsConstant = 1; @@ -572,7 +572,7 @@ static int ChkSet(struct node **expp, int flags) static struct node *nextarg(struct node **argp, struct def *edf) { - register struct node *arg = (*argp)->nd_RIGHT; + struct node *arg = (*argp)->nd_RIGHT; if (! arg) { df_error(*argp, "too few arguments supplied", edf); @@ -593,8 +593,8 @@ static struct node *getarg(struct node **argp, int bases, int designator, struct that it must be a designator and may not be a register variable. */ - register struct node *arg = nextarg(argp, edf); - register struct node *left; + struct node *arg = nextarg(argp, edf); + struct node *left; if (! arg || ! arg->nd_LEFT || @@ -627,8 +627,8 @@ static struct node *getname(struct node **argp, int kinds, int bases, struct def The argument must indicate a definition, and the definition kind must be one of "kinds". */ - register struct node *arg = nextarg(argp, edf); - register struct node *left; + struct node *arg = nextarg(argp, edf); + struct node *left; if (!arg || !arg->nd_LEFT || ! ChkDesig(&(arg->nd_LEFT), D_USED)) return 0; @@ -647,14 +647,14 @@ static struct node *getname(struct node **argp, int kinds, int bases, struct def return left; } -static int ChkProcCall(register struct node *exp) +static int ChkProcCall(struct node *exp) { /* Check a procedure call */ - register struct node *left; + struct node *left; struct node *argp; struct def *edf = 0; - register struct paramlist *param; + struct paramlist *param; int retval = 1; int cnt = 0; @@ -708,7 +708,7 @@ static int ChkProcCall(register struct node *exp) return retval; } -static int ChkFunCall(register struct node **expp, int flags) +static int ChkFunCall(struct node **expp, int flags) { /* Check a call that must have a result */ @@ -733,7 +733,7 @@ int ChkCall(struct node **expp) /* First, get the name of the function or procedure */ if (ChkDesig(&((*expp)->nd_LEFT), D_USED)) { - register struct node *left = (*expp)->nd_LEFT; + struct node *left = (*expp)->nd_LEFT; if (IsCast(left)) { /* It was a type cast. @@ -820,9 +820,9 @@ static int AllowedTypes(int operator) } static int ChkAddressOper( - register struct type *tpl, - register struct type *tpr, - register struct node *expp) + struct type *tpl, + struct type *tpr, + struct node *expp) { /* Check that either "tpl" or "tpr" are both of type address_type, or that one of them is, but the other is @@ -870,8 +870,8 @@ static int ChkBinOper(struct node **expp, int flags) { /* Check a binary operation. */ - register struct node *exp = *expp; - register struct type *tpl, *tpr; + struct node *exp = *expp; + struct type *tpl, *tpr; struct type *result_type; int allowed; int retval; @@ -984,9 +984,9 @@ static int ChkUnOper(struct node **expp, int flags) { /* Check an unary operation. */ - register struct node *exp = *expp; - register struct node *right = exp->nd_RIGHT; - register struct type *tpr; + struct node *exp = *expp; + struct node *right = exp->nd_RIGHT; + struct type *tpr; if (exp->nd_symb == COERCION) return 1; if (exp->nd_symb == '(') { @@ -1058,7 +1058,7 @@ static struct node *getvariable(struct node **argp, struct def *edf, int flags) /* Get the next argument from argument list "argp". It must obey the rules of "ChkVariable". */ - register struct node *arg = nextarg(argp, edf); + struct node *arg = nextarg(argp, edf); if (! arg || ! arg->nd_LEFT || @@ -1071,10 +1071,10 @@ static int ChkStandard(struct node **expp) { /* Check a call of a standard procedure or function */ - register struct node *exp = *expp; + struct node *exp = *expp; struct node *arglink = exp; - register struct node *arg; - register struct def *edf = exp->nd_LEFT->nd_def; + struct node *arg; + struct def *edf = exp->nd_LEFT->nd_def; int free_it = 0; int isconstant = 0; @@ -1348,7 +1348,7 @@ static int ChkStandard(struct node **expp) case S_EXCL: case S_INCL: { - register struct type *tp; + struct type *tp; struct node *dummy; exp->nd_type = 0; @@ -1406,9 +1406,9 @@ static int ChkCast(struct node **expp) is no problem as such values take a word on the EM stack anyway. */ - register struct node *exp = *expp; - register struct node *arg = exp->nd_RIGHT; - register struct type *lefttype = exp->nd_LEFT->nd_type; + struct node *exp = *expp; + struct node *arg = exp->nd_RIGHT; + struct type *lefttype = exp->nd_LEFT->nd_type; struct def *df = exp->nd_LEFT->nd_def; if ((! arg) || arg->nd_RIGHT) { @@ -1460,7 +1460,7 @@ static int ChkCast(struct node **expp) return 1; } -void TryToString(register struct node *nd, struct type *tp) +void TryToString(struct node *nd, struct type *tp) { /* Try a coercion from character constant to string. */ diff --git a/lang/m2/comp/chk_expr.h b/lang/m2/comp/chk_expr.h index 1e5406d554..65b50e7024 100644 --- a/lang/m2/comp/chk_expr.h +++ b/lang/m2/comp/chk_expr.h @@ -26,16 +26,16 @@ extern int (*DesigChkTable[])(struct node **, int); /* table of designator check #define dec_refcount(s) (*((int *)(s) - 1) -= 1) #define refcount(s) (*((int *)(s) - 1)) -void MkCoercion(struct node **pnd, register struct type *tp); -int ChkVariable(register struct node **expp, int flags); +void MkCoercion(struct node **pnd, struct type *tp); +int ChkVariable(struct node **expp, int flags); int ChkCall(struct node **expp); -void TryToString(register struct node *nd, struct type *tp); +void TryToString(struct node *nd, struct type *tp); /* Generates a set of "size" bytes and increments its reference count. */ arith *MkSet(unsigned int size); /* Decrements the reference counter of set "s" and if reference count * is zero, then it frees the memory associated with the set. */ -void FreeSet(register arith *s); +void FreeSet(arith *s); #endif /* CHK_EXPR_H_ */ diff --git a/lang/m2/comp/code.c b/lang/m2/comp/code.c index 08fa4e547c..9ec3b35daa 100644 --- a/lang/m2/comp/code.c +++ b/lang/m2/comp/code.c @@ -43,15 +43,15 @@ extern struct desig null_desig; int fp_used; /* Forward declarations */ -static void CodeParameters(struct paramlist *, register struct node *); +static void CodeParameters(struct paramlist *, struct node *); static void CodeStd(struct node *); static void compare(int, label); static void truthvalue(int); -static void CodeUoper(register struct node *); -static void CodeSet(register struct node *, int); -static void CodeEl(register struct node *, register struct type *, int); +static void CodeUoper(struct node *); +static void CodeSet(struct node *, int); +static void CodeEl(struct node *, struct type *, int); static void CodeDAddress(struct node *, int); -static void DoHIGH(register struct def *); +static void DoHIGH(struct def *); void CodeConst(arith cst, int size) { @@ -66,7 +66,7 @@ void CodeConst(arith cst, int size) } } -void CodeString(register struct node *nd) +void CodeString(struct node *nd) { if (nd->nd_type->tp_fund != T_STRING) { /* Character constant */ @@ -80,7 +80,7 @@ void CodeString(register struct node *nd) void CodeExpr(struct node *nd, struct desig *ds, label true_label, label false_label) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; DoLineno(nd); if (tp->tp_fund == T_REAL) fp_used = 1; @@ -142,8 +142,8 @@ void CodeExpr(struct node *nd, struct desig *ds, label true_label, label false_l break; case Set: { - register unsigned i = (unsigned) (tp->tp_size) / (int) word_size; - register arith *st = nd->nd_set + i; + unsigned i = (unsigned) (tp->tp_size) / (int) word_size; + arith *st = nd->nd_set + i; int null_set = 1; ds->dsg_kind = DSG_LOADED; @@ -297,7 +297,7 @@ void CodeCoercion(struct type *t1, struct type *t2) void CodeCall(struct node *nd) { - register struct node *left = nd->nd_LEFT; + struct node *left = nd->nd_LEFT; struct type *result_tp; int needs_fn; @@ -321,7 +321,7 @@ void CodeCall(struct node *nd) switch(left->nd_class) { case Def: { - register struct def *df = left->nd_def; + struct def *df = left->nd_def; if (df->df_kind == D_CONST) { /* a procedure address */ @@ -359,10 +359,10 @@ void CodeCall(struct node *nd) } /* Generates code to setup the parameters of a procedure call. */ -static void CodeParameters(struct paramlist *param, register struct node *arg) +static void CodeParameters(struct paramlist *param, struct node *arg) { - register struct type *tp; - register struct type *arg_type; + struct type *tp; + struct type *arg_type; assert(param != 0 && arg != 0); @@ -374,7 +374,7 @@ static void CodeParameters(struct paramlist *param, register struct node *arg) arg = arg->nd_LEFT; arg_type = arg->nd_type; if (IsConformantArray(tp)) { - register struct type *elem = tp->arr_elem; + struct type *elem = tp->arr_elem; C_loc(tp->arr_elsize); if (IsConformantArray(arg_type)) { @@ -443,7 +443,7 @@ static void CodeParameters(struct paramlist *param, register struct node *arg) void CodePString(struct node *nd, struct type *tp) { arith szarg = WA(nd->nd_type->tp_size); - register arith zersz = WA(tp->tp_size) - szarg; + arith zersz = WA(tp->tp_size) - szarg; if (zersz) { /* null padding required */ @@ -472,7 +472,7 @@ static void addu(int sz) C_adu((arith)sz); } -static int complex_lhs(register struct node *nd) +static int complex_lhs(struct node *nd) { switch(nd->nd_class) { case Value: @@ -490,9 +490,9 @@ static int complex_lhs(register struct node *nd) /* Generate code for internal procedures */ static void CodeStd(struct node *nd) { - register struct node *arg = nd->nd_RIGHT; - register struct node *left = 0; - register struct type *tp = 0; + struct node *arg = nd->nd_RIGHT; + struct node *left = 0; + struct type *tp = 0; int std = nd->nd_LEFT->nd_def->df_value.df_stdname; if (arg) { @@ -557,7 +557,7 @@ static void CodeStd(struct node *nd) case S_DEC: case S_INC: { - register arith size; + arith size; int compl = complex_lhs(left); arith tmp = 0; @@ -643,7 +643,7 @@ static void CodeStd(struct node *nd) } } -static int needs_rangecheck(register struct type *tpl, struct type *tpr) +static int needs_rangecheck(struct type *tpl, struct type *tpr) { arith rlo, rhi; @@ -666,7 +666,7 @@ static int needs_rangecheck(register struct type *tpl, struct type *tpr) return 0; } -void RangeCheck(register struct type *tpl, struct type *tpr) +void RangeCheck(struct type *tpl, struct type *tpr) { arith rlo, rhi; @@ -691,7 +691,7 @@ void RangeCheck(register struct type *tpl, struct type *tpr) } } -void Operands(register struct node *nd) +void Operands(struct node *nd) { CodePExpr(nd->nd_LEFT); @@ -700,13 +700,13 @@ void Operands(register struct node *nd) } void CodeOper( - register struct node *expr, /* the expression tree itself */ + struct node *expr, /* the expression tree itself */ label true_label, label false_label /* labels to jump to in logical expr's */ ) { - register struct node *leftop = expr->nd_LEFT; - register struct node *rightop = expr->nd_RIGHT; + struct node *leftop = expr->nd_LEFT; + struct node *rightop = expr->nd_RIGHT; int fund = expr->nd_type->tp_fund; arith size = expr->nd_type->tp_size; @@ -1057,9 +1057,9 @@ static void truthvalue(int relop) /* Generates code for an unary expression */ -void CodeUoper(register struct node *nd) +void CodeUoper(struct node *nd) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; CodePExpr(nd->nd_RIGHT); switch(nd->nd_symb) { @@ -1090,9 +1090,9 @@ void CodeUoper(register struct node *nd) } } -static void CodeSet(register struct node *nd, int null_set) +static void CodeSet(struct node *nd, int null_set) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; nd = nd->nd_NEXT; while (nd) { @@ -1107,9 +1107,9 @@ static void CodeSet(register struct node *nd, int null_set) if (null_set) C_zer(tp->tp_size); } -static void CodeEl(register struct node *nd, register struct type *tp, int null_set) +static void CodeEl(struct node *nd, struct type *tp, int null_set) { - register struct type *eltype = ElementType(tp); + struct type *eltype = ElementType(tp); if (nd->nd_class == Link && nd->nd_symb == UPTO) { if (null_set) C_zer(tp->tp_size); @@ -1132,7 +1132,7 @@ static void CodeEl(register struct node *nd, register struct type *tp, int null_ } } -void CodePExpr(register struct node *nd) +void CodePExpr(struct node *nd) { struct desig designator; @@ -1168,7 +1168,7 @@ static void CodeDAddress(struct node *nd, int chk_controlvar) } } -void CodeDStore(register struct node *nd) +void CodeDStore(struct node *nd) { @@ -1180,13 +1180,13 @@ void CodeDStore(register struct node *nd) CodeStore(&designator, nd->nd_type); } -static void DoHIGH(register struct def *df) +static void DoHIGH(struct def *df) { /* Get the high index of a conformant array, indicated by "nd". The high index is the second field in the descriptor of the array, so it is easily found. */ - register arith highoff; + arith highoff; assert(df->df_kind == D_VARIABLE); assert(IsConformantArray(df->df_type)); diff --git a/lang/m2/comp/code.h b/lang/m2/comp/code.h index 7d49ef65a1..173ae8baf8 100644 --- a/lang/m2/comp/code.h +++ b/lang/m2/comp/code.h @@ -21,7 +21,7 @@ struct type; /* Generate code to push constant "cst" with size "size" bytes. */ void CodeConst(arith cst, int size); /* Generate constant character or string. */ -void CodeString(register struct node *nd); +void CodeString(struct node *nd); /* Generate code for an expression contained in "nd". */ void CodeExpr(struct node *nd, struct desig *ds, label true_label, label false_label); /* Generate implicit type conversion code. */ @@ -31,15 +31,15 @@ void CodeCoercion(struct type *t1, struct type *t2); void CodeCall(struct node *nd); void CodePString(struct node *nd, struct type *tp); /* Generate a range check if necessary */ -void RangeCheck(register struct type *tpl, struct type *tpr); -void CodeOper(register struct node *expr, label true_label, label false_label); +void RangeCheck(struct type *tpl, struct type *tpr); +void CodeOper(struct node *expr, label true_label, label false_label); /* Generate code to push the value of the expression "nd" on the stack. */ -void CodePExpr(register struct node *nd); +void CodePExpr(struct node *nd); /* Generate code to store the expression on the stack into the designator "nd". */ -void CodeDStore(register struct node *nd); +void CodeDStore(struct node *nd); #ifdef SQUEEZE void c_bra(label l); diff --git a/lang/m2/comp/cstoper.c b/lang/m2/comp/cstoper.c index 9556cbf205..a4368c379e 100644 --- a/lang/m2/comp/cstoper.c +++ b/lang/m2/comp/cstoper.c @@ -46,7 +46,7 @@ arith min_int[] = { 0L, -128L, -32768L, 0L, -2147483647L-1 }; extern char options[]; -static void CutSize(register struct node *); +static void CutSize(struct node *); static void overflow(struct node *expp) @@ -58,9 +58,9 @@ static void overflow(struct node *expp) static void commonbin(struct node **expp) { - register struct node *exp = *expp; + struct node *exp = *expp; struct type *tp = exp->nd_type; - register struct node *right = exp->nd_RIGHT; + struct node *right = exp->nd_RIGHT; exp->nd_RIGHT = 0; FreeNode(exp); @@ -73,9 +73,9 @@ void cstunary(struct node **expp) /* The unary operation in "expp" is performed on the constant expression below it, and the result stored in expp. */ - register struct node *exp = *expp; - register struct node *right = exp->nd_RIGHT; - register arith o1 = right->nd_INT; + struct node *exp = *expp; + struct node *right = exp->nd_RIGHT; + arith o1 = right->nd_INT; switch(exp->nd_symb) { /* Should not get here @@ -110,8 +110,8 @@ static void divide(arith *pdiv, arith *prem) /* Unsigned divide *pdiv by *prem, and store result in *pdiv, remainder in *prem */ - register arith o1 = *pdiv; - register arith o2 = *prem; + arith o1 = *pdiv; + arith o2 = *prem; *pdiv = (unsigned arith) o1 / (unsigned arith) o2; *prem = (unsigned arith) o1 % (unsigned arith) o2; @@ -123,10 +123,10 @@ void cstibin(struct node **expp) expressions below it, and the result restored in expp. This version is for INTEGER expressions. */ - register struct node *exp = *expp; - register arith o1 = exp->nd_LEFT->nd_INT; - register arith o2 = exp->nd_RIGHT->nd_INT; - register int sz = exp->nd_type->tp_size; + struct node *exp = *expp; + arith o1 = exp->nd_LEFT->nd_INT; + arith o2 = exp->nd_RIGHT->nd_INT; + int sz = exp->nd_type->tp_size; assert(exp->nd_class == Oper); assert(exp->nd_LEFT->nd_class == Value); @@ -232,10 +232,10 @@ void cstfbin(struct node **expp) expressions below it, and the result restored in expp. This version is for REAL expressions. */ - register struct node *exp = *expp; - register struct real *p = exp->nd_LEFT->nd_REAL; - register flt_arith *o1 = &p->r_val; - register flt_arith *o2 = &exp->nd_RIGHT->nd_RVAL; + struct node *exp = *expp; + struct real *p = exp->nd_LEFT->nd_REAL; + flt_arith *o1 = &p->r_val; + flt_arith *o2 = &exp->nd_RIGHT->nd_RVAL; int compar = 0; int cmpval = 0; @@ -319,10 +319,10 @@ void cstubin(struct node **expp) expressions below it, and the result restored in expp. */ - register struct node *exp = *expp; + struct node *exp = *expp; arith o1 = exp->nd_LEFT->nd_INT; arith o2 = exp->nd_RIGHT->nd_INT; - register int sz = exp->nd_type->tp_size; + int sz = exp->nd_type->tp_size; arith tmp1, tmp2; assert(exp->nd_class == Oper); @@ -420,10 +420,10 @@ void cstubin(struct node **expp) void cstset(struct node **expp) { - register struct node *exp = *expp; - register arith *set1, *set2, *set3; - register unsigned int setsize; - register int j; + struct node *exp = *expp; + arith *set1, *set2, *set3; + unsigned int setsize; + int j; assert(exp->nd_RIGHT->nd_class == Set); assert(exp->nd_symb == IN || exp->nd_LEFT->nd_class == Set); @@ -537,8 +537,8 @@ void cstcall(struct node **expp, int call) /* a standard procedure call is found that can be evaluated compile time, so do so. */ - register struct node *expr; - register struct type *tp; + struct node *expr; + struct type *tp; assert((*expp)->nd_class == Call); expr = (*expp)->nd_RIGHT->nd_LEFT; @@ -606,12 +606,12 @@ void cstcall(struct node **expp, int call) } } -static void CutSize(register struct node *expr) +static void CutSize(struct node *expr) { /* The constant value of the expression expr is made to conform to the size of the type of the expression. */ - register struct type *tp = BaseType(expr->nd_type); + struct type *tp = BaseType(expr->nd_type); assert(expr->nd_class == Value); if (tp->tp_fund == T_REAL) return; @@ -627,9 +627,9 @@ static void CutSize(register struct node *expr) void InitCst(void) { - register int i = 0; + int i = 0; #ifndef NOCROSS - register arith bt = (arith)0; + arith bt = (arith)0; while (!(bt < 0)) { i++; diff --git a/lang/m2/comp/declar.g b/lang/m2/comp/declar.g index e27e378bf3..3dddc770b1 100644 --- a/lang/m2/comp/declar.g +++ b/lang/m2/comp/declar.g @@ -186,7 +186,7 @@ TypeDeclaration } ; -type(register struct type **ptp;): +type(struct type **ptp;): %default SimpleType(ptp) | ArrayType(ptp) @@ -200,7 +200,7 @@ type(register struct type **ptp;): ProcedureType(ptp) ; -SimpleType(register struct type **ptp;) : +SimpleType(struct type **ptp;) : qualtype(ptp) [ /* nothing */ @@ -455,7 +455,7 @@ SetType(struct type **ptp;) have to be declared yet, so be careful about identifying type-identifiers. */ -PointerType(register struct type **ptp;) +PointerType(struct type **ptp;) { register struct type *tp; } : { tp = construct_type(T_POINTER, NULLTYPE); } diff --git a/lang/m2/comp/def.c b/lang/m2/comp/def.c index 456d768054..66f9553fab 100644 --- a/lang/m2/comp/def.c +++ b/lang/m2/comp/def.c @@ -38,7 +38,7 @@ -static void internal(register char *c) +static void internal(char *c) { if (options['x']) { @@ -48,14 +48,14 @@ static void internal(register char *c) C_inp(c); } -static void DefInFront(register struct def *df) +static void DefInFront(struct def *df) { /* Put definition "df" in front of the list of definitions in its scope. This is neccessary because in some cases the order in this list is important. */ - register struct def *df1 = df->df_scope->sc_def; + struct def *df1 = df->df_scope->sc_def; if (df1 != df) { @@ -82,12 +82,12 @@ static void DefInFront(register struct def *df) } } -struct def *MkDef(register struct idf *id, register struct scope *scope, int kind) +struct def *MkDef(struct idf *id, struct scope *scope, int kind) { /* Create a new definition structure in scope "scope", with id "id" and kind "kind". */ - register struct def *df; + struct def *df; df = new_def(); df->df_idf = id; @@ -109,14 +109,14 @@ struct def *MkDef(register struct idf *id, register struct scope *scope, int kin return df; } -struct def *define(register struct idf *id, register struct scope *scope, int kind) +struct def *define(struct idf *id, struct scope *scope, int kind) { /* Declare an identifier in a scope, but first check if it already has been defined. If so, then check for the cases in which this is legal, and otherwise give an error message. */ - register struct def *df; + struct def *df; DO_DEBUG(options['S'], print("define %s, %x\n", id->id_text, kind)); df = lookup(id, scope, D_IMPORT, 0); @@ -211,14 +211,14 @@ struct def *define(register struct idf *id, register struct scope *scope, int ki return MkDef(id, scope, kind); } -void end_definition_list(register struct def **pdf) +void end_definition_list(struct def **pdf) { /* Remove all imports from a definition module. This is neccesary because the implementation module might import them again. Also, mark all other definitions "QUALIFIED EXPORT". */ - register struct def *df; + struct def *df; while ( (df = *pdf) ) { @@ -241,12 +241,12 @@ void end_definition_list(register struct def **pdf) } } -void RemoveFromIdList(register struct def *df) +void RemoveFromIdList(struct def *df) { /* Remove definition "df" from the definition list */ - register struct idf *id = df->df_idf; - register struct def *df1; + struct idf *id = df->df_idf; + struct def *df1; if ((df1 = id->id_def) == df) id->id_def = df->df_next; @@ -261,14 +261,14 @@ void RemoveFromIdList(register struct def *df) } } -struct def * DeclProc(int type, register struct idf *id) +struct def * DeclProc(int type, struct idf *id) { /* A procedure is declared, either in a definition or a program module. Create a def structure for it (if neccessary). Also create a name for it. */ - register struct def *df; - register struct scope *scope; + struct def *df; + struct scope *scope; static int nmcount; char buf[256]; @@ -326,7 +326,7 @@ struct def * DeclProc(int type, register struct idf *id) return df; } -void EndProc(register struct def *df, struct idf *id) +void EndProc(struct def *df, struct idf *id) { /* The end of a procedure declaration. Check that the closing identifier matches the name of the @@ -349,8 +349,8 @@ struct def * DefineLocalModule(struct idf *id) /* Create a definition for a local module. Also give it a name to be used for code generation. */ - register struct def *df = define(id, CurrentScope, D_MODULE); - register struct scope *sc; + struct def *df = define(id, CurrentScope, D_MODULE); + struct scope *sc; static int modulecount = 0; char buf[256]; extern int proclevel; @@ -385,7 +385,7 @@ struct def * DefineLocalModule(struct idf *id) return df; } -void CheckWithDef(register struct def *df, struct type *tp) +void CheckWithDef(struct def *df, struct type *tp) { /* Check the header of a procedure declaration against a possible earlier definition in the definition module. @@ -409,7 +409,7 @@ void CheckWithDef(register struct def *df, struct type *tp) } #ifdef DEBUG -void PrDef(register struct def *df) +void PrDef(struct def *df) { print("n: %s, k: %d\n", df->df_idf->id_text, df->df_kind); } diff --git a/lang/m2/comp/def.h b/lang/m2/comp/def.h index 83e2acdd11..5acad79a4c 100644 --- a/lang/m2/comp/def.h +++ b/lang/m2/comp/def.h @@ -142,13 +142,13 @@ struct scope; struct idf; -struct def *MkDef(register struct idf *id, register struct scope *scope, int kind); -struct def *define(register struct idf *id, register struct scope *scope, int kind); -void RemoveFromIdList(register struct def *df); -struct def * DeclProc(int type, register struct idf *id); -void EndProc(register struct def *df, struct idf *id); +struct def *MkDef(struct idf *id, struct scope *scope, int kind); +struct def *define(struct idf *id, struct scope *scope, int kind); +void RemoveFromIdList(struct def *df); +struct def * DeclProc(int type, struct idf *id); +void EndProc(struct def *df, struct idf *id); struct def * DefineLocalModule(struct idf *id); -void CheckWithDef(register struct def *df, struct type *tp); -void end_definition_list(register struct def **pdf); +void CheckWithDef(struct def *df, struct type *tp); +void end_definition_list(struct def **pdf); #endif /* DEF_H_ */ diff --git a/lang/m2/comp/defmodule.c b/lang/m2/comp/defmodule.c index 1a4b6215d5..a8968a0c5a 100644 --- a/lang/m2/comp/defmodule.c +++ b/lang/m2/comp/defmodule.c @@ -43,9 +43,9 @@ extern void DefModule(void); /* Lpars */ struct idf* DefId; -char* getwdir(register char *fn) +char* getwdir(char *fn) { - register char* p; + char* p; while ((p = strrchr(fn, '/')) && *(p + 1) == '\0') { @@ -90,14 +90,14 @@ static int GetFile(char *name) return 1; } -struct def* GetDefinitionModule(register struct idf* id, int incr) +struct def* GetDefinitionModule(struct idf* id, int incr) { /* Return a pointer to the "def" structure of the definition module indicated by "id". We may have to read the definition module itself. Also increment level by "incr". */ - register struct def* df; + struct def* df; static int level; struct scopelist* vis; char* fn = FileName; @@ -140,7 +140,7 @@ struct def* GetDefinitionModule(register struct idf* id, int incr) to call its initialization routine */ static struct node* nd_end; - register struct node* n; + struct node* n; extern struct node* Modules; n = dot2leaf(Def); diff --git a/lang/m2/comp/defmodule.h b/lang/m2/comp/defmodule.h index caf2af1bac..bcbaeae690 100644 --- a/lang/m2/comp/defmodule.h +++ b/lang/m2/comp/defmodule.h @@ -1,7 +1,7 @@ #ifndef DEFMODULE_H #define DEFMODULE_H -extern char* getwdir(register char *fn); -extern struct def* GetDefinitionModule(register struct idf* id, int incr); +extern char* getwdir(char *fn); +extern struct def* GetDefinitionModule(struct idf* id, int incr); #endif diff --git a/lang/m2/comp/desig.c b/lang/m2/comp/desig.c index 24fe41e055..02ad46cbf9 100644 --- a/lang/m2/comp/desig.c +++ b/lang/m2/comp/desig.c @@ -81,7 +81,7 @@ void STL(arith offset, arith size) } } -int DoLoad(register struct desig *ds, arith size) +int DoLoad(struct desig *ds, arith size) { /* Try to load designator with word or double-word operation. Return 0 if not done @@ -105,7 +105,7 @@ int DoLoad(register struct desig *ds, arith size) return 1; } -int DoStore(register struct desig *ds, arith size) +int DoStore(struct desig *ds, arith size) { /* Try to store designator with word or double-word operation. Return 0 if not done @@ -153,7 +153,7 @@ int DoStore(register struct desig *ds, arith size) multiple of word_size only */ -static int suitable_move(register struct type *tp) +static int suitable_move(struct type *tp) { /* Find out how to load or store the value indicated by "ds". There are four ways: @@ -171,7 +171,7 @@ static int suitable_move(register struct type *tp) return USE_BLM; } -void CodeValue(register struct desig *ds, register struct type *tp) +void CodeValue(struct desig *ds, struct type *tp) { /* Generate code to load the value of the designator described in "ds". @@ -234,12 +234,12 @@ void CodeValue(register struct desig *ds, register struct type *tp) ds->dsg_kind = DSG_LOADED; } -void ChkForFOR(register struct node *nd) +void ChkForFOR(struct node *nd) { /* Check for an assignment to a FOR-loop control variable */ if (nd->nd_class == Def) { - register struct def *df = nd->nd_def; + struct def *df = nd->nd_def; if (df->df_flags & D_FORLOOP) { node_warning(nd, @@ -251,7 +251,7 @@ void ChkForFOR(register struct node *nd) } } -void CodeStore(register struct desig *ds, register struct type *tp) +void CodeStore(struct desig *ds, struct type *tp) { /* Generate code to store the value on the stack in the designator described in "ds" @@ -296,7 +296,7 @@ void CodeStore(register struct desig *ds, register struct type *tp) ds->dsg_kind = DSG_INIT; } -void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize) +void CodeCopy(struct desig *lhs, struct desig *rhs, arith sz, arith *psize) { /* Do part of a copy, which is assumed to be "reasonable", so that it can be done with LOI/STI or BLM. @@ -321,7 +321,7 @@ void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, struct desig null_desig; -void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp) +void CodeMove(struct desig *rhs, struct node *left, struct type *rtp) { /* Generate code for an assignment. Testing of type compatibility and the like is already done. @@ -329,7 +329,7 @@ void CodeMove(register struct desig *rhs, register struct node *left, struct typ generated. */ struct desig lhs; - register struct type *tp = left->nd_type; + struct type *tp = left->nd_type; int loadedflag = 0; lhs = null_desig; @@ -355,7 +355,7 @@ void CodeMove(register struct desig *rhs, register struct node *left, struct typ fit(tp->tp_size, (int) word_size) && (int) (lhs.dsg_offset) % word_align == (int) (rhs->dsg_offset) % word_align) { - register int sz = 1; + int sz = 1; arith size = tp->tp_size; while (size && sz < word_align) { @@ -420,7 +420,7 @@ void CodeMove(register struct desig *rhs, register struct node *left, struct typ } } -void CodeAddress(register struct desig *ds) +void CodeAddress(struct desig *ds) { /* Generate code to load the address of the designator described in "ds" @@ -460,7 +460,7 @@ void CodeAddress(register struct desig *ds) ds->dsg_kind = DSG_PLOADED; } -void CodeFieldDesig(register struct def *df, register struct desig *ds) +void CodeFieldDesig(struct def *df, struct desig *ds) { /* Generate code for a field designator. Only the code common for address as well as value computation is generated, and the @@ -476,7 +476,7 @@ void CodeFieldDesig(register struct def *df, register struct desig *ds) first one of the proper record type, which is recognized by its scope indication. */ - register struct withdesig *wds = WithDesigs; + struct withdesig *wds = WithDesigs; assert(wds != 0); @@ -510,14 +510,14 @@ void CodeFieldDesig(register struct def *df, register struct desig *ds) } } -void CodeVarDesig(register struct def *df, register struct desig *ds) +void CodeVarDesig(struct def *df, struct desig *ds) { /* Generate code for a variable represented by a "def" structure. Of course, there are numerous cases: the variable is local, it is a value parameter, it is a var parameter, it is one of those of an enclosing procedure, or it is global. */ - register struct scope *sc = df->df_scope; + struct scope *sc = df->df_scope; int difflevel; /* Selections from a module are handled earlier, when identifying @@ -586,12 +586,12 @@ void CodeVarDesig(register struct def *df, register struct desig *ds) ds->dsg_def = df; } -void CodeDesig(register struct node *nd, register struct desig *ds) +void CodeDesig(struct node *nd, struct desig *ds) { /* Generate code for a designator. Use divide and conquer principle */ - register struct def *df; + struct def *df; switch(nd->nd_class) { /* Divide */ case Def: diff --git a/lang/m2/comp/desig.h b/lang/m2/comp/desig.h index 522b7e3036..fe2db9d609 100644 --- a/lang/m2/comp/desig.h +++ b/lang/m2/comp/desig.h @@ -75,14 +75,14 @@ struct node; void LOL(arith offset, arith size); void STL(arith offset, arith size); -void CodeValue(register struct desig *ds, register struct type *tp); -void ChkForFOR(register struct node *nd); -void CodeStore(register struct desig *ds, register struct type *tp); -void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize); -void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp); -void CodeAddress(register struct desig *ds); -void CodeFieldDesig(register struct def *df, register struct desig *ds); -void CodeVarDesig(register struct def *df, register struct desig *ds); -void CodeDesig(register struct node *nd, register struct desig *ds); +void CodeValue(struct desig *ds, struct type *tp); +void ChkForFOR(struct node *nd); +void CodeStore(struct desig *ds, struct type *tp); +void CodeCopy(struct desig *lhs, struct desig *rhs, arith sz, arith *psize); +void CodeMove(struct desig *rhs, struct node *left, struct type *rtp); +void CodeAddress(struct desig *ds); +void CodeFieldDesig(struct def *df, struct desig *ds); +void CodeVarDesig(struct def *df, struct desig *ds); +void CodeDesig(struct node *nd, struct desig *ds); #endif /* DESIG_H_ */ diff --git a/lang/m2/comp/enter.c b/lang/m2/comp/enter.c index e8cd2925f2..130ed2e6f2 100644 --- a/lang/m2/comp/enter.c +++ b/lang/m2/comp/enter.c @@ -38,7 +38,7 @@ #include "defmodule.h" -static struct def *DoImport(register struct def *, struct scope *, int); +static struct def *DoImport(struct def *, struct scope *, int); struct def *Enter(char *name, int kind, struct type *type, int pnam) { @@ -46,7 +46,7 @@ struct def *Enter(char *name, int kind, struct type *type, int pnam) "type" in the Current Scope. If it is a standard name, also put its number in the definition structure. */ - register struct def *df; + struct def *df; df = define(str2idf(name, 0), CurrentScope, kind); df->df_type = type; @@ -66,7 +66,7 @@ struct def *EnterType(char *name, struct type *type) return Enter(name, D_TYPE, type, 0); } -void EnterEnumList(struct node *Idlist, register struct type *type) +void EnterEnumList(struct node *Idlist, struct type *type) { /* Put a list of enumeration literals in the symbol table. They all have type "type". @@ -75,8 +75,8 @@ void EnterEnumList(struct node *Idlist, register struct type *type) be exported, in which case its literals must also be exported. Thus, we need an easy way to get to them. */ - register struct def *df, *df1 = 0; - register struct node *idlist = Idlist; + struct def *df, *df1 = 0; + struct node *idlist = Idlist; type->enm_ncst = 0; for (; idlist; idlist = idlist->nd_NEXT) { @@ -92,7 +92,7 @@ void EnterEnumList(struct node *Idlist, register struct type *type) FreeNode(Idlist); } -void EnterFieldList(struct node *Idlist, register struct type *type, struct scope *scope, +void EnterFieldList(struct node *Idlist, struct type *type, struct scope *scope, arith *addr) { /* Put a list of fields in the symbol table. @@ -100,8 +100,8 @@ void EnterFieldList(struct node *Idlist, register struct type *type, struct scop Mark them as QUALIFIED EXPORT, because that's exactly what fields are, you can get to them by qualifying them. */ - register struct def *df; - register struct node *idlist = Idlist; + struct def *df; + struct node *idlist = Idlist; for (; idlist; idlist = idlist->nd_NEXT) { df = define(idlist->nd_IDF, scope, D_FIELD); @@ -115,9 +115,9 @@ void EnterFieldList(struct node *Idlist, register struct type *type, struct scop void EnterVarList(struct node *Idlist, struct type *type, int local) { - register struct def *df; - register struct node *idlist = Idlist; - register struct scopelist *sc = CurrVis; + struct def *df; + struct node *idlist = Idlist; + struct scopelist *sc = CurrVis; char buf[256]; if (local) { @@ -133,7 +133,7 @@ void EnterVarList(struct node *Idlist, struct type *type, int local) if (idlist->nd_LEFT->nd_NEXT) { /* An address was supplied */ - register struct type *tp = idlist->nd_LEFT->nd_NEXT->nd_type; + struct type *tp = idlist->nd_LEFT->nd_NEXT->nd_type; df->df_flags |= D_ADDRGIVEN | D_NOREG; if (tp != error_type && !(tp->tp_fund & T_CARDINAL)){ @@ -186,9 +186,9 @@ void EnterParamList(struct paramlist **ppr, int VARp, arith *off) { - register struct paramlist *pr; - register struct def *df; - register struct node *idlist = Idlist; + struct paramlist *pr; + struct def *df; + struct node *idlist = Idlist; struct node *dummy = 0; static struct paramlist *last; @@ -230,14 +230,14 @@ void EnterParamList(struct paramlist **ppr, } -static void ImportEffects(register struct def *idef, struct scope *scope, int flag) +static void ImportEffects(struct def *idef, struct scope *scope, int flag) { /* Handle side effects of an import: - a module could have unqualified exports ??? - importing an enumeration type also imports literals */ - register struct def *df = idef; - register struct type *tp; + struct def *df = idef; + struct type *tp; while ((df->df_kind & D_IMPORTED) && df->imp_def != df) { /* The second condition could occur on some (erroneous and @@ -296,11 +296,11 @@ static void ImportEffects(register struct def *idef, struct scope *scope, int fl } } -static struct def *DoImport(register struct def *df, struct scope *scope, int flag) +static struct def *DoImport(struct def *df, struct scope *scope, int flag) { /* Definition "df" is imported to scope "scope". */ - register struct def *idef = define(df->df_idf, scope, D_IMPORT); + struct def *idef = define(df->df_idf, scope, D_IMPORT); idef->imp_def = df; idef->df_flags |= flag; @@ -309,13 +309,13 @@ static struct def *DoImport(register struct def *df, struct scope *scope, int fl } -static void ForwModule(register struct def *df, struct node *nd) +static void ForwModule(struct def *df, struct node *nd) { /* An import is done from a not yet defined module "df". We could also end up here for not found DEFINITION MODULES. Create a declaration and a scope for this module. */ - register struct scopelist *vis; + struct scopelist *vis; if (df->df_scope != GlobalScope) { df->df_scope = enclosing(CurrVis)->sc_scope; @@ -334,12 +334,12 @@ static void ForwModule(register struct def *df, struct node *nd) df->for_node = nd; } -static struct def *ForwDef(register struct node *ids, struct scope *scope) +static struct def *ForwDef(struct node *ids, struct scope *scope) { /* Enter a forward definition of "ids" in scope "scope", if it is not already defined. */ - register struct def *df; + struct def *df; if (!(df = lookup(ids->nd_IDF, scope, 0, 0))) { df = define(ids->nd_IDF, scope, D_FORWARD); @@ -352,8 +352,8 @@ static struct def *ForwDef(register struct node *ids, struct scope *scope) void EnterExportList(struct node *Idlist, int qualified) { - register struct node *idlist = Idlist; - register struct def *df, *df1; + struct node *idlist = Idlist; + struct def *df, *df1; for (;idlist; idlist = idlist->nd_NEXT) { df = lookup(idlist->nd_IDF, CurrentScope, 0, 0); @@ -431,11 +431,11 @@ void CheckForImports(struct def *df) /* We have a definition for "df"; check all imports of it for side-effects */ - register struct def *df1 = df->df_idf->id_def; + struct def *df1 = df->df_idf->id_def; while (df1) { if (df1->df_kind & D_IMPORTED) { - register struct def *df2 = df1->imp_def; + struct def *df2 = df1->imp_def; while (df2->df_kind & D_IMPORTED) df2 = df2->imp_def; if (df2 == df) { @@ -451,7 +451,7 @@ void EnterFromImportList(struct node *idlist, struct def *FromDef, struct node * /* Import the list Idlist from the module indicated by Fromdef. */ struct scope *sc; - register struct def *df; + struct def *df; char *module_name = FromDef->df_idf->id_text; switch(FromDef->df_kind) { diff --git a/lang/m2/comp/enter.h b/lang/m2/comp/enter.h index bb6aec4426..30ee07038d 100644 --- a/lang/m2/comp/enter.h +++ b/lang/m2/comp/enter.h @@ -18,8 +18,8 @@ struct def; struct def *Enter(char *name, int kind, struct type *type, int pnam); struct def *EnterType(char *name, struct type *type); -void EnterEnumList(struct node *Idlist, register struct type *type); -void EnterFieldList(struct node *Idlist, register struct type *type, struct scope *scope, +void EnterEnumList(struct node *Idlist, struct type *type); +void EnterFieldList(struct node *Idlist, struct type *type, struct scope *scope, arith *addr); /* Enter a list of identifiers representing variables into the name list. "type" represents the type of the variables. diff --git a/lang/m2/comp/error.c b/lang/m2/comp/error.c index 8d596765a8..5719ed2f3f 100644 --- a/lang/m2/comp/error.c +++ b/lang/m2/comp/error.c @@ -63,7 +63,7 @@ int err_occurred; FileName, node errors get their information from the node, whereas other errors use the information in the token. */ -static void _error(int, struct node *, char *, register va_list, int); +static void _error(int, struct node *, char *, va_list, int); #if __STDC__ #ifdef DEBUG @@ -322,13 +322,13 @@ void crash(va_alist) } #endif -static void _error(int class, struct node *node, char *fmt, register va_list ap, int warn_class) +static void _error(int class, struct node *node, char *fmt, va_list ap, int warn_class) { /* _error attempts to limit the number of error messages for a given line to MAXERR_LINE. */ unsigned int ln = 0; - register char *remark = 0; + char *remark = 0; /* check visibility of message */ if (class == ERROR || class == WARNING) { diff --git a/lang/m2/comp/expression.g b/lang/m2/comp/expression.g index 24a193bf35..77a574f468 100644 --- a/lang/m2/comp/expression.g +++ b/lang/m2/comp/expression.g @@ -52,7 +52,7 @@ qualident(struct node **p;) ]* ; -selector(register struct node **pnd;) +selector(struct node **pnd;) { struct node *nd; } : '.' { nd = dot2leaf(Select); nd->nd_NEXT = *pnd; *pnd = nd; } @@ -74,7 +74,7 @@ ExpList(struct node **pnd;) ]* ; -ConstExpression(register struct node **pnd;) +ConstExpression(struct node **pnd;) { }: expression(pnd) @@ -98,7 +98,7 @@ ConstExpression(register struct node **pnd;) } ; -expression(register struct node **pnd;) +expression(struct node **pnd;) { } : SimpleExpression(pnd) @@ -117,7 +117,7 @@ relation: ; */ -SimpleExpression(register struct node **pnd;) +SimpleExpression(struct node **pnd;) { register struct node *nd = 0; } : @@ -170,7 +170,7 @@ MulOperator: ; */ -factor(register struct node **p;) +factor(struct node **p;) { register struct node *nd; struct node *nd1; @@ -246,7 +246,7 @@ ActualParameters(struct node **pnd;): '(' ExpList(pnd)? ')' ; -element(register struct node *nd;) : +element(struct node *nd;) : expression(&(nd->nd_RIGHT)) [ UPTO @@ -265,7 +265,7 @@ designator(struct node **pnd;) designator_tail(pnd) ; -designator_tail(register struct node **pnd;): +designator_tail(struct node **pnd;): visible_designator_tail(pnd) [ %persistent %default diff --git a/lang/m2/comp/lookup.c b/lang/m2/comp/lookup.c index 2fcf35779a..ee7d6f5546 100644 --- a/lang/m2/comp/lookup.c +++ b/lang/m2/comp/lookup.c @@ -31,14 +31,14 @@ extern int pass_1; extern char options[]; #endif -struct def *lookup(register struct idf *id, struct scope *scope, int import, int flags) +struct def *lookup(struct idf *id, struct scope *scope, int import, int flags) { /* Look up a definition of an identifier in scope "scope". Make the "def" list self-organizing. Return a pointer to its "def" structure if it exists, otherwise return 0. */ - register struct def *df, *df1; + struct def *df, *df1; /* Look in the chain of definitions of this "id" for one with scope "scope". @@ -73,13 +73,13 @@ struct def *lookup(register struct idf *id, struct scope *scope, int import, int return df; } -struct def *lookfor(register struct node *id, register struct scopelist *vis, int message, int flags) +struct def *lookfor(struct node *id, struct scopelist *vis, int message, int flags) { /* Look for an identifier in the visibility range started by "vis". If it is not defined create a dummy definition and, if message is set, give an error message */ - register struct scopelist *sc; + struct scopelist *sc; struct scopelist *sc1 = 0; struct def *df; diff --git a/lang/m2/comp/lookup.h b/lang/m2/comp/lookup.h index 22cb4aa8fc..66e330797d 100644 --- a/lang/m2/comp/lookup.h +++ b/lang/m2/comp/lookup.h @@ -15,7 +15,7 @@ struct node; struct scopelist; struct def; -struct def *lookup(register struct idf *id, struct scope *scope, int import, int flags); -struct def *lookfor(register struct node *id, register struct scopelist *vis, int message, int flags); +struct def *lookup(struct idf *id, struct scope *scope, int import, int flags); +struct def *lookfor(struct node *id, struct scopelist *vis, int message, int flags); #endif /* LOOKUP_H_ */ diff --git a/lang/m2/comp/main.c b/lang/m2/comp/main.c index 8119de4355..2995f90727 100644 --- a/lang/m2/comp/main.c +++ b/lang/m2/comp/main.c @@ -59,18 +59,18 @@ struct node *EmptyStatement = &_emptystat; /* Forward declarations. */ struct stdproc; int Compile(char *, char *); -static void AddProcs(register struct stdproc *); +static void AddProcs(struct stdproc *); static void AddStandards(void); /* External function declarations */ extern void CompUnit(void); extern void DefModule(void); /* Lpars */ -extern void reserve(register struct tokenname *); /* tokenname */ -char* getwdir(register char *); /* defmodule */ +extern void reserve(struct tokenname *); /* tokenname */ +char* getwdir(char *); /* defmodule */ int main(int argc, char **argv) { - register int Nargc = 1; - register char **Nargv = &argv[0]; + int Nargc = 1; + char **Nargv = &argv[0]; ProgName = *argv++; DEFPATH = (char **) Malloc((unsigned)mDEF * sizeof(char *)); @@ -145,7 +145,7 @@ int Compile(char *src, char *dst) #ifdef DEBUG void LexScan(void) { - register t_token *tkp = ˙ + t_token *tkp = ˙ while (LLlex() > 0) { @@ -213,7 +213,7 @@ static struct stdproc sysprocs[] = { { 0, 0 } }; -static void AddProcs(register struct stdproc *p) +static void AddProcs(struct stdproc *p) { for (; p->st_nam != 0; p++) { if (! Enter(p->st_nam, D_PROCEDURE, std_type, p->st_con)) { @@ -224,7 +224,7 @@ static void AddProcs(register struct stdproc *p) static void AddStandards(void) { - register struct def *df; + struct def *df; static t_token nilconst = { INTEGER, 0}; AddProcs(stdprocs); diff --git a/lang/m2/comp/misc.c b/lang/m2/comp/misc.c index 04882d529b..1f59e98e55 100644 --- a/lang/m2/comp/misc.c +++ b/lang/m2/comp/misc.c @@ -25,7 +25,7 @@ #include "node.h" #include "error.h" -void match_id(register struct idf *id1, struct idf *id2) +void match_id(struct idf *id1, struct idf *id2) { /* Check that identifiers id1 and id2 are equal. If they are not, check that we did'nt generate them in the diff --git a/lang/m2/comp/misc.h b/lang/m2/comp/misc.h index c625f8d8f1..b1dc013dbd 100644 --- a/lang/m2/comp/misc.h +++ b/lang/m2/comp/misc.h @@ -16,6 +16,6 @@ struct idf; struct node; -void match_id(register struct idf *id1, struct idf *id2); +void match_id(struct idf *id1, struct idf *id2); struct idf *gen_anon_idf(void); void not_declared(char *what, struct node *id, char *where); diff --git a/lang/m2/comp/node.c b/lang/m2/comp/node.c index e5fd6b92b7..55dc39125c 100644 --- a/lang/m2/comp/node.c +++ b/lang/m2/comp/node.c @@ -43,7 +43,7 @@ static int nsubnodes[] = { struct node *getnode(int class) { - register struct node *nd = new_node(); + struct node *nd = new_node(); if (options['R']) nd->nd_flags |= ROPTION; if (options['A']) nd->nd_flags |= AOPTION; @@ -53,7 +53,7 @@ struct node *getnode(int class) struct node *dot2node(int class, struct node *left, struct node *right) { - register struct node *nd = getnode(class); + struct node *nd = getnode(class); nd->nd_symb = dot.tk_symb; nd->nd_lineno = dot.tk_lineno; @@ -64,7 +64,7 @@ struct node *dot2node(int class, struct node *left, struct node *right) struct node *dot2leaf(int class) { - register struct node *nd = getnode(class); + struct node *nd = getnode(class); nd->nd_token = dot; switch(nsubnodes[class]) { @@ -79,7 +79,7 @@ struct node *dot2leaf(int class) return nd; } -void FreeNode(register struct node *nd) +void FreeNode(struct node *nd) { /* Put nodes that are no longer needed back onto the free list @@ -98,7 +98,7 @@ void FreeNode(register struct node *nd) } /*ARGSUSED*/ -int NodeCrash(register struct node* expp, label exit_label, int end_reached) +int NodeCrash(struct node* expp, label exit_label, int end_reached) { crash("(NodeCrash) Illegal node"); } @@ -120,7 +120,7 @@ void indnt(int lvl) } } -void printnode(register struct node *nd, int lvl) +void printnode(struct node *nd, int lvl) { indnt(lvl); print("Class: %d; Symbol: %s; Flags: %d\n", nd->nd_class, symbol2str(nd->nd_symb), nd->nd_flags); @@ -132,7 +132,7 @@ void printnode(register struct node *nd, int lvl) } } -void PrNode(register struct node *nd, int lvl) +void PrNode(struct node *nd, int lvl) { if (! nd) { indnt(lvl); print("\n"); diff --git a/lang/m2/comp/node.h b/lang/m2/comp/node.h index 4c938a2aac..0b20cd1025 100644 --- a/lang/m2/comp/node.h +++ b/lang/m2/comp/node.h @@ -73,8 +73,8 @@ extern struct node *dot2leaf(int class); struct node *getnode(int class); struct node *dot2node(int class, struct node *left, struct node *right); struct node *dot2leaf(int class); -void FreeNode(register struct node *nd); -int NodeCrash(register struct node* expp, label exit_label, int end_reached); +void FreeNode(struct node *nd); +int NodeCrash(struct node* expp, label exit_label, int end_reached); int PNodeCrash(struct node **expp, int flags); #endif /* NODE_H_ */ diff --git a/lang/m2/comp/options.c b/lang/m2/comp/options.c index d5f8cd5429..e86da7f929 100644 --- a/lang/m2/comp/options.c +++ b/lang/m2/comp/options.c @@ -36,13 +36,13 @@ int warning_classes = W_INITIAL; int gdb_flag; #if (!SQUEEZE) | (!NOCROSS) -static int txt2int(register char **tp) +static int txt2int(char **tp) { /* the integer pointed to by *tp is read, while increasing *tp; the resulting value is yielded. */ - register int val = 0; - register int ch; + int val = 0; + int ch; while (ch = **tp, ch >= '0' && ch <= '9') { val = val * 10 + ch - '0'; @@ -53,7 +53,7 @@ static int txt2int(register char **tp) #endif -void DoOption(register char *text) +void DoOption(char *text) { switch(*text++) { @@ -155,8 +155,8 @@ void DoOption(register char *text) case 'I' : if (*text) { - register int i; - register char *new = text; + int i; + char *new = text; if (nDEF > mDEF) { DEFPATH = (char **) @@ -177,8 +177,8 @@ void DoOption(register char *text) case 'V' : /* set object sizes and alignment requirements */ #ifndef NOCROSS { - register int size; - register int algn; + int size; + int algn; char c; char *t; diff --git a/lang/m2/comp/options.h b/lang/m2/comp/options.h index 5b0c7ba88e..3dcc303cf9 100644 --- a/lang/m2/comp/options.h +++ b/lang/m2/comp/options.h @@ -8,6 +8,6 @@ #ifndef OPTIONS_H_ #define OPTIONS_H_ -void DoOption(register char *text); +void DoOption(char *text); #endif /* OPTIONS_H_ */ diff --git a/lang/m2/comp/program.g b/lang/m2/comp/program.g index 384709efc1..c7882f136b 100644 --- a/lang/m2/comp/program.g +++ b/lang/m2/comp/program.g @@ -75,7 +75,7 @@ ModuleDeclaration } ; -priority(register struct node **prio;): +priority(struct node **prio;): [ '[' ConstExpression(prio) ']' { if (! ((*prio)->nd_type->tp_fund & T_CARDINAL)) { diff --git a/lang/m2/comp/scope.c b/lang/m2/comp/scope.c index b2ef30626c..98b3f0ce77 100644 --- a/lang/m2/comp/scope.c +++ b/lang/m2/comp/scope.c @@ -44,8 +44,8 @@ void open_scope(int scopetype) { /* Open a scope that is either open (automatic imports) or closed. */ - register struct scope *sc = new_scope(); - register struct scopelist *ls = new_scopelist(); + struct scope *sc = new_scope(); + struct scopelist *ls = new_scopelist(); assert(scopetype == OPENSCOPE || scopetype == CLOSEDSCOPE); @@ -72,8 +72,8 @@ struct scope * open_and_close_scope(int scopetype) void InitScope(void) { - register struct scope *sc = new_scope(); - register struct scopelist *ls = new_scopelist(); + struct scope *sc = new_scope(); + struct scopelist *ls = new_scopelist(); sc->sc_level = proclevel; PervasiveScope = sc; @@ -81,7 +81,7 @@ void InitScope(void) CurrVis = ls; } -static void chk_proc(register struct def *df) +static void chk_proc(struct def *df) { /* Called at scope closing. Check all definitions, and if one is a D_PROCHEAD, the procedure was not defined. @@ -109,11 +109,11 @@ static void chk_forw(struct def **pdf) if the scope was a closed scope, give an error message for them, and otherwise move them to the enclosing scope. */ - register struct def *df; + struct def *df; while ( (df = *pdf) ) { while (df->df_kind == D_FORWTYPE) { - register struct def *df2 = df->df_nextinscope; + struct def *df2 = df->df_nextinscope; pdf = NULL; ForceForwardTypeDef(df); /* removes df */ df = df2; @@ -135,9 +135,9 @@ df->df_idf->id_text); Maybe the definitions are in the enclosing scope? */ - register struct scopelist *ls = + struct scopelist *ls = nextvisible(CurrVis); - register struct def *df1 = lookup(df->df_idf, ls->sc_scope, 0, 0); + struct def *df1 = lookup(df->df_idf, ls->sc_scope, 0, 0); if (pdf) *pdf = df->df_nextinscope; @@ -166,7 +166,7 @@ void Reverse(struct def **pdf) Also, while we're at it, remove uninteresting definitions from this list. */ - register struct def *df, *df1; + struct def *df, *df1; #define INTERESTING (D_MODULE|D_PROCEDURE|D_PROCHEAD|D_VARIABLE|D_IMPORTED|D_TYPE|D_CONST|D_FIELD) df = 0; @@ -191,7 +191,7 @@ void close_scope(int flag) either POINTER declarations, or EXPORTs, or forward references to MODULES */ - register struct scope *sc = CurrentScope; + struct scope *sc = CurrentScope; assert(sc != 0); @@ -208,7 +208,7 @@ void close_scope(int flag) } #ifdef DEBUG -void DumpScope(register struct def *df) +void DumpScope(struct def *df) { while (df) { PrDef(df); diff --git a/lang/m2/comp/scope.h b/lang/m2/comp/scope.h index 17ff965469..aea3a1d1d7 100644 --- a/lang/m2/comp/scope.h +++ b/lang/m2/comp/scope.h @@ -68,7 +68,7 @@ struct scope * open_and_close_scope(int scopetype); void InitScope(void); void close_scope(int flag); #ifdef DEBUG -void DumpScope(register struct def *df); +void DumpScope(struct def *df); #endif diff --git a/lang/m2/comp/stab.c b/lang/m2/comp/stab.c index 7ade98bfec..0c2c9f5b70 100644 --- a/lang/m2/comp/stab.c +++ b/lang/m2/comp/stab.c @@ -68,7 +68,7 @@ static void adds_db_str(char *s) while (*s) addc_db_str(*s++); } -static void stb_type(register struct type *tp, int assign_num) +static void stb_type(struct type *tp, int assign_num) { char buf[128]; static int stb_count; @@ -188,7 +188,7 @@ static void stb_type(register struct type *tp, int assign_num) case T_ENUMERATION: addc_db_str('e'); { - register struct def *edef = tp->enm_enums; + struct def *edef = tp->enm_enums; while (edef) { adds_db_str(sprint(buf, "%s:%ld,", @@ -202,7 +202,7 @@ static void stb_type(register struct type *tp, int assign_num) case T_RECORD: adds_db_str(sprint(buf, "s%ld", tp->tp_size)); { - register struct def *sdef = tp->rec_scope->sc_def; + struct def *sdef = tp->rec_scope->sc_def; while (sdef) { adds_db_str(sdef->df_idf->id_text); @@ -226,7 +226,7 @@ static void stb_type(register struct type *tp, int assign_num) addc_db_str('Q'); stb_type(tp->tp_next ? tp->tp_next : void_type, 0); { - register struct paramlist *p = tp->prc_params; + struct paramlist *p = tp->prc_params; int paramcount = 0; while (p) { @@ -265,9 +265,9 @@ void stb_addtp(char *s, struct type *tp) (arith) 0); } -void stb_string(register struct def *df, int kind) +void stb_string(struct def *df, int kind) { - register struct type *tp = df->df_type; + struct type *tp = df->df_type; char buf[64]; create_db_str(); @@ -398,7 +398,7 @@ void stb_string(register struct def *df, int kind) addc_db_str(';'); break; case T_STRING: { - register char *p = df->con_const.TOK_STR; + char *p = df->con_const.TOK_STR; adds_db_str("s'"); while (*p) { @@ -416,7 +416,7 @@ void stb_string(register struct def *df, int kind) adds_db_str(sprint(buf, ",%ld;", df->con_const.TOK_INT)); break; case T_SET: { - register int i; + int i; addc_db_str('S'); stb_type(tp, 0); diff --git a/lang/m2/comp/stab.h b/lang/m2/comp/stab.h index 6bb75221b9..9388b9fc85 100644 --- a/lang/m2/comp/stab.h +++ b/lang/m2/comp/stab.h @@ -13,7 +13,7 @@ struct def; void stb_addtp(char *s, struct type *tp); -void stb_string(register struct def *df, int kind); +void stb_string(struct def *df, int kind); #endif /* STAB_H_ */ diff --git a/lang/m2/comp/statement.g b/lang/m2/comp/statement.g index c6fc933e4a..0efb4f769b 100644 --- a/lang/m2/comp/statement.g +++ b/lang/m2/comp/statement.g @@ -27,7 +27,7 @@ static int loopcount = 0; /* Count nested loops */ extern struct node *EmptyStatement; } -statement(register struct node **pnd;) +statement(struct node **pnd;) { register struct node *nd; extern int return_occurred; @@ -110,7 +110,7 @@ ProcedureCall: ; */ -StatementSequence(register struct node **pnd;) +StatementSequence(struct node **pnd;) { struct node *nd; register struct node *nd1; diff --git a/lang/m2/comp/tmpvar.c b/lang/m2/comp/tmpvar.c index d2224a6b81..50104321b1 100644 --- a/lang/m2/comp/tmpvar.c +++ b/lang/m2/comp/tmpvar.c @@ -58,7 +58,7 @@ void TmpOpen(struct scope *sc) arith TmpSpace(arith sz, int al) { - register struct scope *sc = ProcScope; + struct scope *sc = ProcScope; sc->sc_off = - WA(align(sz - sc->sc_off, al)); return sc->sc_off; @@ -66,8 +66,8 @@ arith TmpSpace(arith sz, int al) static arith NewTmp(struct tmpvar **plist, arith sz, int al, int regtype) { - register arith offset; - register struct tmpvar *tmp; + arith offset; + struct tmpvar *tmp; if (!*plist) { offset = TmpSpace(sz, al); @@ -95,7 +95,7 @@ arith NewPtr(void) static void FreeTmp(struct tmpvar **plist, arith off) { - register struct tmpvar *tmp = new_tmpvar(); + struct tmpvar *tmp = new_tmpvar(); tmp->t_next = *plist; tmp->t_offset = off; @@ -114,7 +114,7 @@ void FreePtr(arith off) void TmpClose(void) { - register struct tmpvar *tmp, *tmp1; + struct tmpvar *tmp, *tmp1; tmp = TmpInts; while (tmp) { diff --git a/lang/m2/comp/tokenname.c b/lang/m2/comp/tokenname.c index 604ce8c16c..38221057ab 100644 --- a/lang/m2/comp/tokenname.c +++ b/lang/m2/comp/tokenname.c @@ -100,12 +100,12 @@ struct tokenname tkstandard[] = { /* standard identifiers */ /* Some routines to handle tokennames */ -void reserve(register struct tokenname *resv) +void reserve(struct tokenname *resv) { /* The names of the tokens described in resv are entered as reserved words. */ - register struct idf *p; + struct idf *p; while (resv->tn_symbol) { p = str2idf(resv->tn_name, 0); diff --git a/lang/m2/comp/type.c b/lang/m2/comp/type.c index 6b7df64e89..40e3cf3f66 100644 --- a/lang/m2/comp/type.c +++ b/lang/m2/comp/type.c @@ -80,12 +80,12 @@ struct type *error_type; -struct type *construct_type(int fund, register struct type *tp) +struct type *construct_type(int fund, struct type *tp) { /* fund must be a type constructor. The pointer to the constructed type is returned. */ - register struct type *dtp = new_type(); + struct type *dtp = new_type(); switch (dtp->tp_fund = fund) { case T_PROCEDURE: @@ -132,7 +132,7 @@ arith align(arith pos, int al) struct type *standard_type(int fund, int algn, arith size) { - register struct type *tp = new_type(); + struct type *tp = new_type(); tp->tp_fund = fund; tp->tp_align = algn; @@ -146,7 +146,7 @@ struct type *standard_type(int fund, int algn, arith size) void InitTypes(void) { - register struct type *tp; + struct type *tp; /* first, do some checking */ @@ -222,7 +222,7 @@ int fit(arith sz, int nbytes) return ((sz) + ((arith)0x80<<(((nbytes)-1)*8)) & ~full_mask[(nbytes)]) == 0; } -static void u_small(register struct type *tp, arith n) +static void u_small(struct type *tp, arith n) { if (ufit(n, 1)) { tp->tp_size = 1; @@ -236,7 +236,7 @@ static void u_small(register struct type *tp, arith n) struct type *enum_type(struct node *EnumList) { - register struct type *tp = + struct type *tp = standard_type(T_ENUMERATION, int_align, int_size); EnterEnumList(EnumList, tp); @@ -249,10 +249,10 @@ struct type *enum_type(struct node *EnumList) struct type *qualified_type(struct node **pnd) { - register struct def *df; + struct def *df; if (ChkDesig(pnd, D_USED)) { - register struct node *nd = *pnd; + struct node *nd = *pnd; if (nd->nd_class != Def) { node_error(nd, "type expected"); FreeNode(nd); @@ -292,7 +292,7 @@ int chk_bounds(arith l1, arith l2, int fund) return (unsigned arith) l2 >= (unsigned arith) l1; } -int in_range(arith i, register struct type *tp) +int in_range(arith i, struct type *tp) { @@ -311,8 +311,8 @@ int in_range(arith i, register struct type *tp) struct type *subr_type(struct node *lb, struct node *ub, struct type *base) { - register struct type *tp = BaseType(lb->nd_type); - register struct type *res; + struct type *tp = BaseType(lb->nd_type); + struct type *res; if (tp == intorcard_type) { /* Lower bound >= 0; in this case, the base type is CARDINAL, @@ -401,7 +401,7 @@ struct type *subr_type(struct node *lb, struct node *ub, struct type *base) struct type *proc_type(struct type *result_type, struct paramlist *parameters, arith n_bytes_params) { - register struct type *tp = construct_type(T_PROCEDURE, result_type); + struct type *tp = construct_type(T_PROCEDURE, result_type); tp->prc_params = parameters; tp->prc_nbpar = n_bytes_params; @@ -414,15 +414,15 @@ struct type *proc_type(struct type *result_type, struct paramlist *parameters, a return tp; } -void genrck(register struct type *tp) +void genrck(struct type *tp) { /* generate a range check descriptor for type "tp" when neccessary. Return its label. */ arith lb, ub; - register label ol; + label ol; arith size = tp->tp_size; - register struct type *btp = BaseType(tp); + struct type *btp = BaseType(tp); if (size < word_size) size = word_size; getbounds(tp, &lb, &ub); @@ -449,7 +449,7 @@ void genrck(register struct type *tp) } } -void getbounds(register struct type *tp, arith *plo, arith *phi) +void getbounds(struct type *tp, arith *plo, arith *phi) { assert(bounded(tp)); @@ -463,7 +463,7 @@ void getbounds(register struct type *tp, arith *plo, arith *phi) } } -struct type *set_type(register struct type *tp) +struct type *set_type(struct type *tp) { arith lb, ub, diff, alloc_size; @@ -499,14 +499,14 @@ struct type *set_type(register struct type *tp) return tp; } -void ArrayElSize(register struct type *tp) +void ArrayElSize(struct type *tp) { /* Align element size to alignment requirement of element type. Also make sure that its size is either a dividor of the word_size, or a multiple of it. */ - register arith algn; - register struct type *elem_type = tp->arr_elem; + arith algn; + struct type *elem_type = tp->arr_elem; if (elem_type->tp_fund == T_ARRAY) ArraySizes(elem_type); algn = align(elem_type->tp_size, elem_type->tp_align); @@ -525,11 +525,11 @@ void ArrayElSize(register struct type *tp) } } -void ArraySizes(register struct type *tp) +void ArraySizes(struct type *tp) { /* Assign sizes to an array type, and check index type */ - register struct type *index_type = IndexType(tp); + struct type *index_type = IndexType(tp); arith diff; ArrayElSize(tp); @@ -564,13 +564,13 @@ void ArraySizes(register struct type *tp) C_rom_cst(tp->arr_elsize); } -void FreeType(register struct type *tp) +void FreeType(struct type *tp) { /* Release type structures indicated by "tp". This procedure is only called for types, constructed with T_PROCEDURE. */ - register struct paramlist *pr, *pr1; + struct paramlist *pr, *pr1; assert(tp->tp_fund == T_PROCEDURE); @@ -585,7 +585,7 @@ void FreeType(register struct type *tp) free_type(tp); } -void DeclareType(struct node *nd, register struct def *df, register struct type *tp) +void DeclareType(struct node *nd, struct def *df, struct type *tp) { /* A type with type-description "tp" is declared and must be bound to definition "df". @@ -593,7 +593,7 @@ void DeclareType(struct node *nd, register struct def *df, register struct type "df" is already bound. In that case, it is either an opaque type, or an error message was given when "df" was created. */ - register struct type *df_tp = df->df_type; + struct type *df_tp = df->df_type; if (df_tp && df_tp->tp_fund == T_HIDDEN) { if (! (tp->tp_fund & (T_POINTER|T_HIDDEN|T_EQUAL))) { @@ -627,9 +627,9 @@ void DeclareType(struct node *nd, register struct def *df, register struct type SolveForwardTypeRefs(df); } -void SolveForwardTypeRefs(register struct def *df) +void SolveForwardTypeRefs(struct def *df) { - register struct node *nd; + struct node *nd; if (df->df_kind == D_FORWTYPE) { nd = df->df_forw_node; @@ -649,10 +649,10 @@ void SolveForwardTypeRefs(register struct def *df) } -void ForceForwardTypeDef(register struct def *df) +void ForceForwardTypeDef(struct def *df) { - register struct def *df1 = df, *df2; - register struct node *nd = df->df_forw_node; + struct def *df1 = df, *df2; + struct node *nd = df->df_forw_node; while (df && df->df_kind == D_FORWTYPE) { RemoveFromIdList(df); @@ -683,7 +683,7 @@ void ForceForwardTypeDef(register struct def *df) } } -struct type *RemoveEqual(register struct type *tpx) +struct type *RemoveEqual(struct type *tpx) { if (tpx) while (tpx->tp_fund == T_EQUAL) tpx = tpx->tp_next; @@ -695,8 +695,8 @@ int type_or_forward(struct type *tp) /* POINTER TO IDENTIFIER construction. The IDENTIFIER resides in "dot". This routine handles the different cases. */ - register struct node *nd; - register struct def *df, *df1; + struct node *nd; + struct def *df, *df1; if ((df1 = lookup(dot.TOK_IDF, CurrentScope, D_IMPORTED, D_USED))) { /* Either a Module or a Type, but in both cases defined @@ -757,7 +757,7 @@ int gcd(int m, int n) { /* Greatest Common Divisor */ - register int r; + int r; while (n) { r = m % n; @@ -774,7 +774,7 @@ int lcm(int m, int n) return m * (n / gcd(m, n)); } -struct type *intorcard(register struct type *left, register struct type *right) +struct type *intorcard(struct type *left, struct type *right) { if (left->tp_fund == T_INTORCARD) { struct type *tmp = left; @@ -790,7 +790,7 @@ struct type *intorcard(register struct type *left, register struct type *right) } #ifdef DEBUG -void DumpType(register struct type *tp) +void DumpType(struct type *tp) { if (!tp) return; @@ -826,7 +826,7 @@ void DumpType(register struct type *tp) break; case T_PROCEDURE: { - register struct paramlist *par = ParamList(tp); + struct paramlist *par = ParamList(tp); print("PROCEDURE"); if (par) { diff --git a/lang/m2/comp/type.h b/lang/m2/comp/type.h index 72f2a4d707..0b482c8ffb 100644 --- a/lang/m2/comp/type.h +++ b/lang/m2/comp/type.h @@ -256,35 +256,35 @@ arith align(arith pos, int al); alignment "algn" and "size" bytes. */ struct type *standard_type(int fund, int algn, arith size); struct type *enum_type(struct node *EnumList); -struct type *construct_type(int fund, register struct type *tp); +struct type *construct_type(int fund, struct type *tp); struct type *qualified_type(struct node **pnd); /* Check that the value "i" fits in the subrange or enumeration type "tp". Return 1 if so, 0 otherwise */ -int in_range(arith i, register struct type *tp); +int in_range(arith i, struct type *tp); /* Construct a subrange type from the constant expressions indicated by "lb" and "ub", but first perform some checks. "base" is either a user-specified base-type, or NULL. */ struct type *subr_type(struct node *lb, struct node *ub, struct type *base); struct type *proc_type(struct type *result_type, struct paramlist *parameters, arith n_bytes_params); -void genrck(register struct type *tp); +void genrck(struct type *tp); /* Get the bounds of a bounded type. */ -void getbounds(register struct type *tp, arith *plo, arith *phi); +void getbounds(struct type *tp, arith *plo, arith *phi); /* Construct a set type with base type "tp", but first * perform some checks */ -struct type *set_type(register struct type *tp); -void ArrayElSize(register struct type *tp); -void ArraySizes(register struct type *tp); -void FreeType(register struct type *tp); -void DeclareType(struct node *nd, register struct def *df, register struct type *tp); -void SolveForwardTypeRefs(register struct def *df); -void ForceForwardTypeDef(register struct def *df); -struct type *RemoveEqual(register struct type *tpx); +struct type *set_type(struct type *tp); +void ArrayElSize(struct type *tp); +void ArraySizes(struct type *tp); +void FreeType(struct type *tp); +void DeclareType(struct node *nd, struct def *df, struct type *tp); +void SolveForwardTypeRefs(struct def *df); +void ForceForwardTypeDef(struct def *df); +struct type *RemoveEqual(struct type *tpx); int type_or_forward(struct type *tp); -struct type *intorcard(register struct type *left, register struct type *right); +struct type *intorcard(struct type *left, struct type *right); #ifdef DEBUG -void DumpType(register struct type *tp); +void DumpType(struct type *tp); #endif int fit(arith sz, int nbytes); /* Greatest common divisotr. */ diff --git a/lang/m2/comp/typequiv.c b/lang/m2/comp/typequiv.c index 5bcac87686..53b6934c0a 100644 --- a/lang/m2/comp/typequiv.c +++ b/lang/m2/comp/typequiv.c @@ -46,7 +46,7 @@ static int TstTypeEquiv(struct type *tp1, struct type *tp2) (tp2 == error_type); } -static int TstParEquiv(register struct type *tp1, register struct type *tp2) +static int TstParEquiv(struct type *tp1, struct type *tp2) { /* test if two parameter types are equivalent. This routine is used to check if two different procedure declarations @@ -73,7 +73,7 @@ int TstProcEquiv(struct type *tp1, struct type *tp2) may also be used for the testing of assignment compatibility between procedure variables and procedures. */ - register struct paramlist *p1, *p2; + struct paramlist *p1, *p2; /* First check if the result types are equivalent */ @@ -97,7 +97,7 @@ int TstProcEquiv(struct type *tp1, struct type *tp2) return p1 == p2; } -int TstCompat(register struct type *tp1, register struct type *tp2) +int TstCompat(struct type *tp1, struct type *tp2) { /* test if two types are compatible. See section 6.3 of the Modula-2 Report for a definition of "compatible". @@ -134,7 +134,7 @@ int TstCompat(register struct type *tp1, register struct type *tp2) ; } -int TstAssCompat(register struct type *tp1, register struct type *tp2) +int TstAssCompat(struct type *tp1, struct type *tp2) { /* Test if two types are assignment compatible. See Def 9.1. @@ -171,7 +171,7 @@ int TstAssCompat(register struct type *tp1, register struct type *tp2) return 0; } -char *incompat(register struct type *tp1, register struct type *tp2) +char *incompat(struct type *tp1, struct type *tp2) { if (tp1->tp_fund == T_HIDDEN || tp2->tp_fund == T_HIDDEN) { @@ -180,7 +180,7 @@ char *incompat(register struct type *tp1, register struct type *tp2) return "type incompatibility"; } -int TstParCompat(int parno, register struct type *formaltype, int VARflag, struct node **nd, struct def *edf) +int TstParCompat(int parno, struct type *formaltype, int VARflag, struct node **nd, struct def *edf) { /* Check type compatibility for a parameter in a procedure call. Assignment compatibility may do if the parameter is @@ -189,7 +189,7 @@ int TstParCompat(int parno, register struct type *formaltype, int VARflag, struc may do too. Or: a WORD may do. */ - register struct type *actualtype = (*nd)->nd_type; + struct type *actualtype = (*nd)->nd_type; char ebuf[256]; if (edf) { @@ -256,7 +256,7 @@ int TstParCompat(int parno, register struct type *formaltype, int VARflag, struc return 0; } -int CompatCheck(register struct node **nd, struct type *tp, char *message, int (*fc)(struct type*, struct type*)) +int CompatCheck(struct node **nd, struct type *tp, char *message, int (*fc)(struct type*, struct type*)) { if (! (*fc)(tp, (*nd)->nd_type)) { if (message) { diff --git a/lang/m2/comp/typequiv.h b/lang/m2/comp/typequiv.h index ff19854095..02f562ea13 100644 --- a/lang/m2/comp/typequiv.h +++ b/lang/m2/comp/typequiv.h @@ -14,13 +14,13 @@ struct def; struct type; int TstProcEquiv(struct type *tp1, struct type *tp2); -int TstCompat(register struct type *tp1, register struct type *tp2); -int TstAssCompat(register struct type *tp1, register struct type *tp2); -int TstParCompat(int parno, register struct type *formaltype, int VARflag, struct node **nd, struct def *edf); +int TstCompat(struct type *tp1, struct type *tp2); +int TstAssCompat(struct type *tp1, struct type *tp2); +int TstParCompat(int parno, struct type *formaltype, int VARflag, struct node **nd, struct def *edf); int ChkCompat(struct node **nd, struct type *tp, char *message); int ChkAssCompat(struct node **nd, struct type *tp, char *message); -char *incompat(register struct type *tp1, register struct type *tp2); +char *incompat(struct type *tp1, struct type *tp2); #endif /* TYPEQUIV_H_ */ diff --git a/lang/m2/comp/walk.c b/lang/m2/comp/walk.c index 2e7562e1bc..3befa90bb5 100644 --- a/lang/m2/comp/walk.c +++ b/lang/m2/comp/walk.c @@ -71,11 +71,11 @@ static int oldlineno; #define EXIT_FLAG 2 /* Forward declarations. */ -static void WalkDef(register struct def*); -static void MkCalls(register struct def*); -static void UseWarnings(register struct def*); -static void RegisterMessage(register struct def*); -static void WalkDefList(register struct def*, void (*proc)(struct def*)); +static void WalkDef(struct def*); +static void MkCalls(struct def*); +static void UseWarnings(struct def*); +static void RegisterMessage(struct def*); +static void WalkDefList(struct def*, void (*proc)(struct def*)); #ifdef DBSYMTAB static void stabdef(struct def*); #endif @@ -127,7 +127,7 @@ void def_ilb(label l) oldlineno = 0; } -void DoLineno(register struct node* nd) +void DoLineno(struct node* nd) { if ((!options['L'] #ifdef DBSYMTAB @@ -173,9 +173,9 @@ void DoFilename(int needed) } } -void WalkModule(register struct def* module) +void WalkModule(struct def* module) { - register struct scope* sc; + struct scope* sc; struct scopelist* savevis = CurrVis; CurrVis = module->mod_vis; @@ -216,7 +216,7 @@ void WalkModule(register struct def* module) Call initialization routines of imported modules. Also prevent recursive calls of this one. */ - register struct node* nd = Modules; + struct node* nd = Modules; if (state == IMPLEMENTATION) { @@ -273,13 +273,13 @@ void WalkModule(register struct def* module) WalkDefList(sc->sc_def, UseWarnings); } -void WalkProcedure(register struct def* procedure) +void WalkProcedure(struct def* procedure) { struct scopelist* savevis = CurrVis; - register struct type* tp; - register struct paramlist* param; - register struct scope* procscope = procedure->prc_vis->sc_scope; + struct type* tp; + struct paramlist* param; + struct scope* procscope = procedure->prc_vis->sc_scope; label too_big = 0; /* returnsize larger than returnarea */ arith StackAdjustment = 0; /* space for conformant arrays */ arith retsav = 0; /* temporary space for return value */ @@ -562,7 +562,7 @@ void WalkProcedure(register struct def* procedure) } /* Walk through a list of definitions */ -static void WalkDef(register struct def* df) +static void WalkDef(struct def* df) { @@ -590,7 +590,7 @@ static void WalkDef(register struct def* df) } /* Generate calls to initialization routines of modules */ -static void MkCalls(register struct def* df) +static void MkCalls(struct def* df) { @@ -601,7 +601,7 @@ static void MkCalls(register struct def* df) } } -int WalkLink(register struct node* nd, label exit_label, int end_reached) +int WalkLink(struct node* nd, label exit_label, int end_reached) { while (nd && nd->nd_class == Link) @@ -613,19 +613,19 @@ int WalkLink(register struct node* nd, label exit_label, int end_reached) return WalkNode(nd, exit_label, end_reached); } -static void ForLoopVarExpr(register struct node* nd) +static void ForLoopVarExpr(struct node* nd) { - register struct type* tp = nd->nd_type; + struct type* tp = nd->nd_type; CodePExpr(nd); CodeCoercion(tp, BaseType(tp)); } -int WalkStat(register struct node* nd, label exit_label, int end_reached) +int WalkStat(struct node* nd, label exit_label, int end_reached) { - register struct node* left = nd->nd_LEFT; - register struct node* right = nd->nd_RIGHT; + struct node* left = nd->nd_LEFT; + struct node* right = nd->nd_RIGHT; assert(nd->nd_class == Stat); @@ -936,7 +936,7 @@ int (*WalkTable[])(struct node*, label, int) = { extern struct desig null_desig; -void ExpectBool(register struct node** pnd, label true_label, label false_label) +void ExpectBool(struct node** pnd, label true_label, label false_label) { struct desig ds; @@ -966,8 +966,8 @@ int WalkDesignator(struct node** pnd, struct desig* ds, int flags) int DoForInit(struct node* nd) { - register struct node* right = nd->nd_RIGHT; - register struct def* df; + struct node* right = nd->nd_RIGHT; + struct def* df; struct type* base_tp; struct type *tpl, *tpr; int r; @@ -994,7 +994,7 @@ int DoForInit(struct node* nd) if (df->df_scope != CurrentScope) { - register struct scopelist* sc = CurrVis; + struct scopelist* sc = CurrVis; for (;;) { @@ -1042,7 +1042,7 @@ int DoForInit(struct node* nd) } -void DoAssign(register struct node* nd) +void DoAssign(struct node* nd) { /* May we do it in this order (expression first) ??? The reference manual sais nothing about it, but the book does: @@ -1050,7 +1050,7 @@ void DoAssign(register struct node* nd) DAMN THE BOOK! */ struct desig dsr; - register struct type* tp; + struct type* tp; if (!(ChkExpression(&(nd->nd_RIGHT)) & ChkVariable(&(nd->nd_LEFT), D_DEFINED))) return; @@ -1078,9 +1078,9 @@ void DoAssign(register struct node* nd) CodeMove(&dsr, nd->nd_LEFT, tp); } -static void RegisterMessage(register struct def* df) +static void RegisterMessage(struct def* df) { - register struct type* tp; + struct type* tp; if (df->df_kind == D_VARIABLE) { @@ -1123,7 +1123,7 @@ static void df_warning(struct node* nd, struct def* df, char* warning) } } -static void UseWarnings(register struct def* df) +static void UseWarnings(struct def* df) { struct node* nd = df->df_scope->sc_end; @@ -1134,7 +1134,7 @@ static void UseWarnings(register struct def* df) if (df->df_kind & D_IMPORTED) { - register struct def* df1 = df->imp_def; + struct def* df1 = df->imp_def; df1->df_flags |= df->df_flags & (D_USED | D_DEFINED); if (df->df_kind == D_INUSE) @@ -1170,7 +1170,7 @@ static void UseWarnings(register struct def* df) } } -static void WalkDefList(register struct def* df, void (*proc)(struct def*)) +static void WalkDefList(struct def* df, void (*proc)(struct def*)) { for (; df; df = df->df_nextinscope) { diff --git a/lang/m2/comp/walk.h b/lang/m2/comp/walk.h index cabdbc7ac1..857eecb7c5 100644 --- a/lang/m2/comp/walk.h +++ b/lang/m2/comp/walk.h @@ -36,7 +36,7 @@ extern label data_label; int LblWalkNode(label lbl, struct node *nd, int exit, int reach); void def_ilb(label l); /* Generate line information as necessary for "nd". */ -void DoLineno(register struct node* nd); +void DoLineno(struct node* nd); /* Generate filename information, when needed. This routine is called at the generation of a procedure entry, and after generating a call to @@ -49,26 +49,26 @@ void DoFilename(int needed); Also generate code for its body. This code is collected in an initialization routine. */ -void WalkModule(register struct def* module); +void WalkModule(struct def* module); /* Walk through the definition of a procedure and all its local definitions, checking and generating code. */ -void WalkProcedure(register struct def* procedure); +void WalkProcedure(struct def* procedure); /* Walk node "nd", which is a link. "exit_label" is set to a label number when inside a LOOP. "end_reached" maintains info about reachability (REACH_FLAG), and whether an EXIT statement was seen (EXIT_FLAG). */ -int WalkLink(register struct node* nd, label exit_label, int end_reached); +int WalkLink(struct node* nd, label exit_label, int end_reached); /* Walk through a statement node "nd", generating code for it. */ -int WalkStat(register struct node* nd, label exit_label, int end_reached); +int WalkStat(struct node* nd, label exit_label, int end_reached); /* Generate code to evaluate a boolean expression "pnd" */ -void ExpectBool(register struct node** pnd, label true_label, label false_label); +void ExpectBool(struct node** pnd, label true_label, label false_label); /* Check designator and generate code for it */ int WalkDesignator(struct node** pnd, struct desig* ds, int flags); -void DoAssign(register struct node* nd); +void DoAssign(struct node* nd); int DoForInit(struct node* nd); diff --git a/lang/m2/include/libm2.h b/lang/m2/include/libm2.h index 4ad303b662..059c4e1d3f 100644 --- a/lang/m2/include/libm2.h +++ b/lang/m2/include/libm2.h @@ -64,7 +64,7 @@ extern long rmil(long j, long i); extern size_t new_stackptr(struct stack_descr* pdscr, int a); extern unsigned int topsize(void* brkpos); extern void SIG(void (*)(int)); -extern void StringAssign(int dstsiz, int srcsiz, register char* dstaddr, register char* srcaddr); +extern void StringAssign(int dstsiz, int srcsiz, char* dstaddr, char* srcaddr); extern void TRP(int trapno); extern void _Arguments_(void); extern void _SYSTEM__NEWPROCESS(int (*p)(void), struct proc* a, unsigned n, struct proc** p1); @@ -78,14 +78,14 @@ extern void copy_array(char* pp, int a); extern void halt(void); extern void init(void); extern void killbss(void); -extern void load(size_t siz, register char* addr, int p); +extern void load(size_t siz, char* addr, int p); extern void muluchk(unsigned a, unsigned b); extern void rcka(struct array_descr* descr, int indx); extern void rcki(struct int_range_descr* descr, int val); extern void rckil(struct long_range_descr* descr, long val); extern void rcku(struct uint_range_descr* descr, unsigned val); extern void rckul(struct ulong_range_descr* descr, unsigned long val); -extern void store(size_t siz, register char* addr, int p); +extern void store(size_t siz, char* addr, int p); extern void subuchk(unsigned a, unsigned b); extern void topload(struct proc* proc); extern void unstackprio(unsigned n); diff --git a/lang/m2/libm2/Arguments.c b/lang/m2/libm2/Arguments.c index b302b0048f..f8db07280a 100644 --- a/lang/m2/libm2/Arguments.c +++ b/lang/m2/libm2/Arguments.c @@ -26,7 +26,7 @@ static char* findname(char* s1, char* s2) static unsigned int scopy(char* src, char* dst, unsigned int max) { - register unsigned int i = 0; + unsigned int i = 0; while (*src && i <= max) { @@ -59,8 +59,8 @@ unsigned int _Arguments__Argv(int n, char* argument, int l, unsigned int u, int unsigned int _Arguments__GetEnv( char* name, int nn, unsigned int nu, int ns, char* value, int l, unsigned int u, int s) { - register char** p = environ; - register char* v = 0; + char** p = environ; + char* v = 0; while (*p && !(v = findname(name, *p++))) { diff --git a/lang/m2/libm2/cap.c b/lang/m2/libm2/cap.c index 32da6b6e83..abdb0fc447 100644 --- a/lang/m2/libm2/cap.c +++ b/lang/m2/libm2/cap.c @@ -12,7 +12,7 @@ void cap(unsigned int u) { - register unsigned* p = &u; + unsigned* p = &u; if (*p >= 'a' && *p <= 'z') *p += 'A' - 'a'; diff --git a/lang/m2/libm2/catch.c b/lang/m2/libm2/catch.c index 7a5511c50b..eba12cc2f0 100644 --- a/lang/m2/libm2/catch.c +++ b/lang/m2/libm2/catch.c @@ -54,10 +54,10 @@ static struct errm void catch (int trapno) { - register struct errm* ep = &errors[0]; + struct errm* ep = &errors[0]; char* errmessage; char buf[20]; - register char *p, *s; + char *p, *s; while (ep->errno != trapno && ep->errmes != 0) ep++; diff --git a/lang/m2/libm2/init.c b/lang/m2/libm2/init.c index 80ee9a617f..a558fcf10f 100644 --- a/lang/m2/libm2/init.c +++ b/lang/m2/libm2/init.c @@ -86,7 +86,7 @@ static int blablabla; /* We cannot use end, because then also void killbss(void) { extern char* bkillbss; - register char* p = (char*)&bkillbss; + char* p = (char*)&bkillbss; while (p < (char*)&blablabla) *p++ = 0x66; diff --git a/lang/m2/libm2/load.c b/lang/m2/libm2/load.c index 4739fd66f3..3d068c8d93 100644 --- a/lang/m2/libm2/load.c +++ b/lang/m2/libm2/load.c @@ -23,7 +23,7 @@ void load(size_t siz, char* addr, int p) handled by the LOI instruction ends up at the same place, where it would, were the LOI instruction used. */ - register char* q = (char*)&p; + char* q = (char*)&p; char t[4]; if (siz < EM_WSIZE && EM_WSIZE % siz == 0) diff --git a/lang/m2/libm2/store.c b/lang/m2/libm2/store.c index c2595743ed..6659e9bd3b 100644 --- a/lang/m2/libm2/store.c +++ b/lang/m2/libm2/store.c @@ -23,7 +23,7 @@ void store(size_t siz, char* addr, int p) handled by the LOI instruction is handled as if it was loaded with the LOI instruction. */ - register char* q = (char*)&p; + char* q = (char*)&p; char t[4]; if (siz < EM_WSIZE && EM_WSIZE % siz == 0) diff --git a/lang/m2/m2mm/LLlex.c b/lang/m2/m2mm/LLlex.c index 6480078ba0..3d54d3a033 100644 --- a/lang/m2/m2mm/LLlex.c +++ b/lang/m2/m2mm/LLlex.c @@ -31,8 +31,8 @@ SkipComment() /* Skip Modula-2 comments (* ... *). Note that comments may be nested (par. 3.5). */ - register int ch; - register int CommentLevel = 0; + int ch; + int CommentLevel = 0; LoadChar(ch); if (ch == '$') { @@ -81,7 +81,7 @@ GetString(upto) { /* Read a Modula-2 string, delimited by the character "upto". */ - register int ch; + int ch; while (LoadChar(ch), ch != upto) { if (class(ch) == STNL) { @@ -101,7 +101,7 @@ static char *s_error = "illegal line directive"; static int getch() { - register int ch; + int ch; for (;;) { LoadChar(ch); @@ -116,10 +116,10 @@ getch() CheckForLineDirective() { - register int ch = getch(); - register int i = 0; + int ch = getch(); + int i = 0; char buf[IDFSIZE + 2]; - register char *c = buf; + char *c = buf; if (ch != '#') { @@ -180,8 +180,8 @@ LLlex() /* LLlex() is the Lexical Analyzer. The putting aside of tokens is taken into account. */ - register struct token *tk = ˙ - register int ch, nch; + struct token *tk = ˙ + int ch, nch; if (ASIDE) { /* a token is put aside */ *tk = aside; @@ -262,8 +262,8 @@ LLlex() case STIDF: { - register char *tag = &idfbuf[0]; - register struct idf *id; + char *tag = &idfbuf[0]; + struct idf *id; do { if (tag - idfbuf < idfsize) *tag++ = ch; @@ -289,7 +289,7 @@ LLlex() complex finite automaton. */ enum statetp {Oct,OptHex,Hex,Dec,OctEndOrHex,End,OptReal,Real}; - register enum statetp state; + enum statetp state; state = is_oct(ch) ? Oct : Dec; LoadChar(ch); for (;;) { diff --git a/lang/m2/m2mm/LLmessage.c b/lang/m2/m2mm/LLmessage.c index e58ddb84cd..71fc3068a8 100644 --- a/lang/m2/m2mm/LLmessage.c +++ b/lang/m2/m2mm/LLmessage.c @@ -25,7 +25,7 @@ extern char *symbol2str(); extern struct idf *gen_anon_idf(); LLmessage(tk) - register int tk; + int tk; { if (tk > 0) { /* if (tk > 0), it represents the token to be inserted. diff --git a/lang/m2/m2mm/error.c b/lang/m2/m2mm/error.c index 6617654654..ec10224dee 100644 --- a/lang/m2/m2mm/error.c +++ b/lang/m2/m2mm/error.c @@ -190,7 +190,7 @@ _error(class, fmt, argv) for a given line to MAXERR_LINE. */ unsigned int ln = 0; - register char *remark = 0; + char *remark = 0; /* Since name and number are gathered from different places depending on the class, we first collect the relevant diff --git a/lang/m2/m2mm/lib.c b/lang/m2/m2mm/lib.c index 2476683ed4..1f7a648042 100644 --- a/lang/m2/m2mm/lib.c +++ b/lang/m2/m2mm/lib.c @@ -32,7 +32,7 @@ is_library_dir(d) "system" definition modules. Return 1 if it is, 0 otherwise. */ - register struct liblist *p = lblist; + struct liblist *p = lblist; while (p) { if (! strcmp(DEFPATH[p->libno], d)) return 1; @@ -56,7 +56,7 @@ init_lib() set_libdir(n) { - register struct liblist *p = + struct liblist *p = (struct liblist *) Malloc(sizeof(struct liblist)); p->libnext = lblist; diff --git a/lang/m2/m2mm/main.c b/lang/m2/m2mm/main.c index 2a8269736c..28e9a3c6b5 100644 --- a/lang/m2/m2mm/main.c +++ b/lang/m2/m2mm/main.c @@ -44,9 +44,9 @@ basename(s) char * getwdir(fn) - register char *fn; + char *fn; { - register char *p; + char *p; p = strrchr(fn, '/'); while (p && *(p + 1) == '\0') { /* remove trailing /'s */ @@ -55,7 +55,7 @@ getwdir(fn) } if (p) { - register char **d = DEFPATH; + char **d = DEFPATH; *p = '\0'; while (*d && strcmp(*d, fn) != 0) d++; @@ -82,7 +82,7 @@ char *suff = "o"; char *llibs = 0; main(argc, argv) - register char **argv; + char **argv; { extern struct tokenname tkidf[]; extern char *getwdir(); @@ -122,7 +122,7 @@ struct file_list * new_file_list() { static struct file_list *p; - register struct file_list *f; + struct file_list *f; static int cnt; if (--cnt < 0) { @@ -142,7 +142,7 @@ Add(parglist, f, d, copy) char *f, *d; struct file_list **parglist; { - register struct file_list *a, *b = 0; + struct file_list *a, *b = 0; if (f == 0) return; @@ -166,7 +166,7 @@ Add(parglist, f, d, copy) int openfile(a) - register struct file_list *a; + struct file_list *a; { char *fn; @@ -183,10 +183,10 @@ openfile(a) ProcessArgs() { - register struct file_list *a; + struct file_list *a; f_walk(arglist, a) { - register char *p = strrchr(f_filename(a), '.'); + char *p = strrchr(f_filename(a), '.'); CurrentArg = a; DEFPATH[0] = f_dir(a); @@ -235,7 +235,7 @@ AddToList(name, ext) find_dependencies() { - register struct file_list *arg; + struct file_list *arg; print("\nall:\t"); f_walk(arglist, arg) { @@ -243,7 +243,7 @@ find_dependencies() char *dotspot = strrchr(fn, '.'); if (dotspot && strcmp(dotspot, ".mod") == 0) { - register struct idf *id = f_idf(arg); + struct idf *id = f_idf(arg); if (! f_notfound(arg) && id) { if (id->id_type == PROGRAM) { @@ -262,7 +262,7 @@ find_dependencies() char *dotspot = strrchr(fn, '.'); if (dotspot && strcmp(dotspot, ".mod") == 0) { - register struct idf *id = f_idf(arg); + struct idf *id = f_idf(arg); if (! f_notfound(arg) && id) { if (id->id_type == PROGRAM) { @@ -277,18 +277,18 @@ find_dependencies() } file_dep(id) - register struct idf *id; + struct idf *id; { - register struct lnk *m; + struct lnk *m; if (id->id_ddependson || id->id_mdependson) return; if (id->id_def) Add(&(id->id_mdependson), id->id_def, id->id_dir, 0); for (m = id->id_defimports; m; m = m->lnk_next) { - register struct idf *iid = m->lnk_imp; + struct idf *iid = m->lnk_imp; Add(&(id->id_mdependson), iid->id_def, iid->id_dir, 0); if (Add(&(id->id_ddependson), iid->id_def, iid->id_dir, 0)) { - register struct file_list *p; + struct file_list *p; file_dep(iid); f_walk(iid->id_ddependson, p) { @@ -300,10 +300,10 @@ file_dep(id) } } for (m = id->id_modimports; m; m = m->lnk_next) { - register struct idf *iid = m->lnk_imp; + struct idf *iid = m->lnk_imp; if (Add(&(id->id_mdependson), iid->id_def, iid->id_dir, 0)) { - register struct file_list *p; + struct file_list *p; file_dep(iid); f_walk(iid->id_ddependson, p) { @@ -316,7 +316,7 @@ file_dep(id) char * object(arg) - register struct file_list *arg; + struct file_list *arg; { static char buf[512]; char *dotp = strrchr(f_filename(arg), '.'); @@ -336,7 +336,7 @@ object(arg) } pr_arg(a) - register struct file_list *a; + struct file_list *a; { char *f = f_filename(a); char *d = f_dir(a); @@ -349,17 +349,17 @@ pr_arg(a) print_dep() { - register struct file_list *arg; + struct file_list *arg; f_walk(arglist, arg) { char *dotspot = strrchr(f_filename(arg), '.'); if (dotspot && strcmp(dotspot, ".mod") == 0) { - register struct idf *id = f_idf(arg); + struct idf *id = f_idf(arg); if (! f_notfound(arg) && id) { char *obj = object(arg); - register struct file_list *a; + struct file_list *a; print("%s: \\\n\t", obj); pr_arg(arg); @@ -378,11 +378,11 @@ print_dep() } prog_dep(id, a) - register struct idf *id; + struct idf *id; struct file_list *a; { - register struct lnk *m; - register struct file_list *p; + struct lnk *m; + struct file_list *p; id->id_mdependson = 0; id->id_def = 0; @@ -394,7 +394,7 @@ prog_dep(id, a) Add(&(id->id_mdependson), id->id_text, id->id_dir, 0); } for (m = id->id_modimports; m; m = m->lnk_next) { - register struct idf *iid = m->lnk_imp; + struct idf *iid = m->lnk_imp; if (Add(&(id->id_mdependson), iid->id_text, iid->id_dir, 0)) { if (iid->id_def) prog_dep(iid); @@ -409,7 +409,7 @@ prog_dep(id, a) module_in_arglist(n) char *n; { - register struct file_list *a; + struct file_list *a; f_walk(arglist, a) { char *dotp = strrchr(f_filename(a), '.'); @@ -427,10 +427,10 @@ module_in_arglist(n) } pr_prog_dep(id, a) - register struct idf *id; + struct idf *id; struct file_list *a; { - register struct file_list *p; + struct file_list *p; print("\nOBS_%s =", id->id_text); f_walk(id->id_mdependson, p) { @@ -455,13 +455,13 @@ pr_prog_dep(id, a) programs() { - register struct file_list *a; + struct file_list *a; f_walk(arglist, a) { char *dotspot = strrchr(f_filename(a), '.'); if (dotspot && strcmp(dotspot, ".mod") == 0) { - register struct idf *id = f_idf(a); + struct idf *id = f_idf(a); if (! f_notfound(a) && id && id->id_type == PROGRAM) { prog_dep(id, a); diff --git a/lang/m2/m2mm/options.c b/lang/m2/m2mm/options.c index d690b75fad..f88533f390 100644 --- a/lang/m2/m2mm/options.c +++ b/lang/m2/m2mm/options.c @@ -17,7 +17,7 @@ static int ndirs = 1; DoOption(text) - register char *text; + char *text; { extern char *mflags; extern char *suff; @@ -71,8 +71,8 @@ DoOption(text) AddInclDir(text) char *text; { - register int i; - register char *new = text; + int i; + char *new = text; if (! *text) { DEFPATH[ndirs] = 0; diff --git a/lang/m2/m2mm/program.g b/lang/m2/m2mm/program.g index 930e2cd3b6..bf2b5b9a80 100644 --- a/lang/m2/m2mm/program.g +++ b/lang/m2/m2mm/program.g @@ -76,7 +76,7 @@ export : IdentList ';' ; -import(register struct lnk **p;) +import(struct lnk **p;) { register struct idf *fromid = 0; struct idf *id; diff --git a/lang/m2/m2mm/tokenname.c b/lang/m2/m2mm/tokenname.c index 508f3b474d..135602855a 100644 --- a/lang/m2/m2mm/tokenname.c +++ b/lang/m2/m2mm/tokenname.c @@ -97,12 +97,12 @@ struct tokenname tkstandard[] = { /* standard identifiers */ /* Some routines to handle tokennames */ reserve(resv) - register struct tokenname *resv; + struct tokenname *resv; { /* The names of the tokens described in resv are entered as reserved words. */ - register struct idf *p; + struct idf *p; while (resv->tn_symbol) { p = str2idf(resv->tn_name, 0); diff --git a/lang/occam/comp/code.c b/lang/occam/comp/code.c index ec4a8e8a7a..734a8e25a8 100644 --- a/lang/occam/comp/code.c +++ b/lang/occam/comp/code.c @@ -18,7 +18,7 @@ enum addr_val { address, value }; void code_val(e) register struct expr *e; /* Compile e for its value, which is put on the stack. */ { - register struct expr *left, *right; + struct expr *left, *right; if (err) return; @@ -109,7 +109,7 @@ void code_val(e) register struct expr *e; } break; case E_VAR: { - register struct symbol *var=e->u.var; + struct symbol *var=e->u.var; if (var->s_type&T_BUILTIN) Loe(var->s_info.vc.st.builtin, var->s_info.vc.offset); @@ -145,9 +145,9 @@ static void subscript(e, av) register struct expr *e; enum addr_val av; * the address of e->left[e->right->left FOR e->right->right]. */ { - register char *des; - register struct expr *left; - register struct expr *index; + char *des; + struct expr *left; + struct expr *index; code_addr(left=e->u.node.left); @@ -160,7 +160,7 @@ static void subscript(e, av) register struct expr *e; enum addr_val av; else des= e->type&T_BYTE ? "maxbdes" : "maxwdes"; } else { - register lsiz=left->arr_siz; + lsiz=left->arr_siz; if (left->type&T_BYTE && !(e->type&T_BYTE)) lsiz/=vz; @@ -189,7 +189,7 @@ static void subscript(e, av) register struct expr *e; enum addr_val av; } } if (constant(index)) { - register offset=index->u.cst; + offset=index->u.cst; if ((left->type&T_TYPE)==T_CHAN) offset*=(wz+vz); @@ -231,7 +231,7 @@ void code_addr(e) register struct expr *e; subscript(e, address); break; case E_VAR: { /* variable or channel */ - register struct symbol *var=e->u.var; + struct symbol *var=e->u.var; if (var->s_type&T_BUILTIN) lae(var->s_info.vc.st.builtin, var->s_info.vc.offset); @@ -262,9 +262,9 @@ void code_addr(e) register struct expr *e; } void code_bool(e, pos, T, F) - register struct expr *e; - register pos; - register int *T, *F; + struct expr *e; + pos; + int *T, *F; /* if e = pos then fall through or jump to T; else @@ -272,13 +272,13 @@ void code_bool(e, pos, T, F) fi */ { - register Default=0; + Default=0; if (err) return; if (e->kind==E_NODE) { - register struct expr *left=e->u.node.left; - register struct expr *right=e->u.node.right; + struct expr *left=e->u.node.left; + struct expr *right=e->u.node.right; switch(e->u.node.op) { case '<': @@ -331,11 +331,11 @@ void code_bool(e, pos, T, F) void code_assignment(e) register struct expr *e; /* e->left := e->right */ { - register struct expr *left=e->u.node.left; - register struct expr *right=e->u.node.right; + struct expr *left=e->u.node.left; + struct expr *right=e->u.node.right; if (left->type&T_ARR) { - register siz=left->arr_siz; + siz=left->arr_siz; code_addr(right); code_addr(left); @@ -393,7 +393,7 @@ void code_any(e, NO) register struct expr *e; int *NO; */ { int YES=0; - register struct expr_list *elp; + struct expr_list *elp; if (err) return; @@ -423,7 +423,7 @@ void code_void(e) register struct expr *e; code_assignment(e); break; case E_IO: { - register struct expr_list *elp; + struct expr_list *elp; code_addr(e->u.io.chan); @@ -439,10 +439,10 @@ void code_void(e) register struct expr *e; } break; case E_CALL: { - register size=0; - register struct expr_list *elp=e->u.call.c_args; - register struct symbol *proc=e->u.call.c_proc->u.var; - register struct par_list *pars=proc->s_info.proc.pars; + size=0; + struct expr_list *elp=e->u.call.c_args; + struct symbol *proc=e->u.call.c_proc->u.var; + struct par_list *pars=proc->s_info.proc.pars; while (elp!=nil) { if (pars->pr_type==T_VALUE) { @@ -506,8 +506,8 @@ void epilogue(proc) register struct symbol *proc; void rep_init(v, e1, e2, r_info) struct symbol *v; - register struct expr *e1, *e2; - register struct replicator *r_info; + struct expr *e1, *e2; + struct replicator *r_info; /* Compile v=[e1 FOR e2]. Info tells rep_test what decisions rep_init makes. */ { if (err) return; @@ -534,9 +534,9 @@ void rep_init(v, e1, e2, r_info) } void rep_test(v, e1, e2, r_info) - register struct symbol *v; - register struct expr *e1, *e2; - register struct replicator *r_info; + struct symbol *v; + struct expr *e1, *e2; + struct replicator *r_info; { if (err) return; diff --git a/lang/occam/comp/em.c b/lang/occam/comp/em.c index 605817371e..426d0734ad 100644 --- a/lang/occam/comp/em.c +++ b/lang/occam/comp/em.c @@ -82,7 +82,7 @@ void branch(L) int *L; char *proc_label(L, name) register L; register char *name; { static char *lab=nil; - register char *n; + char *n; if (lab!=nil) free(lab); @@ -203,7 +203,7 @@ static int operators[]= { '<', '>', '=', GE, LE, NE }; void bxx(pos, op, L) register pos, op, L; { - register i; + i; if (op==AFTER) { C_sbi((arith) vz); @@ -409,8 +409,8 @@ int set_file(f) char *f; { char *strcpy(); static struct ftree *ftop=nil; - register struct ftree *pf, **apf= &ftop; - register cmp; + struct ftree *pf, **apf= &ftop; + cmp; while ((pf= *apf)!=nil && (cmp=strcmp(f, pf->file))!=0) apf= cmp<0 ? &pf->left : &pf->right; diff --git a/lang/occam/comp/expr.c b/lang/occam/comp/expr.c index 36eef9c0e2..e19edf28e8 100644 --- a/lang/occam/comp/expr.c +++ b/lang/occam/comp/expr.c @@ -19,14 +19,14 @@ char *Malloc(); struct expr *new_node(op, left, right, byte) int op; - register struct expr *left, *right; + struct expr *left, *right; int byte; /* Makes a new node with given operator, left and right operand. * Constant folding is done if possible. */ { if (op!=FOR && constant(left) && (right==nil || constant(right))) { - register long lc, rc; + long lc, rc; lc=left->u.cst; if (right) rc=right->u.cst; else rc = 0; @@ -65,7 +65,7 @@ struct expr *new_node(op, left, right, byte) left->u.cst=lc; return left; } else { - register struct expr *pe; + struct expr *pe; int type=0, arr_siz=1; switch (op) { @@ -105,12 +105,12 @@ struct expr *new_node(op, left, right, byte) } struct expr *new_var(var) - register struct symbol *var; + struct symbol *var; /* Given a variable an expression node is constructed. Note the changes in * type! T_VAR becomes T_VALUE with flag T_LVALUE. */ { - register struct expr *pe; + struct expr *pe; pe= (struct expr *) Malloc(sizeof *pe); @@ -133,7 +133,7 @@ struct expr *new_const(cst) long cst; /* Make a constant, which is a VALUE, of course. */ { - register struct expr *pe; + struct expr *pe; pe= (struct expr *) Malloc(sizeof *pe); @@ -145,14 +145,14 @@ struct expr *new_const(cst) } struct expr *new_table(kind, tab) - register kind; - register struct table *tab; + kind; + struct table *tab; /* One table is being made, it is no doubt a VALUEd ARRay, but maybe even a * BYTE array. A label is reserved for it and the individual elements are * rommified. */ { - register struct expr *pe; + struct expr *pe; pe= (struct expr *) Malloc(sizeof *pe); @@ -163,7 +163,7 @@ struct expr *new_table(kind, tab) pe->arr_siz=0; while (tab!=nil) { - register struct table *junk=tab; + struct table *junk=tab; rom(kind==E_BTAB ? 1 : vz, tab->val); @@ -180,7 +180,7 @@ struct expr *copy_const(e) struct expr *e; * useful with). */ { - register struct expr *c; + struct expr *c; c= (struct expr *) Malloc(sizeof *c); @@ -191,7 +191,7 @@ struct expr *copy_const(e) struct expr *e; struct expr *new_now() /* Now is the time to make a VALUE cell for the clock. */ { - register struct expr *pe; + struct expr *pe; pe= (struct expr *) Malloc(sizeof *pe); @@ -203,11 +203,11 @@ struct expr *new_now() struct expr *new_io(out, chan, args) int out; - register struct expr *chan; + struct expr *chan; struct expr_list *args; /* Either c ? v0; v1; v2; ... (out=0) or c ! e0; e1; e2; ... (out=1). */ { - register struct expr *pe; + struct expr *pe; if ( ( (chan->type&T_TYPE) != T_CHAN || (chan->type&T_ARR) ) && ! (chan->type&T_NOTDECL) @@ -234,7 +234,7 @@ struct expr *new_call(proc, args) * compiler generated noise. */ { - register struct expr *pe; + struct expr *pe; pe= (struct expr *) Malloc(sizeof *pe); @@ -253,7 +253,7 @@ struct expr *new_call(proc, args) void table_add(aapt, val) register struct table ***aapt; long val; /* Adds a value to a table using a hook to a hook. */ { - register struct table *pt; + struct table *pt; pt= (struct table *) Malloc(sizeof *pt); @@ -265,11 +265,11 @@ void table_add(aapt, val) register struct table ***aapt; long val; } void expr_list_add(aaelp, arg) - register struct expr_list ***aaelp; + struct expr_list ***aaelp; struct expr *arg; /* Another add, this time for actual arguments and the like. */ { - register struct expr_list *elp; + struct expr_list *elp; elp= (struct expr_list *) Malloc(sizeof *elp); @@ -299,7 +299,7 @@ static void assigned(e) register struct expr *e; if (e->kind==E_VAR || (e->kind==E_NODE && e->u.node.op=='[' && (e=e->u.node.left)->kind==E_VAR) ) { - register struct symbol *var; + struct symbol *var; if ((var=e->u.var)->s_type&T_REP) { warning("replicator index %s may not be assigned", @@ -315,7 +315,7 @@ void used(e) register struct expr *e; if (e->kind==E_VAR || (e->kind==E_NODE && e->u.node.op=='[' && (e=e->u.node.left)->kind==E_VAR) ) { - register struct symbol *var; + struct symbol *var; if ( ! ( (var=e->u.var)->s_type&(T_ASSIGNED|T_BUILTIN)) && (var->s_type&T_TYPE)==T_VAR @@ -342,7 +342,7 @@ static void assignable(l, r) register struct expr *l, *r; report("operands of assignment are not conformable"); else if (l->type&T_ARR && ! ( (l->type|r->type)&T_NOTDECL ) ) { - register lsiz=l->arr_siz, rsiz=r->arr_siz; + lsiz=l->arr_siz, rsiz=r->arr_siz; if (lsiz!=0 && rsiz!=0 && lsiz!=rsiz) report("arrays have incompatible sizes"); @@ -368,12 +368,12 @@ static void outputable(e) struct expr *e; } static void subscriptable(l, r, byte, atype, arr_siz) - register struct expr *l, *r; - register byte; + struct expr *l, *r; + byte; int *atype, *arr_siz; /* Tries to subscript l by r, returning type and array size for slices. */ { - register type= (l->type&T_TYPE)|byte; + type= (l->type&T_TYPE)|byte; if ( !(l->type&(T_ARR|T_NOTDECL) ) ) report("indexing on a non-array"); @@ -399,15 +399,15 @@ static void subscriptable(l, r, byte, atype, arr_siz) void check_param(aform, act, err) struct par_list **aform; - register struct expr *act; + struct expr *act; int *err; /* Test if formal parameter *aform corresponds with actual act. Err returns * error status. The aform hook is set to the next formal after the check. */ { - register struct par_list *form= *aform; - register struct expr *left; - register struct symbol *var; + struct par_list *form= *aform; + struct expr *left; + struct symbol *var; static char NONCORR[]="actual and formal parameter don't correspond"; if (form==nil) { @@ -460,7 +460,7 @@ void destroy(e) register struct expr *e; case E_CALL: destroy(e->kind==E_IO ? e->u.io.chan : e->u.call.c_proc); { - register struct expr_list *elp, *junk; + struct expr_list *elp, *junk; elp= e->kind==E_IO ? e->u.io.args : e->u.call.c_args; diff --git a/lang/occam/comp/keytab.c b/lang/occam/comp/keytab.c index 9d18467553..20ef3e2b08 100644 --- a/lang/occam/comp/keytab.c +++ b/lang/occam/comp/keytab.c @@ -39,11 +39,11 @@ KTAB keytab[] = { */ keyword(str) char *str; { - register int high= NKEYWORDS-1; - register int low= 0; - register int i, cmp; + int high= NKEYWORDS-1; + int low= 0; + int i, cmp; char *lowerupper(); - register char *key; + char *key; if ((key=lowerupper(str))==0) return IDENTIFIER; @@ -60,7 +60,7 @@ keyword(str) char *str; char *lowerupper(str) register char *str; { static char keyword[MAXKEYLEN+1]; - register char *key=keyword; + char *key=keyword; if (islower(*str)) { do { @@ -79,7 +79,7 @@ char *lowerupper(str) register char *str; char *keyname(key) register int key; { - register KTAB *kp; + KTAB *kp; for (kp= keytab; kp< keytab+NKEYWORDS; kp++) if (kp->k_token == key) return kp->k_str; diff --git a/lang/occam/comp/occam.g b/lang/occam/comp/occam.g index 3385cca324..222ea95924 100644 --- a/lang/occam/comp/occam.g +++ b/lang/occam/comp/occam.g @@ -64,7 +64,7 @@ primitive { struct expr *e; } : | SKIP ; -guard(register *F;) { struct expr *e1, *e2; +guard(*F;) { struct expr *e1, *e2; register full_guard=0; int T=0; static char EXPECT_INP[]="input process expected as guard"; @@ -107,7 +107,7 @@ guard(register *F;) { struct expr *e1, *e2; | SKIP ; -guarded_process(register *END;) { struct symbol *v; +guarded_process(*END;) { struct symbol *v; struct expr *e1, *e2; struct replicator to_test; register line, oind; @@ -129,7 +129,7 @@ guarded_process(register *END;) { struct symbol *v; ] ; -conditional(register *END; ) { struct symbol *v; +conditional(*END; ) { struct symbol *v; struct expr *e1, *e2; struct replicator to_test; register line, oind; @@ -158,7 +158,7 @@ conditional(register *END; ) { struct symbol *v; ] ; -replicator(register struct symbol **s; register struct expr **e1; register struct expr **e2; ) +replicator(struct symbol **s; register struct expr **e1; register struct expr **e2; ) { register char *index; }: IDENTIFIER { index=token.t_sval; } '=' '[' val_expr(e1) FOR val_expr(e2) ']' @@ -264,7 +264,7 @@ construct { struct symbol *v; } ; -subscript(register *byte; register struct expr **e; ) +subscript(*byte; register struct expr **e; ) { struct expr *e1; register slice=0, err=0; } : @@ -355,7 +355,7 @@ const_def { register char *name; struct expr *e; }: } ; -form_parm(register struct par_list ***aapars; register *g_type;) +form_parm(struct par_list ***aapars; register *g_type;) { register char *name; register type= *g_type; }: @@ -419,7 +419,7 @@ proc_declaration { struct par_list *pars=nil; } ; -vector_constant(register struct expr **e;) +vector_constant(struct expr **e;) { struct table *pt=nil, **apt= &pt; register Tlen=0; }: @@ -446,7 +446,7 @@ vector_constant(register struct expr **e;) } ; -item(register struct expr **e;) +item(struct expr **e;) { struct expr *e1; register struct symbol *var; struct par_list *pars=nil; @@ -510,7 +510,7 @@ item(register struct expr **e;) ]? ; -statement(register struct expr **e;) +statement(struct expr **e;) { struct expr *e1; struct expr_list *elp=nil, **aelp= &elp; register out; @@ -540,7 +540,7 @@ io_arg(struct expr **e; ) : | ANY { *e=nil; } ; -table(register struct expr **e;) +table(struct expr **e;) { struct table *pt=nil, **apt= &pt; struct expr *e1; register type; @@ -581,7 +581,7 @@ boolean_op: AND | OR shift_op: LS | RS ; -monadic_op(register *op;): +monadic_op(*op;): '-' { *op='~'; } | NOT { *op=NOT; } ; @@ -589,7 +589,7 @@ monadic_op(register *op;): operator: arithmetic_op | comparison_op | logical_op | boolean_op | shift_op ; -element(register struct expr **e;) : +element(struct expr **e;) : %default NUMBER { *e=new_const(token.t_lval); } | statement(e) | TRUE { *e=new_const(-1L); } @@ -601,7 +601,7 @@ element(register struct expr **e;) : } ; -expression(register struct expr **e;) +expression(struct expr **e;) { int op=0; struct expr *e1; }: @@ -616,7 +616,7 @@ expression(register struct expr **e;) { *e=new_node(op, e1, (char *)nil, 0); } ; -val_expr(register struct expr **e;) : +val_expr(struct expr **e;) : expression(e) { used(*e); } ; diff --git a/lang/occam/comp/symtab.c b/lang/occam/comp/symtab.c index c4491b28f9..f9d142e47e 100644 --- a/lang/occam/comp/symtab.c +++ b/lang/occam/comp/symtab.c @@ -20,8 +20,8 @@ static struct symbol **search_sym(tree, name) char *name; /* Returns a hook in the tree to the where the given name is or should be. */ { - register struct symbol **aps=tree, *ps; - register cmp; + struct symbol **aps=tree, *ps; + cmp; while ((ps= *aps)!=nil && (cmp=strcmp(name, ps->s_name))!=0) aps= cmp<0 ? &ps->s_left : &ps->s_right; @@ -38,7 +38,7 @@ struct symbol *insert(name, type, arr_siz, info) * or changed. Nil is returned on redeclaration. */ { - register struct symbol **aps, *ps; + struct symbol **aps, *ps; extern included; if (*(aps=search_sym(&sym_table->local, name))!=nil) { @@ -66,8 +66,8 @@ struct symbol *searchall(name) char *name; * If it can't be found then it is inserted as undefined. */ { - register struct symtab *tab=sym_table; - register struct symbol *ps; + struct symtab *tab=sym_table; + struct symbol *ps; while (tab!=nil) { if ((ps= *search_sym(&tab->local, name))!=nil) return ps; @@ -79,7 +79,7 @@ struct symbol *searchall(name) char *name; } void check_recursion(proc) - register struct expr *proc; + struct expr *proc; { if (proc->kind==E_VAR && proc->u.var->s_type&T_RECURS) warning("recursion not allowed"); @@ -87,7 +87,7 @@ void check_recursion(proc) void sym_down() { - register struct symtab *ps; + struct symtab *ps; ps= (struct symtab *) Malloc(sizeof *ps); @@ -111,7 +111,7 @@ static void sym_destroy(ps) register struct symbol *ps; warning("%s: never assigned", ps->s_name); } if ((ps->s_type&T_TYPE)==T_PROC) { - register struct par_list *par, *junk; + struct par_list *par, *junk; par=ps->s_info.proc.pars; while (par!=nil) { @@ -129,7 +129,7 @@ static void sym_destroy(ps) register struct symbol *ps; void sym_up() { - register struct symtab *ps; + struct symtab *ps; ps=sym_table->global; curr_offset=sym_table->old_offset; @@ -165,12 +165,12 @@ int memory(z) int z; } void pars_add(aapars, type, var) - register struct par_list ***aapars; + struct par_list ***aapars; int type; struct symbol *var; /* Add a formal variable to a parameter list using a hook to a hook. */ { - register struct par_list *pl; + struct par_list *pl; pl= (struct par_list *) Malloc(sizeof *pl); @@ -185,12 +185,12 @@ void pars_add(aapars, type, var) int form_offsets(pars) register struct par_list *pars; /* Recursively assign offsets to formal variables. */ { - register struct symbol *var; + struct symbol *var; if (pars==nil) return pz; if ((var=pars->pr_var)!=nil) { - register offset=form_offsets(pars->pr_next); + offset=form_offsets(pars->pr_next); switch (var->s_type&T_TYPE) { case T_VAR: diff --git a/lang/occam/lib/builtin.c b/lang/occam/lib/builtin.c index 367fc1bdf6..87ce2c661f 100644 --- a/lang/occam/lib/builtin.c +++ b/lang/occam/lib/builtin.c @@ -15,8 +15,8 @@ extern int errno; static void nullterm(s) register char *s; /* Change Occam string to C string */ { - register len= (*s & 0377); - register char *p; + len= (*s & 0377); + char *p; while (--len>=0) { p=s++; @@ -28,8 +28,8 @@ static void nullterm(s) register char *s; static void lenterm(s) register char *s; /* Change C string to Occam string */ { - register i=0; - register c0, c1; + i=0; + c0, c1; c0=0; do { @@ -43,8 +43,8 @@ static void lenterm(s) register char *s; void b_open(mode, name, index) register char *mode, *name; long *index; /* PROC open(VAR index, VALUE name[], mode[])= */ { - register FILE *fp; - register i; + FILE *fp; + i; nullterm(name); nullterm(mode); diff --git a/lang/occam/lib/channel.c b/lang/occam/lib/channel.c index f4a2e2e157..cadc5e6525 100644 --- a/lang/occam/lib/channel.c +++ b/lang/occam/lib/channel.c @@ -27,7 +27,7 @@ void chan_in(v, c) long *v; register chan *c; *v=(c->f.preread&0377); c->f.flgs&= ~C_F_READAHEAD; } else { - register FILE *fp= unix_file[c->f.index]; + FILE *fp= unix_file[c->f.index]; *v= feof(fp) ? C_F_EOF : getc(fp); } @@ -49,7 +49,7 @@ void chan_out(v, c) long v; register chan *c; { switch(c->type) { case C_T_FILE: { - register FILE *fp= unix_file[c->f.index]; + FILE *fp= unix_file[c->f.index]; struct sgttyb tty; if ((v& ~0xff)==0) /* Plain character */ @@ -100,13 +100,13 @@ int chan_any(c) register chan *c; if ((c->f.flgs&C_F_READAHEAD)!=0) return 1; else { - register FILE *fp= unix_file[c->f.index]; + FILE *fp= unix_file[c->f.index]; if (feof(fp)) return 1; else { extern int errno; - register ch; + ch; deadlock=0; /* No deadlock while waiting for key */ diff --git a/lang/occam/lib/co.c b/lang/occam/lib/co.c index 06787f69d6..edd8efbb2f 100644 --- a/lang/occam/lib/co.c +++ b/lang/occam/lib/co.c @@ -13,7 +13,7 @@ void resume(id) identification id; */ { if (group!=nil) { - register wordsize size; + wordsize size; size=top_size(group->s_brk); (*group->active)->stack=alloc((unsigned) size); @@ -34,7 +34,7 @@ static void search(id) identification id; * traversed to find the running process. */ { - register struct process **aproc, *proc; + struct process **aproc, *proc; for(;;) { aproc= &group->first; @@ -65,7 +65,7 @@ static void delete_group(group) struct procgroup *group; * process. */ { - register struct process *proc, *next; + struct process *proc, *next; proc=group->first; @@ -84,8 +84,8 @@ static void delete_group(group) struct procgroup *group; void coend() { - register struct process *proc, *next; - register struct procgroup *junk; + struct process *proc, *next; + struct procgroup *junk; proc=group->first; diff --git a/lang/occam/lib/ocrt.c b/lang/occam/lib/ocrt.c index 805bfed81e..1d1f62a646 100644 --- a/lang/occam/lib/ocrt.c +++ b/lang/occam/lib/ocrt.c @@ -10,7 +10,7 @@ long any; void catch(sig, file, line) int sig; char *file; int line; /* Catches traps in the occam program */ { - register char *mes; + char *mes; switch (sig) { case 0: @@ -34,8 +34,8 @@ FILE *unix_file[20]; void initfile() { - register i; - register chan *c=file; + i; + chan *c=file; for (i=0; i<20; i++) { c->type=C_T_FILE; diff --git a/lang/occam/lib/par.c b/lang/occam/lib/par.c index 33dff48a90..06cf27e652 100644 --- a/lang/occam/lib/par.c +++ b/lang/occam/lib/par.c @@ -11,8 +11,8 @@ void resumenext() */ { if (group!=nil) { - register struct process *proc= *group->active; - register wordsize size; + struct process *proc= *group->active; + wordsize size; size=top_size(group->s_brk); proc->stack=alloc((unsigned) size); @@ -63,14 +63,14 @@ void parend() * in the first place. */ { - register struct process *junk; + struct process *junk; junk= *group->active; *group->active=junk->next; free((void *) junk); if (group->first==nil) { - register struct procgroup *junk; + struct procgroup *junk; delete_between(group); diff --git a/lang/occam/lib/parco.c b/lang/occam/lib/parco.c index 118c3a27ce..1a19cf0840 100644 --- a/lang/occam/lib/parco.c +++ b/lang/occam/lib/parco.c @@ -9,12 +9,12 @@ struct procgroup *group=nil, *highest_group; int deadlock=0; void pc_begin(s_brk, id) - register void *s_brk; + void *s_brk; identification id; /* Sets up a group of processes and puts the current process in it */ { - register struct procgroup *pg; - register struct process *p; + struct procgroup *pg; + struct process *p; pg= (struct procgroup *) alloc(sizeof *pg); p= (struct process *) alloc(sizeof *p); @@ -41,8 +41,8 @@ int pc_fork(id) identification id; * current process, 0 in the copied process. The current process runs first. */ { - register struct process *newp; - register wordsize size; + struct process *newp; + wordsize size; newp= (struct process *) alloc(sizeof *newp); @@ -68,7 +68,7 @@ int pc_fork(id) identification id; void init_between(group) register struct procgroup *group; /* Allocates memory to hold the stack space between s_brk and up->s_brk. */ { - register wordsize size; + wordsize size; if (group->up==nil || (size= (wordsize) group->up->s_brk - (wordsize) group->s_brk)==0) @@ -82,7 +82,7 @@ void block_move(); void save_between(group) register struct procgroup *group; /* Saves the stack space between s_brk and up->s_brk. */ { - register wordsize size; + wordsize size; if (group->between!=nil) { size= (wordsize) group->up->s_brk - (wordsize) group->s_brk; @@ -96,8 +96,8 @@ void load_betweens() * place (i.e. s_brk). */ { - register struct procgroup *gr=group, *up; - register wordsize size; + struct procgroup *gr=group, *up; + wordsize size; while (gr!=highest_group) { up=gr->up; @@ -121,7 +121,7 @@ void *malloc(); void *alloc(size) unsigned size; { - register void *mem; + void *mem; if ((mem=malloc(size))==nil) { write(2, "Heap error\n", 14); diff --git a/lang/pc/comp/LLlex.c b/lang/pc/comp/LLlex.c index cda86019af..42545461bb 100644 --- a/lang/pc/comp/LLlex.c +++ b/lang/pc/comp/LLlex.c @@ -46,7 +46,7 @@ int tokenseen = 0; /* Some comment-options must precede any program text */ */ void CommentOptions(void) { - register int ch, ci; + int ch, ci; int on_on_minus = 0; /* Parse options inside comments */ @@ -91,7 +91,7 @@ void CommentOptions(void) case 'i': { - register int i=0; + int i=0; LoadChar(ch); while( ch >= '0' && ch <= '9' ) { @@ -128,7 +128,7 @@ static void SkipComment(void) comments may not be nested (ISO 6.1.8). (* and { are interchangeable, so are *) and }. */ - register int ch; + int ch; LoadChar(ch); if (ch == '$') CommentOptions(); @@ -153,15 +153,15 @@ static void SkipComment(void) } } -static struct string *GetString(register int delim) +static struct string *GetString(int delim) { /* Read a Pascal string, delimited by the character ' or ". */ - register int ch; - register struct string *str = (struct string *) + int ch; + struct string *str = (struct string *) Malloc((unsigned) sizeof(struct string)); - register char *p; - register int len = ISTRSIZE; + char *p; + int len = ISTRSIZE; str->s_str = p = Malloc((unsigned int) ISTRSIZE); for( ; ; ) { @@ -210,10 +210,10 @@ static char *s_error = "illegal line directive"; void CheckForLineDirective(void) { - register int ch; - register int i = 0; + int ch; + int i = 0; char buf[IDFSIZE + 2]; - register char *c = buf; + char *c = buf; LoadChar(ch); @@ -276,8 +276,8 @@ int LLlex(void) /* LLlex() is the Lexical Analyzer. The putting aside of tokens is taken into account. */ - register struct token *tk = ˙ - register int ch, nch; + struct token *tk = ˙ + int ch, nch; toktype = error_type; @@ -386,8 +386,8 @@ int LLlex(void) case STIDF: { char buf[IDFSIZE + 1]; - register char *tag = &buf[0]; - register struct idf *id; + char *tag = &buf[0]; + struct idf *id; do { if( !options['C'] ) /* -C : cases are different */ @@ -414,7 +414,7 @@ int LLlex(void) } case STSTR: { - register struct string *str = GetString(ch); + struct string *str = GetString(ch); if( str->s_length == 1 && ch == '\'') { #ifdef DEBUG @@ -447,8 +447,8 @@ int LLlex(void) #define REAL_MODE 1 char buf[NUMSIZE+2]; - register char *np = &buf[1]; - register int state = INT_MODE; + char *np = &buf[1]; + int state = INT_MODE; buf[0] = '-'; do { diff --git a/lang/pc/comp/LLmessage.c b/lang/pc/comp/LLmessage.c index e18c4c4cc0..10b90477e6 100644 --- a/lang/pc/comp/LLmessage.c +++ b/lang/pc/comp/LLmessage.c @@ -21,12 +21,12 @@ extern int expect_label; -void LLmessage(register int tk) +void LLmessage(int tk) { if( tk > 0 ) { /* if( tk > 0 ), it represents the token to be inserted. */ - register struct token *dotp = ˙ + struct token *dotp = ˙ error("%s missing before %s", symbol2str(tk), symbol2str(dotp->tk_symb)); diff --git a/lang/pc/comp/body.c b/lang/pc/comp/body.c index 81549deee5..7e9cfb10b5 100644 --- a/lang/pc/comp/body.c +++ b/lang/pc/comp/body.c @@ -21,7 +21,7 @@ #include "typequiv.h" #include "error.h" -void MarkDef(register struct node *nd, unsigned short flags, int on) +void MarkDef(struct node *nd, unsigned short flags, int on) { while (nd && nd->nd_class != Def) { @@ -52,7 +52,7 @@ void MarkDef(register struct node *nd, unsigned short flags, int on) } } -void AssertStat(register struct node *expp, unsigned short line) +void AssertStat(struct node *expp, unsigned short line) { struct desig dsr; @@ -74,9 +74,9 @@ void AssertStat(register struct node *expp, unsigned short line) } } -void AssignStat(register struct node *left, register struct node *right) +void AssignStat(struct node *left, struct node *right) { - register struct type *ltp, *rtp; + struct type *ltp, *rtp; int retval = 0; struct desig dsr; @@ -141,7 +141,7 @@ void AssignStat(register struct node *left, register struct node *right) FreeNode(right); } -void ProcStat(register struct node *nd) +void ProcStat(struct node *nd) { if (!ChkCall(nd)) return; @@ -153,9 +153,9 @@ void ProcStat(register struct node *nd) } } -void ChkForStat(register struct node *nd) +void ChkForStat(struct node *nd) { - register struct def *df; + struct def *df; int retvar = 0; retvar = ChkVariable(nd); @@ -214,9 +214,9 @@ void ChkForStat(register struct node *nd) return; } -void EndForStat(register struct node *nd) +void EndForStat(struct node *nd) { - register struct def *df; + struct def *df; df = nd->nd_def; @@ -228,7 +228,7 @@ void EndForStat(register struct node *nd) MarkDef(nd, (unsigned short) (D_INLOOP | D_SET), 0); } -arith CodeInitFor(register struct node *nd, int priority) +arith CodeInitFor(struct node *nd, int priority) { /* Push final-value, the value may only be evaluated once, so generate a temporary for it, when not a constant. diff --git a/lang/pc/comp/body.h b/lang/pc/comp/body.h index 97af256570..d80cf0de09 100644 --- a/lang/pc/comp/body.h +++ b/lang/pc/comp/body.h @@ -14,20 +14,20 @@ struct node; struct scopelist; -void MarkDef(register struct node *nd, unsigned short flags, int on); +void MarkDef(struct node *nd, unsigned short flags, int on); /* Assert statement */ -void AssertStat(register struct node *expp, unsigned short line); +void AssertStat(struct node *expp, unsigned short line); /** Assign statement */ -void AssignStat(register struct node *left, register struct node *right); +void AssignStat(struct node *left, struct node *right); /** Procedure call statement */ -void ProcStat(register struct node *nd); +void ProcStat(struct node *nd); /** ??? */ -void ChkForStat(register struct node *nd); +void ChkForStat(struct node *nd); /** ??? */ -void EndForStat(register struct node *nd); -arith CodeInitFor(register struct node *nd, int priority); +void EndForStat(struct node *nd); +arith CodeInitFor(struct node *nd, int priority); void CodeFor(struct node *nd, int stepsize, label l1, label l2); void CodeEndFor(struct node *nd, int stepsize, label l1, label l2, arith tmp2); diff --git a/lang/pc/comp/chk_expr.c b/lang/pc/comp/chk_expr.c index 507c062058..09e1fe49ab 100644 --- a/lang/pc/comp/chk_expr.c +++ b/lang/pc/comp/chk_expr.c @@ -32,12 +32,12 @@ #include "error.h" #include "lookup.h" -static int ChkValue(register struct node *); -static int ChkUnOper(register struct node *); -static int ChkStandard(register struct node *, register struct node *); +static int ChkValue(struct node *); +static int ChkUnOper(struct node *); +static int ChkStandard(struct node *, struct node *); -static void Xerror(register struct node *nd, char *mess) +static void Xerror(struct node *nd, char *mess) { if (nd->nd_class == Def && nd->nd_def) { @@ -50,7 +50,7 @@ static void Xerror(register struct node *nd, char *mess) struct node *ZeroParam(void) { - register struct node *nd; + struct node *nd; nd = MkLeaf(Value, &dot); nd->nd_type = int_type; @@ -62,7 +62,7 @@ struct node *ZeroParam(void) return nd; } -void MarkUsed(register struct node *nd) +void MarkUsed(struct node *nd) { while (nd && nd->nd_class != Def) { @@ -76,7 +76,7 @@ void MarkUsed(register struct node *nd) if (nd && nd->nd_class == Def) { - register struct def *df = nd->nd_def; + struct def *df = nd->nd_def; if (df->df_kind != D_FIELD) { @@ -91,9 +91,9 @@ void MarkUsed(register struct node *nd) } } -int ChkConstant(register struct node *expp) +int ChkConstant(struct node *expp) { - register struct node *nd; + struct node *nd; if (!(nd = expp->nd_right)) nd = expp; @@ -117,7 +117,7 @@ int ChkConstant(register struct node *expp) return 1; } -int ChkVariable(register struct node *expp) +int ChkVariable(struct node *expp) { /* Check that "expp" indicates an item that can be accessed */ @@ -132,7 +132,7 @@ int ChkVariable(register struct node *expp) return 1; } -int ChkLhs(register struct node *expp) +int ChkLhs(struct node *expp) { int class; @@ -171,7 +171,7 @@ int ChkLhs(register struct node *expp) } #ifdef DEBUG -static int ChkValue(register struct node *expp) +static int ChkValue(struct node *expp) { switch( expp->nd_symb ) { @@ -188,9 +188,9 @@ static int ChkValue(register struct node *expp) } #endif -int ChkLinkOrName(register struct node *expp) +int ChkLinkOrName(struct node *expp) { - register struct def *df; + struct def *df; expp->nd_type = error_type; @@ -203,7 +203,7 @@ int ChkLinkOrName(register struct node *expp) else if (expp->nd_class == Link) { /* a selection from a record */ - register struct node *left = expp->nd_left; + struct node *left = expp->nd_left; assert(expp->nd_symb == '.'); @@ -256,7 +256,7 @@ int ChkLinkOrName(register struct node *expp) return df->df_kind != D_ERROR; } -static int ChkExLinkOrName(register struct node *expp) +static int ChkExLinkOrName(struct node *expp) { if (!ChkLinkOrName(expp)) return 0; @@ -271,12 +271,12 @@ static int ChkExLinkOrName(register struct node *expp) return 1; } -static int ChkUnOper(register struct node *expp) +static int ChkUnOper(struct node *expp) { /* Check an unary operation. */ - register struct node *right = expp->nd_right; - register struct type *tpr; + struct node *right = expp->nd_right; + struct type *tpr; if (!ChkExpression(right)) return 0; @@ -412,11 +412,11 @@ static int Boolean(int operator) return operator == OR || operator == AND; } -static int ChkBinOper(register struct node *expp) +static int ChkBinOper(struct node *expp) { /* Check a binary operation. */ - register struct node *left, *right; + struct node *left, *right; struct type *tpl, *tpr; int retval, allowed; @@ -551,15 +551,15 @@ static int ChkBinOper(register struct node *expp) return 1; } -static int ChkElement(register struct node *expp, register struct type **tp, +static int ChkElement(struct node *expp, struct type **tp, arith **set, unsigned *cnt) { /* Check elements of a set. This routine may call itself recursively. Also try to compute the set! */ - register struct node *left = expp->nd_left; - register struct node *right = expp->nd_right; - register int i; + struct node *left = expp->nd_left; + struct node *right = expp->nd_right; + int i; if (expp->nd_class == Link && expp->nd_symb == UPTO) { @@ -646,12 +646,12 @@ static int ChkElement(register struct node *expp, register struct type **tp, return 1; } -static int ChkSet(register struct node *expp) +static int ChkSet(struct node *expp) { /* Check the legality of a SET aggregate, and try to evaluate it compile time. Unfortunately this is all rather complicated. */ - register struct node *nd = expp->nd_right; + struct node *nd = expp->nd_right; arith *set = (arith *) 0; unsigned cnt = 0; @@ -707,7 +707,7 @@ static int ChkSet(register struct node *expp) return 1; } -char *ChkAllowedVar(register struct node *nd, int reading) +char *ChkAllowedVar(struct node *nd, int reading) /* reading indicates read or readln */ { @@ -753,7 +753,7 @@ char *ChkAllowedVar(register struct node *nd, int reading) return message; } -static int ChkVarPar(register struct node *nd, register struct node *name) +static int ChkVarPar(struct node *nd, struct node *name) { /* ISO 6.6.3.3 : An actual variable parameter shall not denote a field @@ -789,8 +789,8 @@ getarg(struct node **argp, int bases, int varaccess, struct node *name, that the address from this argument is taken, so that it must be a varaccess and may not be a register variable. */ - register struct node *arg = (*argp)->nd_right; - register struct node *left; + struct node *arg = (*argp)->nd_right; + struct node *left; if (!arg) { @@ -856,9 +856,9 @@ static int ChkProcCall(struct node *expp) { /* Check a procedure call */ - register struct node *left; + struct node *left; struct node *name; - register struct paramlist *param; + struct paramlist *param; char ebuf[80]; int retval = 1; int cnt = 0; @@ -935,7 +935,7 @@ static int ChkProcCall(struct node *expp) return retval; } -int ChkCall(register struct node *expp) +int ChkCall(struct node *expp) { /* Check something that looks like a procedure or function call. Of course this does not have to be a call at all, @@ -944,7 +944,7 @@ int ChkCall(register struct node *expp) /* First, get the name of the function or procedure */ - register struct node *left = expp->nd_left; + struct node *left = expp->nd_left; expp->nd_type = error_type; @@ -975,7 +975,7 @@ int ChkCall(register struct node *expp) return ChkProcCall(expp); } -static int ChkExCall(register struct node *expp) +static int ChkExCall(struct node *expp) { if (!ChkCall(expp)) return 0; @@ -988,7 +988,7 @@ static int ChkExCall(register struct node *expp) return 1; } -static int ChkNameOrCall(register struct node *expp) +static int ChkNameOrCall(struct node *expp) { /* From the context it appears that the occurrence of the function- identifier is a call to that function @@ -999,7 +999,7 @@ static int ChkNameOrCall(register struct node *expp) return ChkExCall(expp); } -static int ChkStandard(register struct node *expp, register struct node *left) +static int ChkStandard(struct node *expp, struct node *left) { /* Check a call of a standard procedure or function */ @@ -1201,8 +1201,8 @@ static int ChkStandard(register struct node *expp, register struct node *left) if (arg->nd_right) { /* varargs new/dispose(p,c1,.....) */ - register struct selector *sel; - register arith i; + struct selector *sel; + arith i; if (PointedtoType(left->nd_type) ->tp_fund != T_RECORD) break; @@ -1262,14 +1262,14 @@ static int ChkStandard(register struct node *expp, register struct node *left) return 1; } -static int ChkArrow(register struct node *expp) +static int ChkArrow(struct node *expp) { /* Check an application of the '^' operator. The operand must be a variable of a pointer-type or a variable of a file-type. */ - register struct type *tp; + struct type *tp; assert(expp->nd_class == Arrow); assert(expp->nd_symb == '^'); @@ -1293,7 +1293,7 @@ static int ChkArrow(register struct node *expp) return 1; } -static int ChkArr(register struct node *expp) +static int ChkArr(struct node *expp) { /* Check an array selection. The left hand side must be a variable of an array type, @@ -1301,7 +1301,7 @@ static int ChkArr(register struct node *expp) assignment compatible with the array-index. */ - register struct type *tpl, *tpr; + struct type *tpl, *tpr; int retval; assert(expp->nd_class == Arrsel); diff --git a/lang/pc/comp/chk_expr.h b/lang/pc/comp/chk_expr.h index 77f29997bc..e762dc5998 100644 --- a/lang/pc/comp/chk_expr.h +++ b/lang/pc/comp/chk_expr.h @@ -13,13 +13,13 @@ extern int (*VarAccChkTable[])(struct node*); /* table of variable-access checki #define ChkExpression(expp) ((*ExprChkTable[(expp)->nd_class])(expp)) #define ChkVarAccess(expp) ((*VarAccChkTable[(expp)->nd_class])(expp)) -int ChkConstant(register struct node *expp); -int ChkVariable(register struct node *expp); +int ChkConstant(struct node *expp); +int ChkVariable(struct node *expp); /* Check that "expp" indicates an item that can be the lhs of an assignment, return 1 if possible, on return 0. */ -int ChkLhs(register struct node *expp); -int ChkLinkOrName(register struct node *expp); -char *ChkAllowedVar(register struct node *nd, int reading); -int ChkCall(register struct node *expp); -void MarkUsed(register struct node *nd); +int ChkLhs(struct node *expp); +int ChkLinkOrName(struct node *expp); +char *ChkAllowedVar(struct node *nd, int reading); +int ChkCall(struct node *expp); +void MarkUsed(struct node *nd); diff --git a/lang/pc/comp/code.c b/lang/pc/comp/code.c index 8a8d8b87b5..ca91764c24 100644 --- a/lang/pc/comp/code.c +++ b/lang/pc/comp/code.c @@ -28,18 +28,18 @@ int fp_used; -static void CodeUoper(register struct node *); -static void CodeBoper(register struct node *, /* the expression tree itself */ +static void CodeUoper(struct node *); +static void CodeBoper(struct node *, /* the expression tree itself */ label); -static void CodeSet(register struct node *); -static void CodeEl(register struct node *, register struct type *); +static void CodeSet(struct node *); +static void CodeEl(struct node *, struct type *); static void CodePString(struct node *, struct type *); /* General internal system API calls */ static void CodeStd(struct node *); -static void genrck(register struct type *); -static void RegisterMessages(register struct def *); -static void CodeConfDescr(register struct type *, register struct type *); +static void genrck(struct type *); +static void RegisterMessages(struct def *); +static void CodeConfDescr(struct type *, struct type *); extern void call_ini(void); @@ -51,14 +51,14 @@ static void CodeFil(void) C_fil_dlb((label ) 1, (arith) 0); } -void routine_label(register struct def * df) +void routine_label(struct def * df) { df->prc_label = ++data_label; C_df_dlb(df->prc_label); C_rom_scon(df->df_idf->id_text, (arith)(strlen(df->df_idf->id_text) + 1)); } -void RomString(register struct node *nd) +void RomString(struct node *nd) { C_df_dlb(++data_label); @@ -71,7 +71,7 @@ void RomString(register struct node *nd) nd->nd_SLA = data_label; } -void RomReal(register struct node *nd) +void RomReal(struct node *nd) { if (!nd->nd_RLA) { @@ -84,7 +84,7 @@ void RomReal(register struct node *nd) void BssVar(void) { /* generate bss segments for global variables */ - register struct def *df = GlobalScope->sc_def; + struct def *df = GlobalScope->sc_def; while (df) { @@ -99,12 +99,12 @@ void BssVar(void) } } -static arith CodeGtoDescr(register struct scope *sc) +static arith CodeGtoDescr(struct scope *sc) { /* Create code for goto descriptors */ - register struct node *lb = sc->sc_lablist; + struct node *lb = sc->sc_lablist; int first = 1; while (lb) @@ -130,7 +130,7 @@ static arith CodeGtoDescr(register struct scope *sc) return (arith) 0; } -arith CodeBeginBlock(register struct def *df) +arith CodeBeginBlock(struct def *df) { /* Generate code at the beginning of the main program, procedure or function. @@ -161,7 +161,7 @@ arith CodeBeginBlock(register struct def *df) else if (df->df_kind & (D_PROCEDURE | D_FUNCTION)) { struct type *tp; - register struct paramlist *param; + struct paramlist *param; C_pro_narg(df->prc_name); C_ms_par(df->df_type->prc_nbpar); @@ -255,7 +255,7 @@ arith CodeBeginBlock(register struct def *df) return StackAdjustment; } -void CodeEndBlock(register struct def *df, arith StackAdjustment) +void CodeEndBlock(struct def *df, arith StackAdjustment) { if (df->df_kind == D_PROGRAM) { @@ -316,10 +316,10 @@ void CodeEndBlock(register struct def *df, arith StackAdjustment) TmpClose(); } -void CodeExpr(register struct node *nd, register struct desig *ds, +void CodeExpr(struct node *nd, struct desig *ds, label true_label) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; if (tp->tp_fund == T_REAL) fp_used = 1; @@ -366,8 +366,8 @@ void CodeExpr(register struct node *nd, register struct desig *ds, case Set: { - register arith *st = nd->nd_set; - register int i; + arith *st = nd->nd_set; + int i; ds->dsg_kind = DSG_LOADED; if (!st) @@ -468,9 +468,9 @@ void CodeExpr(register struct node *nd, register struct desig *ds, } } -static void CodeUoper(register struct node *nd) +static void CodeUoper(struct node *nd) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; CodePExpr(nd->nd_right); @@ -528,18 +528,18 @@ static void truthvalue(int relop) -static void Operands(register struct node *leftop, register struct node *rightop) +static void Operands(struct node *leftop, struct node *rightop) { CodePExpr(leftop); CodePExpr(rightop); } -static void CodeBoper(register struct node *expr, /* the expression tree itself */ +static void CodeBoper(struct node *expr, /* the expression tree itself */ label true_label) /* label to jump to in logical exprs */ { - register struct node *leftop = expr->nd_left; - register struct node *rightop = expr->nd_right; - register struct type *tp = expr->nd_type; + struct node *leftop = expr->nd_left; + struct node *rightop = expr->nd_right; + struct type *tp = expr->nd_type; switch (expr->nd_symb) { @@ -728,9 +728,9 @@ label true_label) /* label to jump to in logical exprs */ } -static void CodeSet(register struct node *nd) +static void CodeSet(struct node *nd) { - register struct type *tp = nd->nd_type; + struct type *tp = nd->nd_type; C_zer(tp->tp_size); nd = nd->nd_right; @@ -743,7 +743,7 @@ static void CodeSet(register struct node *nd) } } -static void CodeEl(register struct node *nd, register struct type *tp) +static void CodeEl(struct node *nd, struct type *tp) { if (nd->nd_class == Link && nd->nd_symb == UPTO) { @@ -762,7 +762,7 @@ static void CodeEl(register struct node *nd, register struct type *tp) static struct type * CodeParameters(struct paramlist *param, struct node *arg) { - register struct type *tp, *left_tp, *last_tp = (struct type *) 0; + struct type *tp, *left_tp, *last_tp = (struct type *) 0; struct node *left; struct desig ds; @@ -806,7 +806,7 @@ static struct type * CodeParameters(struct paramlist *param, struct node *arg) return tp; } -static void CodeConfDescr(register struct type *ftp, register struct type *atp) +static void CodeConfDescr(struct type *ftp, struct type *atp) { struct type *elemtp = ftp->arr_elem; @@ -847,15 +847,15 @@ static void CodePString(struct node *nd, struct type *tp) C_loi(tp->tp_size); } -void CodeCall(register struct node *nd) +void CodeCall(struct node *nd) { /* Generate code for a procedure call. Checking of parameters and result is already done. */ - register struct node *left = nd->nd_left; - register struct node *right = nd->nd_right; - register struct def *df = left->nd_def; - register struct type *result_tp; + struct node *left = nd->nd_left; + struct node *right = nd->nd_right; + struct def *df = left->nd_def; + struct type *result_tp; assert(IsProcCall(left)); @@ -916,9 +916,9 @@ void CodeCall(register struct node *nd) static void CodeStd(struct node *nd) { - register struct node *arg = nd->nd_right; - register struct node *left = arg->nd_left; - register struct type *tp = BaseType(left->nd_type); + struct node *arg = nd->nd_right; + struct node *left = arg->nd_left; + struct type *tp = BaseType(left->nd_type); int req = nd->nd_left->nd_def->df_value.df_reqname; assert(arg->nd_class == Link && arg->nd_symb == ','); @@ -1187,7 +1187,7 @@ void Real2Int(void) C_cfi(); } -void RangeCheck(register struct type *tpl, register struct type *tpr) +void RangeCheck(struct type *tpl, struct type *tpr) { /* Generate a range check if neccessary */ @@ -1215,14 +1215,14 @@ void RangeCheck(register struct type *tpl, register struct type *tpr) } } -static void genrck(register struct type *tp) +static void genrck(struct type *tp) { /* Generate a range check descriptor for type "tp" when necessary. Return its label. */ arith lb, ub; - register label o1; + label o1; int newlabel = 0; if (options['R']) @@ -1253,7 +1253,7 @@ static void genrck(register struct type *tp) C_rck(word_size); } -void CodePExpr(register struct node *nd) +void CodePExpr(struct node *nd) { /* Generate code to push the value of the expression "nd" on the stack. @@ -1283,7 +1283,7 @@ void CodeDAddress(struct node *nd) CodeAddress(&designator); } -void CodeDStore(register struct node *nd) +void CodeDStore(struct node *nd) { /* Generate code to store the expression on the stack into the designator "nd". @@ -1296,9 +1296,9 @@ void CodeDStore(register struct node *nd) CodeStore(&designator, nd->nd_type); } -static void RegisterMessages(register struct def *df) +static void RegisterMessages(struct def *df) { - register struct type *tp; + struct type *tp; for (; df; df = df->df_nextinscope) { diff --git a/lang/pc/comp/code.h b/lang/pc/comp/code.h index 06fc03c5bc..a3494bc8be 100644 --- a/lang/pc/comp/code.h +++ b/lang/pc/comp/code.h @@ -14,21 +14,21 @@ struct node; struct type; struct desig; -void routine_label(register struct def * df); -void RomString(register struct node *nd); -void RomReal(register struct node *nd); +void routine_label(struct def * df); +void RomString(struct node *nd); +void RomReal(struct node *nd); void BssVar(void); -arith CodeBeginBlock(register struct def *df); -void CodeEndBlock(register struct def *df, arith StackAdjustment); -void CodeExpr(register struct node *nd, register struct desig *ds, +arith CodeBeginBlock(struct def *df); +void CodeEndBlock(struct def *df, arith StackAdjustment); +void CodeExpr(struct node *nd, struct desig *ds, label true_label); -void CodeCall(register struct node *nd); -void RangeCheck(register struct type *tpl, register struct type *tpr); +void CodeCall(struct node *nd); +void RangeCheck(struct type *tpl, struct type *tpr); /* Generate code to push the value of the expression "nd" on the stack. */ -void CodePExpr(register struct node *nd); +void CodePExpr(struct node *nd); /* Generate code to push the address of the designator "nd" on the stack. @@ -38,7 +38,7 @@ void CodeDAddress(struct node *nd); /* Generate code to store the expression on the stack into the designator "nd". */ -void CodeDStore(register struct node *nd); +void CodeDStore(struct node *nd); /* Generate code to convert long to int */ void Long2Int(void); diff --git a/lang/pc/comp/cstoper.c b/lang/pc/comp/cstoper.c index 07ebc0288f..c86480bc98 100644 --- a/lang/pc/comp/cstoper.c +++ b/lang/pc/comp/cstoper.c @@ -28,16 +28,16 @@ char *maxint_str; /* string representation of maximum integer */ arith wrd_bits; /* number of bits in a word */ arith max_intset; /* largest value of set of integer */ -void CutSize(register struct node *expr); +void CutSize(struct node *expr); void overflow(struct node *expp) { node_warning(expp, "overflow in constant expression"); } -void cstunary(register struct node *expp) +void cstunary(struct node *expp) { - register arith o1 = expp->nd_right->nd_INT; + arith o1 = expp->nd_right->nd_INT; switch( expp->nd_symb ) { /* Should not get here @@ -66,13 +66,13 @@ void cstunary(register struct node *expp) expp->nd_right = NULLNODE; } -void cstbin(register struct node *expp) +void cstbin(struct node *expp) { /* The binary operation in "expp" is performed on the constant expressions below it, and the result restored in expp. */ - register arith o1, o2; - register char *s1, *s2; + arith o1, o2; + char *s1, *s2; int str = expp->nd_left->nd_type->tp_fund & T_STRINGCONST; if( str ) { @@ -194,12 +194,12 @@ void cstbin(register struct node *expp) expp->nd_left = expp->nd_right = NULLNODE; } -void cstset(register struct node *expp) +void cstset(struct node *expp) { - register arith *set1, *set2; + arith *set1, *set2; arith *resultset = (arith *) 0; int empty_result = 0; - register int setsize, j; + int setsize, j; assert(expp->nd_right->nd_class == Set); assert(expp->nd_symb == IN || expp->nd_left->nd_class == Set); @@ -348,12 +348,12 @@ void cstset(register struct node *expp) expp->nd_left = expp->nd_right = NULLNODE; } -void cstcall(register struct node *expp, int req) +void cstcall(struct node *expp, int req) { /* a standard procedure call is found that can be evaluated compile time, so do so. */ - register struct node *expr = NULLNODE; + struct node *expr = NULLNODE; assert(expp->nd_class == Call); @@ -435,13 +435,13 @@ void cstcall(register struct node *expp, int req) expp->nd_right = expp->nd_left = NULLNODE; } -void CutSize(register struct node *expr) +void CutSize(struct node *expr) { /* The constant value of the expression expr is made to conform * to the size of the type of the expression */ - register arith o1 = expr->nd_INT; - register struct type *tp = BaseType(expr->nd_type); + arith o1 = expr->nd_INT; + struct type *tp = BaseType(expr->nd_type); int size = tp->tp_size; long remainder = o1 & ~full_mask[size]; @@ -469,8 +469,8 @@ void CutSize(register struct node *expr) void InitCst(void) { - register int i = 0; - register arith bt = (arith)0; + int i = 0; + arith bt = (arith)0; while( !(bt < 0) ) { bt = (bt << 8) + 0377; diff --git a/lang/pc/comp/cstoper.h b/lang/pc/comp/cstoper.h index f0b5d21020..ac4cc7f873 100644 --- a/lang/pc/comp/cstoper.h +++ b/lang/pc/comp/cstoper.h @@ -12,23 +12,23 @@ struct node; /* The unary operation in "expp" is performed on the constant expression below it, and the result restored in expp. */ -void cstunary(register struct node *expp); +void cstunary(struct node *expp); /* The binary operation in "expp" is performed on the constant expressions below it, and the result restored in expp. */ -void cstbin(register struct node *expp); -void cstset(register struct node *expp); +void cstbin(struct node *expp); +void cstset(struct node *expp); /* Standard system function call that can be evaluated * a compile time. */ -void cstcall(register struct node *expp, int req); +void cstcall(struct node *expp, int req); /* The constant value of the expression expr is made to conform * to the size of the type of the expression */ -void CutSize(register struct node *expr); +void CutSize(struct node *expr); void InitCst(void); diff --git a/lang/pc/comp/declar.g b/lang/pc/comp/declar.g index a48518b0fd..d7ca62447e 100644 --- a/lang/pc/comp/declar.g +++ b/lang/pc/comp/declar.g @@ -216,7 +216,7 @@ TypeDefinition } ; -TypeDenoter(register struct type **ptp;): +TypeDenoter(struct type **ptp;): /* This is a changed rule, because the grammar as specified in the * reference is not LL(1), and this gives conflicts. */ @@ -229,7 +229,7 @@ TypeDenoter(register struct type **ptp;): EnumeratedType(ptp) ; -TypeIdentifierOrSubrangeType(register struct type **ptp;) +TypeIdentifierOrSubrangeType(struct type **ptp;) { struct node *nd1, *nd2; } : @@ -263,7 +263,7 @@ TypeIdentifierOrSubrangeType(register struct type **ptp;) ] ; -TypeIdentifier(register struct type **ptp;): +TypeIdentifier(struct type **ptp;): IDENT { register struct node *nd = MkLeaf(Name, &dot); chk_type_id(ptp, nd); FreeNode(nd); @@ -317,7 +317,7 @@ ProcedureDeclaration ] ; -ProcedureHeading(register struct node **pnd; register struct type **ptp;) +ProcedureHeading(struct node **pnd; register struct type **ptp;) { struct node *fpl; } : @@ -405,7 +405,7 @@ FunctionDeclaration ] ; -FunctionHeading(register struct node **pnd; register struct type **ptp;) +FunctionHeading(struct node **pnd; register struct type **ptp;) { /* This is the Function AND FunctionIdentification part. If it is a identification, *ptp is set to NULLTYPE. @@ -445,7 +445,7 @@ FunctionHeading(register struct node **pnd; register struct type **ptp;) ; /* ISO section 6.4.2.1, p. 96 */ -OrdinalType(register struct type **ptp;): +OrdinalType(struct type **ptp;): /* This is a changed rule, because the grammar as specified in the * reference states that a SubrangeType can start with an IDENT and * so can an OrdinalTypeIdentifier, and this is not LL(1). @@ -456,7 +456,7 @@ OrdinalType(register struct type **ptp;): ; /* ISO section 6.4.2.3, p. 97 */ -EnumeratedType(register struct type **ptp;) +EnumeratedType(struct type **ptp;) { struct node *EnumList; arith i = (arith) 1; @@ -480,7 +480,7 @@ EnumeratedType(register struct type **ptp;) } ; -IdentifierList(register struct node **nd;) +IdentifierList(struct node **nd;) { register struct node *tnd; } : @@ -494,7 +494,7 @@ IdentifierList(register struct node **nd;) ; /* ISO section 6.4.3.2, p. 98 */ -StructuredType(register struct type **ptp;) +StructuredType(struct type **ptp;) { unsigned short packed = 0; } : @@ -504,7 +504,7 @@ StructuredType(register struct type **ptp;) UnpackedStructuredType(ptp, packed) ; -UnpackedStructuredType(register struct type **ptp; unsigned short packed;): +UnpackedStructuredType(struct type **ptp; unsigned short packed;): ArrayType(ptp, packed) | RecordType(ptp, packed) @@ -515,7 +515,7 @@ UnpackedStructuredType(register struct type **ptp; unsigned short packed;): ; /* ISO section 6.4.3.2, p. 98 */ -ArrayType(register struct type **ptp; unsigned short packed;) +ArrayType(struct type **ptp; unsigned short packed;) { struct type *tp; register struct type *tp2; @@ -542,16 +542,16 @@ ArrayType(register struct type **ptp; unsigned short packed;) } ; -Indextype(register struct type **ptp;): +Indextype(struct type **ptp;): OrdinalType(ptp) ; -ComponentType(register struct type **ptp;): +ComponentType(struct type **ptp;): TypeDenoter(ptp) ; /* ISO section 6.4.3.3, p. 99 */ -RecordType(register struct type **ptp; unsigned short packed;) +RecordType(struct type **ptp; unsigned short packed;) { register struct scope *scope; register struct def *df; @@ -729,7 +729,7 @@ VariantPart(struct scope *scope; arith *cnt; int *palign; } ; -VariantTail(register struct scope *scope; arith *tcnt; arith *max; arith *cnt; +VariantTail(struct scope *scope; arith *tcnt; arith *max; arith *cnt; int *palign; unsigned short packed; struct selector *sel;): /* This is a new rule because the grammar specified by the standard * is not exactly LL(1). @@ -750,7 +750,7 @@ VariantTail(register struct scope *scope; arith *tcnt; arith *max; arith *cnt; ] ; -VariantSelector(register struct type **ptp; register struct idf **pid;) +VariantSelector(struct type **ptp; register struct idf **pid;) { register struct node *nd; } : @@ -803,13 +803,13 @@ CaseConstantList(struct node **nd;) ; /* ISO section 6.4.3.4, p. 101 */ -SetType(register struct type **ptp; unsigned short packed;): +SetType(struct type **ptp; unsigned short packed;): SET OF OrdinalType(ptp) { *ptp = set_type(*ptp, packed); } ; /* ISO section 6.4.3.5, p. 101 */ -FileType(register struct type **ptp;): +FileType(struct type **ptp;): FILET OF { *ptp = construct_type(T_FILE, NULLTYPE); (*ptp)->tp_flags |= T_HASFILE; @@ -829,7 +829,7 @@ FileType(register struct type **ptp;): ; /* ISO section 6.4.4, p. 103 */ -PointerType(register struct type **ptp;) +PointerType(struct type **ptp;) { register struct node *nd; register struct def *df; @@ -913,14 +913,14 @@ FormalParameterSection(struct node *nd;): ] ; -ProceduralParameterSpecification(register struct node **pnd; +ProceduralParameterSpecification(struct node **pnd; register struct type **ptp;): { parlevel++; } ProcedureHeading(pnd, ptp) { parlevel--; } ; -FunctionalParameterSpecification(register struct node **pnd; +FunctionalParameterSpecification(struct node **pnd; register struct type **ptp;): { parlevel++; } FunctionHeading(pnd, ptp) @@ -933,14 +933,14 @@ FunctionalParameterSpecification(register struct node **pnd; } ; -ConformantArraySchema(register struct type **ptp;): +ConformantArraySchema(struct type **ptp;): PackedConformantArraySchema(ptp) | %default UnpackedConformantArraySchema(ptp) ; -PackedConformantArraySchema(register struct type **ptp;) +PackedConformantArraySchema(struct type **ptp;) { struct type *tp; } : @@ -960,7 +960,7 @@ PackedConformantArraySchema(register struct type **ptp;) } ; -UnpackedConformantArraySchema(register struct type **ptp;) +UnpackedConformantArraySchema(struct type **ptp;) { struct type *tp, *tp2; } : @@ -990,7 +990,7 @@ UnpackedConformantArraySchema(register struct type **ptp;) } ; -Index_TypeSpecification(register struct type **ptp; register struct type *tp;) +Index_TypeSpecification(struct type **ptp; register struct type *tp;) { register struct def *df1, *df2; } : diff --git a/lang/pc/comp/def.c b/lang/pc/comp/def.c index eef3cfb69f..76d7e68ce7 100644 --- a/lang/pc/comp/def.c +++ b/lang/pc/comp/def.c @@ -20,13 +20,13 @@ #include "lookup.h" #include "error.h" -struct def *MkDef(register struct idf *id, register struct scope *scope, +struct def *MkDef(struct idf *id, struct scope *scope, long kind) { /* Create a new definition structure in scope "scope", with * id "id" and kind "kind". */ - register struct def *df = new_def(); + struct def *df = new_def(); df->df_idf = id; df->df_scope = scope; @@ -42,7 +42,7 @@ struct def *MkDef(register struct idf *id, register struct scope *scope, return df; } -struct def *define(register struct idf *id, register struct scope *scope, +struct def *define(struct idf *id, struct scope *scope, long kind) { /* Declare an identifier in a scope, but first check if it @@ -50,7 +50,7 @@ struct def *define(register struct idf *id, register struct scope *scope, If so, then check for the cases in which this is legal, and otherwise give an error message. */ - register struct def *df; + struct def *df; if ( (df = lookup(id, scope, 0L)) ) { @@ -177,10 +177,10 @@ void DoDirective(struct idf *directive, struct node *nd, struct type *tp, } } -struct def *DeclProc(register struct node *nd, struct type *tp, - register struct scopelist *scl) +struct def *DeclProc(struct node *nd, struct type *tp, + struct scopelist *scl) { - register struct def *df; + struct def *df; if ( (df = define(nd->nd_IDF, CurrentScope, D_PROCEDURE)) ) { @@ -213,10 +213,10 @@ struct def *DeclProc(register struct node *nd, struct type *tp, } struct def * -DeclFunc(register struct node *nd, struct type *tp, - register struct scopelist *scl) +DeclFunc(struct node *nd, struct type *tp, + struct scopelist *scl) { - register struct def *df; + struct def *df; if ( (df = define(nd->nd_IDF, CurrentScope, D_FUNCTION)) ) { @@ -253,7 +253,7 @@ DeclFunc(register struct node *nd, struct type *tp, return df; } -void EndFunc(register struct def *df) +void EndFunc(struct def *df) { /* assignment to functionname is illegal outside the functionblock */ df->prc_res = 0; @@ -268,10 +268,10 @@ void EndFunc(register struct def *df) } } -void EndBlock(register struct def *block_df) +void EndBlock(struct def *block_df) { - register struct def *tmp_def = CurrentScope->sc_def; - register struct def *df; + struct def *tmp_def = CurrentScope->sc_def; + struct def *df; while (tmp_def) { diff --git a/lang/pc/comp/def.xh b/lang/pc/comp/def.xh index 5ffaf940a7..417bee80da 100644 --- a/lang/pc/comp/def.xh +++ b/lang/pc/comp/def.xh @@ -145,18 +145,18 @@ struct def { /* list of definitions for a name */ /* ALLOCDEF "def" 50 */ -extern struct def *MkDef(register struct idf *id, register struct scope *scope, +extern struct def *MkDef(struct idf *id, register struct scope *scope, long kind); -extern struct def *define(register struct idf *id, register struct scope *scope, +extern struct def *define(struct idf *id, register struct scope *scope, long kind); extern void DoDirective(struct idf *directive, struct node *nd, struct type *tp, struct scopelist *scl, int function); -extern struct def *DeclProc(register struct node *nd, struct type *tp, +extern struct def *DeclProc(struct node *nd, struct type *tp, register struct scopelist *scl); extern struct def * -DeclFunc(register struct node *nd, struct type *tp, +DeclFunc(struct node *nd, struct type *tp, register struct scopelist *scl); -extern void EndFunc(register struct def *df); -extern void EndBlock(register struct def *block_df); +extern void EndFunc(struct def *df); +extern void EndBlock(struct def *block_df); #endif diff --git a/lang/pc/comp/desig.c b/lang/pc/comp/desig.c index f599a81317..4417907f3e 100644 --- a/lang/pc/comp/desig.c +++ b/lang/pc/comp/desig.c @@ -30,7 +30,7 @@ struct withdesig *WithDesigs; -static int properly(register struct desig *ds, arith size, int al) +static int properly(struct desig *ds, arith size, int al) { /* Check if it is allowed to load or store the value indicated by "ds" with LOI/STI. @@ -54,7 +54,7 @@ static int properly(register struct desig *ds, arith size, int al) (! wordmodsz && ds->dsg_offset % size == 0)); } -void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize) +void CodeCopy(struct desig *lhs, struct desig *rhs, arith sz, arith *psize) { struct desig l, r; @@ -69,11 +69,11 @@ void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, C_sti(sz); } -void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp) +void CodeMove(struct desig *rhs, struct node *left, struct type *rtp) { struct desig dsl; - register struct desig *lhs = &dsl; - register struct type *ltp = left->nd_type; + struct desig *lhs = &dsl; + struct type *ltp = left->nd_type; dsl = InitDesig; /* Generate code for an assignment. Testing of type @@ -122,7 +122,7 @@ void CodeMove(register struct desig *rhs, register struct node *left, struct typ C_blm(size); } else { - register arith sz; + arith sz; for( sz = 2 * word_size; sz; sz -= word_size) { while( size >= sz ) @@ -145,7 +145,7 @@ void CodeMove(register struct desig *rhs, register struct node *left, struct typ } } -void CodeValue(register struct desig *ds, register struct type *tp) +void CodeValue(struct desig *ds, struct type *tp) { /* Generate code to load the value of the designator described in "ds" @@ -202,7 +202,7 @@ void CodeValue(register struct desig *ds, register struct type *tp) ds->dsg_kind = DSG_LOADED; } -void CodeStore(register struct desig *ds, register struct type *tp) +void CodeStore(struct desig *ds, struct type *tp) { /* Generate code to store the value on the stack in the designator described in "ds" @@ -253,7 +253,7 @@ void CodeStore(register struct desig *ds, register struct type *tp) ds->dsg_kind = DSG_INIT; } -void CodeAddress(register struct desig *ds) +void CodeAddress(struct desig *ds) { /* Generate code to load the address of the designator described in "ds" @@ -303,7 +303,7 @@ void CodeAddress(register struct desig *ds) ds->dsg_kind = DSG_PLOADED; } -void CodeFieldDesig(register struct def *df, register struct desig *ds) +void CodeFieldDesig(struct def *df, struct desig *ds) { /* Generate code for a field designator. Only the code common for address as well as value computation is generated, and the @@ -319,7 +319,7 @@ void CodeFieldDesig(register struct def *df, register struct desig *ds) first one of the proper record type, which is recognized by its scope indication. */ - register struct withdesig *wds = WithDesigs; + struct withdesig *wds = WithDesigs; assert(wds != 0); @@ -354,14 +354,14 @@ void CodeFieldDesig(register struct def *df, register struct desig *ds) ds->dsg_packed = df->fld_flags & F_PACKED; } -void CodeVarDesig(register struct def *df, register struct desig *ds) +void CodeVarDesig(struct def *df, struct desig *ds) { /* Generate code for a variable represented by a "def" structure. Of course, there are numerous cases: the variable is local, it is a value parameter, it is a var parameter, it is one of those of an enclosing procedure, or it is global. */ - register struct scope *sc = df->df_scope; + struct scope *sc = df->df_scope; assert(ds->dsg_kind == DSG_INIT); @@ -418,7 +418,7 @@ void CodeVarDesig(register struct def *df, register struct desig *ds) ds->dsg_def = df; } -void CodeBoundDesig(register struct def *df, register struct desig *ds) +void CodeBoundDesig(struct def *df, struct desig *ds) { /* Generate code for the lower- and upperbound of a conformant array */ @@ -444,7 +444,7 @@ void CodeBoundDesig(register struct def *df, register struct desig *ds) ds->dsg_kind = DSG_LOADED; } -void CodeFuncDesig(register struct def *df, register struct desig *ds) +void CodeFuncDesig(struct def *df, struct desig *ds) { /* generate code to store the function result */ @@ -478,12 +478,12 @@ void CodeFuncDesig(register struct def *df, register struct desig *ds) ds->dsg_offset = df->prc_res; } -void CodeDesig(register struct node *nd, register struct desig *ds) +void CodeDesig(struct node *nd, struct desig *ds) { /* Generate code for a designator. Use divide and conquer principle */ - register struct def *df; + struct def *df; switch( nd->nd_class ) { /* Divide */ case Def: diff --git a/lang/pc/comp/desig.xh b/lang/pc/comp/desig.xh index 0bbb99c1ce..30923a5424 100644 --- a/lang/pc/comp/desig.xh +++ b/lang/pc/comp/desig.xh @@ -64,28 +64,28 @@ extern struct desig InitDesig; /* Copies psize bytes from "rhs" to "lhs" */ -void CodeCopy(register struct desig *lhs, register struct desig *rhs, arith sz, arith *psize); +void CodeCopy(struct desig *lhs, register struct desig *rhs, arith sz, arith *psize); /* Generate code for an assignment. */ -void CodeMove(register struct desig *rhs, register struct node *left, struct type *rtp); +void CodeMove(struct desig *rhs, register struct node *left, struct type *rtp); /* Generate code to load the value of the designator described in "ds" onto the operand stack. */ -void CodeValue(register struct desig *ds, register struct type *tp); +void CodeValue(struct desig *ds, register struct type *tp); /* Generate code to store the value on the stack in the designator described in "ds" */ -void CodeStore(register struct desig *ds, register struct type *tp); +void CodeStore(struct desig *ds, register struct type *tp); /* Generate code to load the address of the designator described in "ds" unto the operand stack */ -void CodeAddress(register struct desig *ds); +void CodeAddress(struct desig *ds); /* Generate code for a field designator. */ -void CodeFieldDesig(register struct def *df, register struct desig *ds); +void CodeFieldDesig(struct def *df, register struct desig *ds); /* Generate code for a variable represented by a "def" structure.*/ -void CodeVarDesig(register struct def *df, register struct desig *ds); +void CodeVarDesig(struct def *df, register struct desig *ds); /* Generate code for the lower- and upperbound of a conformant array */ -void CodeBoundDesig(register struct def *df, register struct desig *ds); +void CodeBoundDesig(struct def *df, register struct desig *ds); /* generate code to store the function result */ -void CodeFuncDesig(register struct def *df, register struct desig *ds); +void CodeFuncDesig(struct def *df, register struct desig *ds); /* Generate code for a designator. Use divide and conquer principle */ -void CodeDesig(register struct node *nd, register struct desig *ds); +void CodeDesig(struct node *nd, register struct desig *ds); #endif diff --git a/lang/pc/comp/enter.c b/lang/pc/comp/enter.c index 8d117bb1d9..4f751ac622 100644 --- a/lang/pc/comp/enter.c +++ b/lang/pc/comp/enter.c @@ -25,14 +25,14 @@ extern int parlevel; -struct def *Enter(char *name, long kind, register struct type *type, int pnam) +struct def *Enter(char *name, long kind, struct type *type, int pnam) { /* Enter a definition for "name" with kind "kind" and type "type" in the Current Scope. If it is a standard name, also put its number in the definition structure, and mark the name as set, to inhibit warnings about used before set. */ - register struct def *df; + struct def *df; df = define(str2idf(name, 0), CurrentScope, kind); df->df_type = type; @@ -48,10 +48,10 @@ struct def *Enter(char *name, long kind, register struct type *type, int pnam) return df; } -void EnterProgList(register struct node *Idlist) +void EnterProgList(struct node *Idlist) { - register struct node *idlist = Idlist; - register struct def *df; + struct node *idlist = Idlist; + struct def *df; for (; idlist; idlist = idlist->nd_next) if (!strcmp(input, idlist->nd_IDF->id_text) @@ -96,13 +96,13 @@ void EnterProgList(register struct node *Idlist) FreeNode(Idlist); } -void EnterEnumList(struct node *Idlist, register struct type *type) +void EnterEnumList(struct node *Idlist, struct type *type) { /* Put a list of enumeration literals in the symbol table. They all have type "type". Also assign numbers to them. */ - register struct def *df, *df1 = 0; - register struct node *idlist = Idlist; + struct def *df, *df1 = 0; + struct node *idlist = Idlist; type->enm_ncst = 0; for (; idlist; idlist = idlist->nd_next) @@ -122,14 +122,14 @@ void EnterEnumList(struct node *Idlist, register struct type *type) FreeNode(Idlist); } -void EnterFieldList(struct node *Idlist, register struct type *type, +void EnterFieldList(struct node *Idlist, struct type *type, struct scope *scope, arith *addr, unsigned short packed) { /* Put a list of fields in the symbol table. They all have type "type", and are put in scope "scope". */ - register struct def *df; - register struct node *idlist = Idlist; + struct def *df; + struct node *idlist = Idlist; for (; idlist; idlist = idlist->nd_next) if ( (df = define(idlist->nd_IDF, scope, D_FIELD)) ) @@ -157,9 +157,9 @@ void EnterVarList(struct node *Idlist, struct type *type, int local) "local" is set if the variables are declared local to a procedure. */ - register struct def *df; - register struct node *idlist = Idlist; - register struct scopelist *sc = CurrVis; + struct def *df; + struct node *idlist = Idlist; + struct scopelist *sc = CurrVis; for (; idlist; idlist = idlist->nd_next) { @@ -204,10 +204,10 @@ static void LinkParam(struct paramlist **parlist, struct def *df) } -arith EnterParamList(register struct node *fpl, struct paramlist **parlist) +arith EnterParamList(struct node *fpl, struct paramlist **parlist) { - register arith nb_pars = (proclevel > 1) ? pointer_size : 0; - register struct node *id; + arith nb_pars = (proclevel > 1) ? pointer_size : 0; + struct node *id; struct type *tp; struct def *df; @@ -242,13 +242,13 @@ arith EnterParamList(register struct node *fpl, struct paramlist **parlist) return nb_pars; } -arith EnterParTypes(register struct node *fpl, struct paramlist **parlist) +arith EnterParTypes(struct node *fpl, struct paramlist **parlist) { /* parameters.h in heading of procedural and functional parameters (only types are important, not the names). */ - register arith nb_pars = 0; - register struct node *id; + arith nb_pars = 0; + struct node *id; struct type *tp; struct def *df; diff --git a/lang/pc/comp/enter.h b/lang/pc/comp/enter.h index 68338c38fc..d6a56cdc1e 100644 --- a/lang/pc/comp/enter.h +++ b/lang/pc/comp/enter.h @@ -14,13 +14,13 @@ struct node; struct paramlist; -struct def *Enter(char *name, long kind, register struct type *type, int pnam); -void EnterProgList(register struct node *Idlist); -void EnterEnumList(struct node *Idlist, register struct type *type); -void EnterFieldList(struct node *Idlist, register struct type *type, +struct def *Enter(char *name, long kind, struct type *type, int pnam); +void EnterProgList(struct node *Idlist); +void EnterEnumList(struct node *Idlist, struct type *type); +void EnterFieldList(struct node *Idlist, struct type *type, struct scope *scope, arith *addr, unsigned short packed); void EnterVarList(struct node *Idlist, struct type *type, int local); -arith EnterParamList(register struct node *fpl, struct paramlist **parlist); -arith EnterParTypes(register struct node *fpl, struct paramlist **parlist); +arith EnterParamList(struct node *fpl, struct paramlist **parlist); +arith EnterParTypes(struct node *fpl, struct paramlist **parlist); #endif /* ENTER_H_ */ diff --git a/lang/pc/comp/error.c b/lang/pc/comp/error.c index 1017c3e018..7a7f36ac81 100644 --- a/lang/pc/comp/error.c +++ b/lang/pc/comp/error.c @@ -40,7 +40,7 @@ int err_occurred; -static void _error(int, struct node *, char *, register va_list); +static void _error(int, struct node *, char *, va_list); /* There are three general error-message functions: lexerror() lexical and pre-processor error messages @@ -307,7 +307,7 @@ void crash(va_alist) } #endif -static void _error(int class, struct node *node, char *fmt, register va_list ap) +static void _error(int class, struct node *node, char *fmt, va_list ap) { /* _error attempts to limit the number of error messages for a given line to MAXERR_LINE. @@ -316,7 +316,7 @@ static void _error(int class, struct node *node, char *fmt, register va_list ap) unsigned int ln = 0; static char * last_fn = 0; static int e_seen = 0, w_seen = 0; - register char *remark = 0; + char *remark = 0; /* Since name and number are gathered from different places depending on the class, we first collect the relevant diff --git a/lang/pc/comp/expression.g b/lang/pc/comp/expression.g index b876c02c76..9c61cff669 100644 --- a/lang/pc/comp/expression.g +++ b/lang/pc/comp/expression.g @@ -21,7 +21,7 @@ #include "lookup.h" } -Constant(register struct node **pnd;) +Constant(struct node **pnd;) { register struct node **nd = pnd; } : @@ -42,23 +42,23 @@ Constant(register struct node **pnd;) } ; -Sign(register struct node **pnd;): +Sign(struct node **pnd;): ['+' | '-'] { *pnd = MkLeaf(Uoper, &dot); } ; -UnsignedNumber(register struct node **pnd;): +UnsignedNumber(struct node **pnd;): [INTEGER | REAL] { *pnd = MkLeaf(Value, &dot); (*pnd)->nd_type = toktype; } ; -ConstantIdentifier(register struct node **pnd;): +ConstantIdentifier(struct node **pnd;): IDENT { *pnd = MkLeaf(Name, &dot); } ; /* ISO section 6.7.1, p. 121 */ -Expression(register struct node **pnd;): +Expression(struct node **pnd;): SimpleExpression(pnd) [ /* RelationalOperator substituted inline */ @@ -68,7 +68,7 @@ Expression(register struct node **pnd;): ]? ; -SimpleExpression(register struct node **pnd;): +SimpleExpression(struct node **pnd;): /* ISO 6.7.1: The signs and the adding-operators have equal precedence, and are left-associative. */ @@ -86,7 +86,7 @@ SimpleExpression(register struct node **pnd;): ]* ; -Term(register struct node **pnd;): +Term(struct node **pnd;): Factor(pnd) [ /* MultiplyingOperator substituted inline */ @@ -96,7 +96,7 @@ Term(register struct node **pnd;): ]* ; -Factor(register struct node **pnd;) +Factor(struct node **pnd;) { register struct def *df; } : @@ -156,7 +156,7 @@ Factor(register struct node **pnd;) Factor(&((*pnd)->nd_right)) ; -UnsignedConstant(register struct node **pnd;): +UnsignedConstant(struct node **pnd;): UnsignedNumber(pnd) | STRING { *pnd = MkLeaf(Value, &dot); @@ -173,7 +173,7 @@ UnsignedConstant(register struct node **pnd;): } ; -SetConstructor(register struct node **pnd;) +SetConstructor(struct node **pnd;) { register struct node *nd; } : @@ -190,7 +190,7 @@ SetConstructor(register struct node **pnd;) ']' ; -MemberDesignator(register struct node *nd;) +MemberDesignator(struct node *nd;) { struct node *nd1; } : @@ -204,7 +204,7 @@ MemberDesignator(register struct node *nd;) ; /* ISO section 6.7.2.1, p. 123 */ -BooleanExpression(register struct node **pnd;): +BooleanExpression(struct node **pnd;): Expression(pnd) { if( ChkExpression(*pnd) && (*pnd)->nd_type != bool_type ) @@ -213,7 +213,7 @@ BooleanExpression(register struct node **pnd;): } ; -ActualParameterList(register struct node **pnd;) +ActualParameterList(struct node **pnd;) { register struct node *nd; } : @@ -233,7 +233,7 @@ ActualParameterList(register struct node **pnd;) ; /* ISO section 6.5.1, p. 105 */ -VariableAccess(register struct node **pnd;): +VariableAccess(struct node **pnd;): /* This is a changed rule, because the grammar as specified in the * reference is not LL(1), and this gives conflicts. * @@ -244,7 +244,7 @@ VariableAccess(register struct node **pnd;): VariableAccessTail(pnd) { (void) ChkVariable(*pnd); } ; -VariableAccessTail(register struct node **pnd;): +VariableAccessTail(struct node **pnd;): /* This is a new rule because the grammar specified by the standard * is not exactly LL(1). */ diff --git a/lang/pc/comp/label.c b/lang/pc/comp/label.c index 66c97d66a2..38a235325a 100644 --- a/lang/pc/comp/label.c +++ b/lang/pc/comp/label.c @@ -15,7 +15,7 @@ #include "error.h" #include "lookup.h" -static void CodeLabel(register struct def *df, int local); +static void CodeLabel(struct def *df, int local); void DeclLabel(struct node *nd) @@ -33,8 +33,8 @@ void DeclLabel(struct node *nd) void chk_labels(int Slevel) { - register struct node *labnd = BlockScope->sc_lablist; - register struct def *df; + struct node *labnd = BlockScope->sc_lablist; + struct def *df; while( labnd ) { df = labnd->nd_def; @@ -64,9 +64,9 @@ void chk_labels(int Slevel) } } -void TstLabel(register struct node *nd, int Slevel) +void TstLabel(struct node *nd, int Slevel) { - register struct def *df; + struct def *df; df = lookfor(nd, CurrVis, 0); if( df->df_kind == D_ERROR ) { @@ -82,7 +82,7 @@ void TstLabel(register struct node *nd, int Slevel) df->df_flags = D_USED; if( !df->lab_level ) { /* forward jump */ - register struct lab *labelptr; + struct lab *labelptr; labelptr = new_lab(); labelptr->lb_next = df->lab_next; @@ -106,9 +106,9 @@ void TstLabel(register struct node *nd, int Slevel) CodeLabel(df, 1); } -void DefLabel(register struct node *nd, int Slevel) +void DefLabel(struct node *nd, int Slevel) { - register struct def *df; + struct def *df; if( !(df = lookup(nd->nd_IDF, BlockScope, D_INUSE)) ) { node_error(nd, "label %s must be declared in same block" @@ -125,7 +125,7 @@ void DefLabel(register struct node *nd, int Slevel) if( df->lab_level) node_error(nd, "label %s already defined", nd->nd_IDF->id_text); else { - register struct lab *labelptr; + struct lab *labelptr; df->lab_level = Slevel; labelptr = df->lab_next; @@ -141,7 +141,7 @@ void DefLabel(register struct node *nd, int Slevel) } } -static void CodeLabel(register struct def *df, int local) +static void CodeLabel(struct def *df, int local) { if( err_occurred ) return; diff --git a/lang/pc/comp/label.h b/lang/pc/comp/label.h index 001865f86f..d61ea179da 100644 --- a/lang/pc/comp/label.h +++ b/lang/pc/comp/label.h @@ -10,8 +10,8 @@ struct node; void DeclLabel(struct node *nd); void chk_labels(int Slevel); -void TstLabel(register struct node *nd, int Slevel); -void DefLabel(register struct node *nd, int Slevel); +void TstLabel(struct node *nd, int Slevel); +void DefLabel(struct node *nd, int Slevel); #endif /* LABEL_H_ */ diff --git a/lang/pc/comp/lookup.c b/lang/pc/comp/lookup.c index f99574aa06..480015f852 100644 --- a/lang/pc/comp/lookup.c +++ b/lang/pc/comp/lookup.c @@ -15,7 +15,7 @@ #include "type.h" #include "lookup.h" -void remove_def(register struct def *df) +void remove_def(struct def *df) { struct idf *id= df->df_idf; struct def *df1 = id->id_def; @@ -28,10 +28,10 @@ void remove_def(register struct def *df) free_def(df); } -struct def *lookup(register struct idf *id, struct scope *scope, long inuse) +struct def *lookup(struct idf *id, struct scope *scope, long inuse) { - register struct def *df, *df1; + struct def *df, *df1; /* Look in the chain of definitions of this "id" for one with scope "scope". @@ -60,11 +60,11 @@ struct def *lookup(register struct idf *id, struct scope *scope, long inuse) } -struct def *lookfor(register struct node *id, struct scopelist *vis, int give_error) +struct def *lookfor(struct node *id, struct scopelist *vis, int give_error) { - register struct def *df, *tmp_df; - register struct scopelist *sc = vis; + struct def *df, *tmp_df; + struct scopelist *sc = vis; while( sc ) { df = lookup(id->nd_IDF, sc->sc_scope, D_INUSE); diff --git a/lang/pc/comp/lookup.h b/lang/pc/comp/lookup.h index 3b3c3eba5e..920a4d088c 100644 --- a/lang/pc/comp/lookup.h +++ b/lang/pc/comp/lookup.h @@ -11,19 +11,19 @@ struct idf; struct scope; struct node; -void remove_def(register struct def *df); +void remove_def(struct def *df); /* Look up a definition of an identifier in scope "scope". Make the "def" list self-organizing. Return a pointer to its "def" structure if it exists, otherwise return NULL. */ -struct def *lookup(register struct idf *id, struct scope *scope, long inuse); +struct def *lookup(struct idf *id, struct scope *scope, long inuse); /* Look for an identifier in the visibility range started by "vis". If it is not defined create a dummy definition and if give_error is set, give an error message. */ -struct def *lookfor(register struct node *id, struct scopelist *vis, int give_error); +struct def *lookfor(struct node *id, struct scopelist *vis, int give_error); #endif /* LOOKUP_H_ */ diff --git a/lang/pc/comp/main.c b/lang/pc/comp/main.c index ebb64edb50..4d23d50b51 100644 --- a/lang/pc/comp/main.c +++ b/lang/pc/comp/main.c @@ -51,10 +51,10 @@ void LexScan(void); void Info(void); #endif -int main(int argc, register char **argv) +int main(int argc, char **argv) { - register int Nargc = 1; - register char **Nargv = &argv[0]; + int Nargc = 1; + char **Nargv = &argv[0]; ProgName = *argv++; @@ -143,7 +143,7 @@ int Compile(char *src, char *dst) #ifdef DEBUG void LexScan(void) { - register struct token *tkp = ˙ + struct token *tkp = ˙ while( LLlex() > 0 ) { @@ -174,7 +174,7 @@ void LexScan(void) void AddRequired(void) { - register struct def *df; + struct def *df; static struct node maxintnode = { 0, 0, Value, 0, { INTEGER, 0 } }; /* PROCEDURES */ diff --git a/lang/pc/comp/misc.c b/lang/pc/comp/misc.c index 9050fc44d8..756a88b433 100644 --- a/lang/pc/comp/misc.c +++ b/lang/pc/comp/misc.c @@ -28,7 +28,7 @@ struct idf *gen_anon_idf(void) return str2idf(s, 0); } -void not_declared(char *what, register struct node *id, char *where) +void not_declared(char *what, struct node *id, char *where) { /* The identifier "id" is not declared. If it is not generated, give an error message @@ -39,7 +39,7 @@ void not_declared(char *what, register struct node *id, char *where) } } -char *gen_proc_name(register struct idf *id, int inp) +char *gen_proc_name(struct idf *id, int inp) { /* generate pseudo and internal name for procedure or function */ diff --git a/lang/pc/comp/misc.h b/lang/pc/comp/misc.h index 7e01de3858..5f3a528807 100644 --- a/lang/pc/comp/misc.h +++ b/lang/pc/comp/misc.h @@ -5,7 +5,7 @@ struct node; #define is_anon_idf(x) ((x)->id_text[0] == '#') #define id_not_declared(x) (not_declared("identifier", (x), "")) -extern char *gen_proc_name(register struct idf *id, int inp); +extern char *gen_proc_name(struct idf *id, int inp); extern struct idf *gen_anon_idf(void); -extern void not_declared(char *what, register struct node *id, char *where); +extern void not_declared(char *what, struct node *id, char *where); diff --git a/lang/pc/comp/node.c b/lang/pc/comp/node.c index 447cd29141..069688fc47 100644 --- a/lang/pc/comp/node.c +++ b/lang/pc/comp/node.c @@ -17,7 +17,7 @@ struct node *MkNode(int class, struct node *left, struct node *right, struct tok { /* Create a node and initialize it with the given parameters */ - register struct node *nd = new_node(); + struct node *nd = new_node(); nd->nd_left = left; nd->nd_right = right; @@ -29,7 +29,7 @@ struct node *MkNode(int class, struct node *left, struct node *right, struct tok struct node *MkLeaf(int class, struct token *token) { - register struct node *nd = new_node(); + struct node *nd = new_node(); nd->nd_left = nd->nd_right = NULLNODE; nd->nd_token = *token; @@ -38,7 +38,7 @@ struct node *MkLeaf(int class, struct token *token) return nd; } -void FreeNode(register struct node *nd) +void FreeNode(struct node *nd) { /* Put nodes that are no longer needed back onto the free list */ @@ -63,7 +63,7 @@ void indnt(int lvl) print(" "); } -void printnode(register struct node *nd, int lvl) +void printnode(struct node *nd, int lvl) { indnt(lvl); print("Class: %d; Symbol: %s\n", nd->nd_class, symbol2str(nd->nd_symb)); @@ -75,7 +75,7 @@ void printnode(register struct node *nd, int lvl) } } -void PrNode(register struct node *nd, int lvl) +void PrNode(struct node *nd, int lvl) { if( !nd ) { indnt(lvl); print("\n"); diff --git a/lang/pc/comp/node.xh b/lang/pc/comp/node.xh index ee7764a5b1..6b9e926d40 100644 --- a/lang/pc/comp/node.xh +++ b/lang/pc/comp/node.xh @@ -51,7 +51,7 @@ struct node { struct node *MkNode(int class, struct node *left, struct node *right, struct token *token); struct node *MkLeaf(int class, struct token *token); -void FreeNode(register struct node *nd); +void FreeNode(struct node *nd); int NodeCrash(struct node *expp); diff --git a/lang/pc/comp/options.c b/lang/pc/comp/options.c index c88aa8a7f7..ce372023e5 100644 --- a/lang/pc/comp/options.c +++ b/lang/pc/comp/options.c @@ -25,13 +25,13 @@ recognize some keywords! extern int idfsize; -static int txt2int(register char **tp) +static int txt2int(char **tp) { /* the integer pointed to by *tp is read, while increasing *tp; the resulting value is yielded. */ - register int val = 0; - register int ch; + int val = 0; + int ch; while( ch = **tp, ch >= '0' && ch <= '9' ) { val = val * 10 + ch - '0'; @@ -40,7 +40,7 @@ static int txt2int(register char **tp) return val; } -void DoOption(register char *text) +void DoOption(char *text) { switch( *text++ ) { @@ -104,8 +104,8 @@ void DoOption(register char *text) case 'V' : { /* set object sizes and alignment requirements */ /* syntax : -V[ [w|i|l|f|p] size? [.alignment]? ]* */ #ifndef NOCROSS - register arith size; - register int align; + arith size; + int align; char c, *t; while( (c = *text++) !=0 ) { diff --git a/lang/pc/comp/options.h b/lang/pc/comp/options.h index b02dddc302..5ba407c936 100644 --- a/lang/pc/comp/options.h +++ b/lang/pc/comp/options.h @@ -7,6 +7,6 @@ #define OPTIONS_H_ /* Parse command line options */ -void DoOption(register char *text); +void DoOption(char *text); #endif /* OPTIONS_H_ */ diff --git a/lang/pc/comp/program.g b/lang/pc/comp/program.g index 743a6b375c..1d17a780ab 100644 --- a/lang/pc/comp/program.g +++ b/lang/pc/comp/program.g @@ -53,7 +53,7 @@ Program Module(df, &dummy) ; -ProgramHeading(register struct def **df;): +ProgramHeading(struct def **df;): PROGRAM IDENT { program = *df = new_def(); (*df)->df_idf = dot.TOK_IDF; diff --git a/lang/pc/comp/progs.c b/lang/pc/comp/progs.c index c953e89ee5..0f0dcc6fa1 100644 --- a/lang/pc/comp/progs.c +++ b/lang/pc/comp/progs.c @@ -16,7 +16,7 @@ static int inpflag = 0; /* input mentioned in heading ? */ static int outpflag = 0; /* output mentioned in heading ? */ static label extfl_label; /* label of array of file pointers */ -static void make_extfl_args(register struct def *df); +static void make_extfl_args(struct def *df); void set_inp(void) { @@ -57,7 +57,7 @@ void make_extfl(void) make_extfl_args( GlobalScope->sc_def ); } -static void make_extfl_args(register struct def *df) +static void make_extfl_args(struct def *df) { if( !df ) return; make_extfl_args(df->df_nextinscope); diff --git a/lang/pc/comp/readwrite.c b/lang/pc/comp/readwrite.c index a704943914..706c08c5e6 100644 --- a/lang/pc/comp/readwrite.c +++ b/lang/pc/comp/readwrite.c @@ -30,13 +30,13 @@ /* Internal function prototypes */ static int ChkWriteParameter(struct type *, struct node *, char *); -static void CodeRead(register struct node *, register struct node *); -static void CodeRead(register struct node *, register struct node *); +static void CodeRead(struct node *, struct node *); +static void CodeRead(struct node *, struct node *); static void CodeReadln(struct node *); -static void CodeWrite(register struct node *, register struct node *); -static void CodeWriteln(register struct node *); +static void CodeWrite(struct node *, struct node *); +static void CodeWriteln(struct node *); -void ChkRead(register struct node *arg) +void ChkRead(struct node *arg) { struct node *file; char *name = "read"; @@ -102,7 +102,7 @@ void ChkRead(register struct node *arg) } } -void ChkReadln(register struct node *arg) +void ChkReadln(struct node *arg) { struct node *file; char *name = "readln"; @@ -157,7 +157,7 @@ void ChkReadln(register struct node *arg) CodeReadln(file); } -void ChkWrite(register struct node *arg) +void ChkWrite(struct node *arg) { struct node *left, *expp, *file; char *name = "write"; @@ -197,7 +197,7 @@ void ChkWrite(register struct node *arg) } } -void ChkWriteln(register struct node *arg) +void ChkWriteln(struct node *arg) { struct node *left, *expp, *file; char *name = "writeln"; @@ -308,8 +308,8 @@ static int ChkWriteParameter(struct type *filetype, struct node *arg, char *name struct node *ChkStdInOut(char *name, int st_out) { - register struct def *df; - register struct node *nd; + struct def *df; + struct node *nd; if( !(df = lookup(str2idf(st_out ? output : input, 0), GlobalScope, D_INUSE)) || @@ -326,7 +326,7 @@ struct node *ChkStdInOut(char *name, int st_out) return nd; } -static void CodeRead(register struct node *file, register struct node *arg) +static void CodeRead(struct node *file, struct node *arg) { struct type *tp = BaseType(arg->nd_type); @@ -392,11 +392,11 @@ static void CodeReadln(struct node *file) C_asp(pointer_size); } -static void CodeWrite(register struct node *file, register struct node *arg) +static void CodeWrite(struct node *file, struct node *arg) { int width = 0; - register arith nbpars = pointer_size; - register struct node *expp = arg->nd_left; + arith nbpars = pointer_size; + struct node *expp = arg->nd_left; struct node *right = arg->nd_right; struct type *tp = BaseType(expp->nd_type); @@ -477,7 +477,7 @@ static void CodeWrite(register struct node *file, register struct node *arg) } } -static void CodeWriteln(register struct node *file) +static void CodeWriteln(struct node *file) { if( err_occurred ) return; diff --git a/lang/pc/comp/readwrite.h b/lang/pc/comp/readwrite.h index 23dec6c057..d976491d70 100644 --- a/lang/pc/comp/readwrite.h +++ b/lang/pc/comp/readwrite.h @@ -10,9 +10,9 @@ struct node; struct node *ChkStdInOut(char *name, int st_out); -void ChkRead(register struct node *arg); -void ChkReadln(register struct node *arg); -void ChkWrite(register struct node *arg); -void ChkWriteln(register struct node *arg); +void ChkRead(struct node *arg); +void ChkReadln(struct node *arg); +void ChkWrite(struct node *arg); +void ChkWriteln(struct node *arg); #endif /* READWRITE_H_ */ diff --git a/lang/pc/comp/scope.c b/lang/pc/comp/scope.c index b0995e8cca..e7040ecf3a 100644 --- a/lang/pc/comp/scope.c +++ b/lang/pc/comp/scope.c @@ -25,8 +25,8 @@ static int sccount; void InitScope(void) { - register struct scope *sc = new_scope(); - register struct scopelist *ls = new_scopelist(); + struct scope *sc = new_scope(); + struct scopelist *ls = new_scopelist(); sc->sc_level = proclevel; PervasiveScope = sc; @@ -37,8 +37,8 @@ void InitScope(void) void open_scope(void) { - register struct scope *sc = new_scope(); - register struct scopelist *ls = new_scopelist(); + struct scope *sc = new_scope(); + struct scopelist *ls = new_scopelist(); sc->sc_level = proclevel; ls->sc_scope = sc; @@ -52,7 +52,7 @@ void close_scope(int doclean) /* When this procedure is called, the next visible scope is equal to the statically enclosing scope */ - register struct def *df; + struct def *df; assert(CurrentScope != 0); df = CurrentScope->sc_def; @@ -64,13 +64,13 @@ void close_scope(int doclean) CurrVis = CurrVis->next; } -void Forward(register struct node *nd, register struct type *tp) +void Forward(struct node *nd, struct type *tp) { /* Enter a forward reference into the current scope. This is * used in pointertypes. */ - register struct def *df = define(nd->nd_IDF, CurrentScope, D_FORWTYPE); - register struct forwtype *fw_type = new_forwtype(); + struct def *df = define(nd->nd_IDF, CurrentScope, D_FORWTYPE); + struct forwtype *fw_type = new_forwtype(); fw_type->f_next = df->df_fortype; df->df_fortype = fw_type; @@ -82,7 +82,7 @@ void Forward(register struct node *nd, register struct type *tp) void chk_prog_params(void) { /* the program parameters must be global variables of some file type */ - register struct def *df = CurrentScope->sc_def; + struct def *df = CurrentScope->sc_def; while( df ) { if( df->df_kind & D_PARAMETER ) { @@ -105,7 +105,7 @@ void chk_prog_params(void) void chk_directives(void) { /* check if all forward declarations are defined */ - register struct def *df = CurrentScope->sc_def; + struct def *df = CurrentScope->sc_def; while( df ) { if( df->df_kind == D_FWPROCEDURE ) diff --git a/lang/pc/comp/scope.xh b/lang/pc/comp/scope.xh index 948361ed5d..b27f5a015b 100644 --- a/lang/pc/comp/scope.xh +++ b/lang/pc/comp/scope.xh @@ -37,7 +37,7 @@ extern struct scopelist void InitScope(void); void open_scope(void); void close_scope(int doclean); -void Forward(register struct node *nd, register struct type *tp); +void Forward(struct node *nd, register struct type *tp); void chk_prog_params(void); void chk_directives(void); diff --git a/lang/pc/comp/stab.c b/lang/pc/comp/stab.c index 6f82a0947b..ce4d8c9c0f 100644 --- a/lang/pc/comp/stab.c +++ b/lang/pc/comp/stab.c @@ -65,7 +65,7 @@ static void adds_db_str(char *s) while (*s) addc_db_str(*s++); } -static void stb_type(register struct type *tp, int assign_num) +static void stb_type(struct type *tp, int assign_num) { char buf[128]; static int stb_count; @@ -155,7 +155,7 @@ static void stb_type(register struct type *tp, int assign_num) case T_ENUMERATION: addc_db_str('e'); { - register struct def *edef = tp->enm_enums; + struct def *edef = tp->enm_enums; while (edef) { adds_db_str(sprint(buf, "%s:%ld,", @@ -169,7 +169,7 @@ static void stb_type(register struct type *tp, int assign_num) case T_RECORD: adds_db_str(sprint(buf, "s%ld", (long) tp->tp_size)); { - register struct def *sdef = tp->rec_scope->sc_def; + struct def *sdef = tp->rec_scope->sc_def; while (sdef) { adds_db_str(sdef->df_idf->id_text); @@ -189,7 +189,7 @@ static void stb_type(register struct type *tp, int assign_num) addc_db_str('Q'); stb_type(tp->next ? tp->next : void_type, 0); { - register struct paramlist *p = tp->prc_params; + struct paramlist *p = tp->prc_params; int paramcount = 0; while (p) { @@ -237,9 +237,9 @@ void stb_addtp(char *s, struct type *tp) (arith) 0); } -void stb_string(register struct def *df, long kind) +void stb_string(struct def *df, long kind) { - register struct type *tp = df->df_type; + struct type *tp = df->df_type; char buf[64]; create_db_str(); @@ -258,7 +258,7 @@ void stb_string(register struct def *df, long kind) addc_db_str(';'); C_ms_stb_pnam(db_str.base, N_FUN, proclevel, df->df_idf->id_text); { - register struct paramlist *p = tp->prc_params; + struct paramlist *p = tp->prc_params; while (p) { stb_string(p->par_def, D_VARIABLE); p = p->next; @@ -343,7 +343,7 @@ void stb_string(register struct def *df, long kind) addc_db_str(';'); break; case T_STRINGCONST: { - register char *p = df->con_const->nd_STR; + char *p = df->con_const->nd_STR; adds_db_str("s'"); while (*p) { @@ -361,7 +361,7 @@ void stb_string(register struct def *df, long kind) adds_db_str(sprint(buf, ",%ld;", (long) df->con_const->nd_INT)); break; case T_SET: { - register int i; + int i; addc_db_str('S'); stb_type(tp, 0); diff --git a/lang/pc/comp/stab.h b/lang/pc/comp/stab.h index 50d817f69e..52c9328fc5 100644 --- a/lang/pc/comp/stab.h +++ b/lang/pc/comp/stab.h @@ -11,7 +11,7 @@ struct def; struct type; -void stb_string(register struct def *df, long kind); +void stb_string(struct def *df, long kind); void stb_addtp(char *s, struct type *tp); #endif /* STAB_H_ */ diff --git a/lang/pc/comp/statement.g b/lang/pc/comp/statement.g index 8e747b62b7..7f2eef18f5 100644 --- a/lang/pc/comp/statement.g +++ b/lang/pc/comp/statement.g @@ -208,7 +208,7 @@ WithStatement } ; -RecordVariableList(register struct node **pnd;) +RecordVariableList(struct node **pnd;) { struct node *nd; } : @@ -224,7 +224,7 @@ RecordVariableList(register struct node **pnd;) ]* ; -RecordVariable(register struct node **pnd;): +RecordVariable(struct node **pnd;): VariableAccess(pnd) { WithStat(*pnd); } ; @@ -286,7 +286,7 @@ CaseStatement { CaseEnd(casend, exit_label); } ; -CaseListElementTail(register struct node **pnd; label exit_label;): +CaseListElementTail(struct node **pnd; label exit_label;): /* This is a new rule, all because of a silly semicolon */ /* empty */ @@ -301,7 +301,7 @@ CaseListElementTail(register struct node **pnd; label exit_label;): ] ; -CaseListElement(register struct node **pnd; label exit_label;): +CaseListElement(struct node **pnd; label exit_label;): CaseConstantList(pnd) ':' { *pnd = MkNode(Link, *pnd, NULLNODE, &dot); @@ -400,7 +400,7 @@ ForStatement /* SPECIALSPECIALSPECIALSPECIALSPECIALSPECIALSPECIALSPECIALSPECIALSPECIAL */ /* ISO section 6.9, p. 132-136 */ -ReadParameterList(register struct node **pnd;) +ReadParameterList(struct node **pnd;) { register struct node *nd; } : @@ -422,7 +422,7 @@ ReadParameterList(register struct node **pnd;) ')' ; -WriteParameterList(register struct node **pnd;) +WriteParameterList(struct node **pnd;) { register struct node *nd; } : @@ -446,7 +446,7 @@ WriteParameterList(register struct node **pnd;) ')' ; -WriteParameter(register struct node **pnd;) +WriteParameter(struct node **pnd;) { register struct node *nd; } : diff --git a/lang/pc/comp/tokenname.c b/lang/pc/comp/tokenname.c index e59c29b84c..2310059a8d 100644 --- a/lang/pc/comp/tokenname.c +++ b/lang/pc/comp/tokenname.c @@ -86,12 +86,12 @@ struct tokenname tkstandard[] = { /* standard identifiers */ /* Some routines to handle tokennames */ -void reserve(register struct tokenname *resv) +void reserve(struct tokenname *resv) { /* The names of the tokens described in resv are entered as reserved words. */ - register struct idf *p; + struct idf *p; while( resv->tn_symbol ) { p = str2idf(resv->tn_name, 0); diff --git a/lang/pc/comp/tokenname.h b/lang/pc/comp/tokenname.h index 082fae82e5..6a1644f718 100644 --- a/lang/pc/comp/tokenname.h +++ b/lang/pc/comp/tokenname.h @@ -8,4 +8,4 @@ struct tokenname { /* Used for defining the name of a }; -void reserve(register struct tokenname *resv); +void reserve(struct tokenname *resv); diff --git a/lang/pc/comp/type.c b/lang/pc/comp/type.c index 8097ebbaa7..e44a1ef7b2 100644 --- a/lang/pc/comp/type.c +++ b/lang/pc/comp/type.c @@ -60,8 +60,8 @@ struct type /* Local forward declarations */ -static arith ArrayElSize(register struct type *, int); -static void FreeForward(register struct forwtype *); +static arith ArrayElSize(struct type *, int); +static void FreeForward(struct forwtype *); static int gcd(int, int); @@ -164,7 +164,7 @@ static int fit(arith sz, int nbytes) struct type *standard_type(int fund, int algn, arith size) { - register struct type *tp = new_type(); + struct type *tp = new_type(); tp->tp_fund = fund; tp->tp_palign = algn ? algn : 1; @@ -175,12 +175,12 @@ struct type *standard_type(int fund, int algn, arith size) return tp; } -struct type *construct_type(int fund, register struct type *tp) +struct type *construct_type(int fund, struct type *tp) { /* fund must be a type constructor. * The pointer to the constructed type is returned. */ - register struct type *dtp = new_type(); + struct type *dtp = new_type(); switch( dtp->tp_fund = fund ) { case T_PROCEDURE: @@ -221,7 +221,7 @@ struct type *construct_type(int fund, register struct type *tp) struct type *proc_type(struct paramlist *parameters, arith n_bytes_params) { - register struct type *tp = construct_type(T_PROCEDURE, NULLTYPE); + struct type *tp = construct_type(T_PROCEDURE, NULLTYPE); tp->prc_params = parameters; tp->prc_nbpar = n_bytes_params; @@ -230,16 +230,16 @@ struct type *proc_type(struct paramlist *parameters, arith n_bytes_params) struct type *func_type(struct paramlist * parameters, arith n_bytes_params, struct type *resulttype) { - register struct type *tp = construct_type(T_FUNCTION, resulttype); + struct type *tp = construct_type(T_FUNCTION, resulttype); tp->prc_params = parameters; tp->prc_nbpar = n_bytes_params; return tp; } -void chk_type_id(register struct type **ptp, register struct node *nd) +void chk_type_id(struct type **ptp, struct node *nd) { - register struct def *df; + struct def *df; *ptp = error_type; if( ChkLinkOrName(nd) ) { @@ -264,13 +264,13 @@ void chk_type_id(register struct type **ptp, register struct node *nd) } } -struct type *subr_type(register struct node *lb, register struct node *ub) +struct type *subr_type(struct node *lb, struct node *ub) { /* Construct a subrange type from the constant expressions indicated by "lb" and "ub", but first perform some checks */ - register struct type *tp = lb->nd_type, *res; + struct type *tp = lb->nd_type, *res; if( !TstTypeEquiv(lb->nd_type, ub->nd_type) ) { node_error(ub, "types of subrange bounds not equal"); @@ -318,7 +318,7 @@ struct type *subr_type(register struct node *lb, register struct node *ub) return res; } -void getbounds(register struct type *tp, arith *plo, arith *phi) +void getbounds(struct type *tp, arith *plo, arith *phi) { /* Get the bounds of a bounded type */ @@ -339,7 +339,7 @@ void getbounds(register struct type *tp, arith *plo, arith *phi) } } -struct type *set_type(register struct type *tp, unsigned short packed) +struct type *set_type(struct type *tp, unsigned short packed) { /* Construct a set type with base type "tp", but first perform some checks @@ -406,13 +406,13 @@ struct type *set_type(register struct type *tp, unsigned short packed) return tp; } -static arith ArrayElSize(register struct type *tp, int packed) +static arith ArrayElSize(struct type *tp, int packed) { /* Align element size to alignment requirement of element type. Also make sure that its size is either a dividor of the word_size, or a multiple of it. */ - register arith algn; + arith algn; if( tp->tp_fund & T_ARRAY && !(tp->tp_flags & T_CHECKED) ) ArraySizes(tp); @@ -433,12 +433,12 @@ static arith ArrayElSize(register struct type *tp, int packed) return algn; } -void ArraySizes(register struct type *tp) +void ArraySizes(struct type *tp) { /* Assign sizes to an array type, and check index type */ - register struct type *index_type = IndexType(tp); - register struct type *elem_type = tp->arr_elem; + struct type *index_type = IndexType(tp); + struct type *elem_type = tp->arr_elem; arith lo, hi, diff; tp->tp_flags |= T_CHECKED; @@ -479,7 +479,7 @@ void ArraySizes(register struct type *tp) C_rom_cst(tp->arr_elsize); } -static void FreeForward(register struct forwtype *for_type) +static void FreeForward(struct forwtype *for_type) { if( !for_type ) return; @@ -492,17 +492,17 @@ void chk_forw_types(void) { /* check all forward references (in pointer types) */ - register struct def *df = CurrentScope->sc_def; - register struct def *ldf = NULL; + struct def *df = CurrentScope->sc_def; + struct def *ldf = NULL; struct type *tp; while( df ) { if( df->df_kind & (D_FORWTYPE | D_FTYPE) ) { - register struct forwtype *fw_type = df->df_fortype; + struct forwtype *fw_type = df->df_fortype; if( df->df_kind == D_FORWTYPE ) { /* forward type not in this scope declared */ - register struct scopelist *scl = nextvisible(CurrVis); + struct scopelist *scl = nextvisible(CurrVis); struct def *df1 = 0; while( scl ) { @@ -559,8 +559,8 @@ void chk_forw_types(void) } } -void TstCaseConstants(register struct node *nd, register struct selector *sel, - register struct selector *sel1) +void TstCaseConstants(struct node *nd, struct selector *sel, + struct selector *sel1) { /* Insert selector of nested variant (sel1) in tagvalue-table of current selector (sel). @@ -594,7 +594,7 @@ static int gcd(int m, int n) { /* Greatest Common Divisor */ - register int r; + int r; while( n ) { r = m % n; @@ -612,7 +612,7 @@ int lcm(int m, int n) } #ifdef DEBUG -void DumpType(register struct type *tp) +void DumpType(struct type *tp) { if( !tp ) return; @@ -635,7 +635,7 @@ void DumpType(register struct type *tp) case T_PROCEDURE: case T_FUNCTION: { - register struct paramlist *par = ParamList(tp); + struct paramlist *par = ParamList(tp); if( tp->tp_fund == T_PROCEDURE ) print("PROCEDURE"); diff --git a/lang/pc/comp/type.xh b/lang/pc/comp/type.xh index dfb3117500..8703baf9bd 100644 --- a/lang/pc/comp/type.xh +++ b/lang/pc/comp/type.xh @@ -200,26 +200,26 @@ struct type *construct_type(int fund, register struct type *tp); struct type *proc_type(struct paramlist *parameters, arith n_bytes_params); /* Constructs a new function type with the specified parameters and result type. */ struct type *func_type(struct paramlist * parameters, arith n_bytes_params, struct type *resulttype); -void chk_type_id(register struct type **ptp, register struct node *nd); +void chk_type_id(struct type **ptp, register struct node *nd); /* Construct a new subrange type from a lower bound "lb" to an upper bound "ub" */ -struct type *subr_type(register struct node *lb, register struct node *ub); +struct type *subr_type(struct node *lb, register struct node *ub); /* Return the bounds of the specified type "tp", assert if this is not a bounded type. */ -void getbounds(register struct type *tp, arith *plo, arith *phi); +void getbounds(struct type *tp, arith *plo, arith *phi); /* Construct a new set type. */ -struct type *set_type(register struct type *tp, unsigned short packed); +struct type *set_type(struct type *tp, unsigned short packed); /* Assign sizes to an array type, and check index type and generate array descriptor */ -void ArraySizes(register struct type *tp); +void ArraySizes(struct type *tp); /* Check all forward declaration */ void chk_forw_types(void); /* Insert selector of nested variant (sel1) in tagvalue-table of current selector (sel). */ -void TstCaseConstants(register struct node *nd, register struct selector *sel, +void TstCaseConstants(struct node *nd, register struct selector *sel, register struct selector *sel1); /* Return the "pos" aligned to "al". */ arith align(arith pos, int al); /* Print type information for "tp". */ -void DumpType(register struct type *tp); +void DumpType(struct type *tp); /* Least Common Multiple */ int lcm(int m, int n); diff --git a/lang/pc/comp/typequiv.c b/lang/pc/comp/typequiv.c index 5f02a6b380..4f5518ffd3 100644 --- a/lang/pc/comp/typequiv.c +++ b/lang/pc/comp/typequiv.c @@ -17,14 +17,14 @@ #include "error.h" #include "typequiv.h" -int TstTypeEquiv(register struct type *tp1, register struct type *tp2) +int TstTypeEquiv(struct type *tp1, struct type *tp2) { /* test if two types are equivalent. */ return tp1 == tp2 || tp1 == error_type || tp2 == error_type; } -arith IsString(register struct type *tp) +arith IsString(struct type *tp) { /* string = packed array[1..ub] of char and ub > 1 */ if( tp->tp_fund & T_STRINGCONST ) return tp->tp_psize; @@ -42,7 +42,7 @@ arith IsString(register struct type *tp) return (arith) 0; } -int TstStrCompat(register struct type *tp1, register struct type *tp2) +int TstStrCompat(struct type *tp1, struct type *tp2) { /* test if two types are compatible string-types. */ @@ -57,7 +57,7 @@ int TstStrCompat(register struct type *tp1, register struct type *tp2) return ub1 == ub2; } -int TstCompat(register struct type *tp1,register struct type *tp2) +int TstCompat(struct type *tp1, struct type *tp2) { /* test if two types are compatible. ISO 6.4.5 */ @@ -103,7 +103,7 @@ int TstCompat(register struct type *tp1,register struct type *tp2) return tp1 == tp2; } -int TstAssCompat(register struct type *tp1,register struct type *tp2) +int TstAssCompat(struct type *tp1, struct type *tp2) { /* test if two types are assignment compatible. ISO 6.4.6 */ @@ -119,7 +119,7 @@ int TstAssCompat(register struct type *tp1,register struct type *tp2) return 0; } -int TstParEquiv(register struct type *tp1, register struct type *tp2) +int TstParEquiv(struct type *tp1, struct type *tp2) { /* Test if two parameter types are equivalent. ISO 6.6.3.6 */ @@ -148,11 +148,11 @@ int TstParEquiv(register struct type *tp1, register struct type *tp2) ); } -int TstProcEquiv(register struct type *tp1, register struct type *tp2) +int TstProcEquiv(struct type *tp1, struct type *tp2) { /* Test if two procedure types are equivalent. ISO 6.6.3.6 */ - register struct paramlist *p1, *p2; + struct paramlist *p1, *p2; /* First check if the result types are equivalent */ @@ -177,7 +177,7 @@ int TstProcEquiv(register struct type *tp1, register struct type *tp2) return p1 == p2; } -int TstParCompat(register struct type *formaltype, register struct type *actualtype, +int TstParCompat(struct type *formaltype, struct type *actualtype, int VARflag, struct node *nd, int new_par_section) { /* Check type compatibility for a parameter in a procedure call. @@ -216,7 +216,7 @@ int TstParCompat(register struct type *formaltype, register struct type *actualt else return 0; } -int TstConform(register struct type *formaltype, register struct type * actualtype, int new_par_section) +int TstConform(struct type *formaltype, struct type * actualtype, int new_par_section) { /* Check conformability. diff --git a/lang/pc/comp/typequiv.h b/lang/pc/comp/typequiv.h index 9235511301..433abe015b 100644 --- a/lang/pc/comp/typequiv.h +++ b/lang/pc/comp/typequiv.h @@ -13,20 +13,20 @@ struct type; struct node; /* test if two types are equivalent. */ -int TstTypeEquiv(register struct type *tp1, register struct type *tp2); -arith IsString(register struct type *tp); +int TstTypeEquiv(struct type *tp1, struct type *tp2); +arith IsString(struct type *tp); /* test if two types are compatible string-types. */ -int TstStrCompat(register struct type *tp1, register struct type *tp2); +int TstStrCompat(struct type *tp1, struct type *tp2); /* test if two types are compatible. ISO 6.4.5 */ -int TstCompat(register struct type *tp1,register struct type *tp2); +int TstCompat(struct type *tp1, struct type *tp2); /* test if two types are assignment compatible. ISO 6.4.6 */ -int TstAssCompat(register struct type *tp1,register struct type *tp2); +int TstAssCompat(struct type *tp1, struct type *tp2); /* Test if two parameter types are equivalent. ISO 6.6.3.6 */ -int TstParEquiv(register struct type *tp1, register struct type *tp2); +int TstParEquiv(struct type *tp1, struct type *tp2); /* Test if two procedure types are equivalent. ISO 6.6.3.6 */ -int TstProcEquiv(register struct type *tp1, register struct type *tp2); +int TstProcEquiv(struct type *tp1, struct type *tp2); /* Check type compatibility for a parameter in a procedure call. */ -int TstParCompat(register struct type *formaltype, register struct type *actualtype, +int TstParCompat(struct type *formaltype, struct type *actualtype, int VARflag, struct node *nd, int new_par_section); /* Check conformability. @@ -36,7 +36,7 @@ int TstParCompat(register struct type *formaltype, register struct type *actualt Do as much checking on indextypes as possible. */ -int TstConform(register struct type *formaltype, register struct type * actualtype, int new_par_section); +int TstConform(struct type *formaltype, struct type * actualtype, int new_par_section); #endif /* TYPEQUIV_H_ */ diff --git a/lang/pc/libpc/catch.c b/lang/pc/libpc/catch.c index 4221f98912..83dda7beea 100644 --- a/lang/pc/libpc/catch.c +++ b/lang/pc/libpc/catch.c @@ -82,7 +82,7 @@ static struct errm void _catch(unsigned int erno) { - register struct errm* ep = &errors[0]; + struct errm* ep = &errors[0]; char *p, *q, *s, **qq; char buf[20]; unsigned i; diff --git a/lang/pc/libpc/cvt.c b/lang/pc/libpc/cvt.c index 2481a0f868..4372e9118d 100644 --- a/lang/pc/libpc/cvt.c +++ b/lang/pc/libpc/cvt.c @@ -42,8 +42,8 @@ static struct powers_of_10 static char* cvt(double value, int ndigit, int* decpt, int* sign, int ecvtflag) { static char buf[NDIGITS + 1]; - register char* p = buf; - register char* pe; + char* p = buf; + char* pe; if (ndigit < 0) ndigit = 0; @@ -66,7 +66,7 @@ static char* cvt(double value, int ndigit, int* decpt, int* sign, int ecvtflag) } if (value != 0.0) { - register struct powers_of_10* pp = &p10[0]; + struct powers_of_10* pp = &p10[0]; if (value >= 10.0) do diff --git a/lib/minix/include/minix/const.h b/lib/minix/include/minix/const.h index 77fc6fe42c..7e8176fb65 100644 --- a/lib/minix/include/minix/const.h +++ b/lib/minix/include/minix/const.h @@ -5,8 +5,8 @@ */ #define EXTERN extern /* used in *.h files */ -#define PRIVATE static /* PRIVATE x limits the scope of x */ -#define PUBLIC /* PUBLIC is the opposite of PRIVATE */ +#define static static /* static x limits the scope of x */ +#define PUBLIC /* PUBLIC is the opposite of static */ #define FORWARD static /* some compilers require this to be 'static'*/ #define TRUE 1 /* used for turning integers into Booleans */ diff --git a/mach/6500/as/mach1.c b/mach/6500/as/mach1.c index cef0ab8d2a..c50f066af0 100644 --- a/mach/6500/as/mach1.c +++ b/mach/6500/as/mach1.c @@ -10,5 +10,5 @@ #define fits_zeropage(x) (lowb(x) == (int)(x)) -void branch(register int opc, expr_t exp); -void code(expr_t exp, register int opc1, register int opc2); +void branch(int opc, expr_t exp); +void code(expr_t exp, int opc1, int opc2); diff --git a/mach/6500/as/mach5.c b/mach/6500/as/mach5.c index 53e1212143..f47b83951a 100644 --- a/mach/6500/as/mach5.c +++ b/mach/6500/as/mach5.c @@ -8,9 +8,9 @@ * Mostek 6500 special routines. */ -void branch(register int opc, expr_t exp) +void branch(int opc, expr_t exp) { - register int dist; + int dist; dist = exp.val - (DOTVAL + 2); if (pass == PASS_2 && dist > 0 && !(exp.typ & S_DOT)) @@ -27,7 +27,7 @@ void branch(register int opc, expr_t exp) } } -void code(expr_t exp, register int opc1, register int opc2) +void code(expr_t exp, int opc1, int opc2) { if (small((exp.typ & S_TYP) == S_ABS && fits_zeropage(exp.val), 1)) { emit1(opc1); emit1(exp.val); diff --git a/mach/6500/cg/mach.c b/mach/6500/cg/mach.c index b89241d146..e4003cdf19 100644 --- a/mach/6500/cg/mach.c +++ b/mach/6500/cg/mach.c @@ -3,7 +3,7 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ -void con_part(register int sz, word w) +void con_part(int sz, word w) { while (part_size % sz) part_size++; diff --git a/mach/6500/cg/mach.h b/mach/6500/cg/mach.h index c736ffd054..c64ef3312d 100644 --- a/mach/6500/cg/mach.h +++ b/mach/6500/cg/mach.h @@ -35,7 +35,7 @@ void con_float(void); void con_mult(word sz); -void con_part(register int sz, word w); +void con_part(int sz, word w); void mes(word type); void prolog(full nlocals); diff --git a/mach/6500/dl/dl.c b/mach/6500/dl/dl.c index 43eb8247cd..9c5489a835 100644 --- a/mach/6500/dl/dl.c +++ b/mach/6500/dl/dl.c @@ -32,7 +32,7 @@ struct outsect sect[MAXSECT]; main(argc,argv) char **argv; { int i,nd,pc,first; - register char *s; + char *s; progname = argv[0]; @@ -58,7 +58,7 @@ main(argc,argv) char **argv; { pc = sect[i].os_base; while (sect[i].os_size) { unsigned int sz = 8096, fl; - register char *buf; + char *buf; char *pbuf; if (sz > sect[i].os_size) sz = sect[i].os_size; @@ -92,7 +92,7 @@ main(argc,argv) char **argv; { } data(nd,pc, buf) - register char *buf; + char *buf; { newline(nd,pc,DATTYPE); @@ -155,7 +155,7 @@ put(c) } reply() { - register i; + i; char c; if (echo == 0) diff --git a/mach/6800/as/mach1.c b/mach/6800/as/mach1.c index 90e90b0314..6fe38953c4 100644 --- a/mach/6800/as/mach1.c +++ b/mach/6800/as/mach1.c @@ -8,5 +8,5 @@ * Motorola 6800 C declarations */ -void branch(register int opc, expr_t exp); +void branch(int opc, expr_t exp); diff --git a/mach/6800/as/mach5.c b/mach/6800/as/mach5.c index e14f7d098f..053ed28428 100644 --- a/mach/6800/as/mach5.c +++ b/mach/6800/as/mach5.c @@ -8,9 +8,9 @@ * Motorola 6800 special routines */ -void branch(register int opc,expr_t exp) +void branch(int opc,expr_t exp) { - register int sm, dist; + int sm, dist; int saving; dist = exp.val - (DOTVAL + 2); diff --git a/mach/6805/as/mach1.c b/mach/6805/as/mach1.c index 2a5893ea88..428b54918b 100644 --- a/mach/6805/as/mach1.c +++ b/mach/6805/as/mach1.c @@ -12,4 +12,4 @@ extern int opt_cmos; #define fitj(z) ((unsigned)z + 0x80 <= 0xFF) -void branch(register int opc,expr_t exp,expr_t cell); +void branch(int opc,expr_t exp,expr_t cell); diff --git a/mach/6805/as/mach5.c b/mach/6805/as/mach5.c index 223bdbf3dd..79af96a1d9 100644 --- a/mach/6805/as/mach5.c +++ b/mach/6805/as/mach5.c @@ -9,9 +9,9 @@ */ /* VARARGS2 */ -void branch(register int opc,expr_t exp,expr_t cell) +void branch(int opc,expr_t exp,expr_t cell) { - register int sm, dist; + int sm, dist; int saving; dist = exp.val - (DOTVAL + 2); diff --git a/mach/6809/as/mach1.c b/mach/6809/as/mach1.c index 12200b55a6..51990969de 100644 --- a/mach/6809/as/mach1.c +++ b/mach/6809/as/mach1.c @@ -45,7 +45,7 @@ int regbit[] = { /* push-pull coding */ /* Motorola 6809 specific routines */ -void branch(register int opc, expr_t exp); -int regno(register int r); +void branch(int opc, expr_t exp); +int regno(int r); void emit1or2(int n); -void offset(register int reg, expr_t exp, register int ind); +void offset(int reg, expr_t exp, int ind); diff --git a/mach/6809/as/mach5.c b/mach/6809/as/mach5.c index 58d80a6deb..450c99fadd 100644 --- a/mach/6809/as/mach5.c +++ b/mach/6809/as/mach5.c @@ -8,9 +8,9 @@ * Motorola 6809 special routines */ -void branch(register int opc, expr_t exp) +void branch(int opc, expr_t exp) { - register int sm, dist; + int sm, dist; int saving; dist = exp.val - (DOTVAL + 2); @@ -45,7 +45,7 @@ void branch(register int opc, expr_t exp) emit1(lowb(dist)); } -int regno(register int r) +int regno(int r) { switch (r) { case X: return 0; @@ -63,7 +63,7 @@ void emit1or2(int n) emit1(n); } -void offset(register int reg, expr_t exp, register int ind) +void offset(int reg, expr_t exp, int ind) { if (reg == PC) { int sm, dist; diff --git a/mach/arm/as/mach5.c b/mach/arm/as/mach5.c index 04e1019b3d..f86fe7f6b6 100644 --- a/mach/arm/as/mach5.c +++ b/mach/arm/as/mach5.c @@ -427,8 +427,8 @@ static char *pbittab[PBITTABSZ]; int oursmall(int fitsmall, int gain) { - register int bit; - register char *p; + int bit; + char *p; if (DOTSCT == NULL) nosect(); diff --git a/mach/arm/cv/cv.c b/mach/arm/cv/cv.c index 2f4d893898..60ee7f2e0a 100644 --- a/mach/arm/cv/cv.c +++ b/mach/arm/cv/cv.c @@ -65,7 +65,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -76,7 +76,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; long magic ; long textsize ; long datasize ; @@ -172,8 +172,8 @@ main(argc, argv) * and zero fill the uninitialized space */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -210,7 +210,7 @@ rsect(f,sect) struct outsect *sect ; FILE *f ; { } iconvert(buf,str,fmt) char *buf, *str, *fmt ; { - register char *nf, *ni, *no ; + char *nf, *ni, *no ; int last, i ; long value ; ni=buf ; no=str ; nf=fmt ; diff --git a/mach/arm/cv/dl.c b/mach/arm/cv/dl.c index 59aa23adea..ebcec9e307 100644 --- a/mach/arm/cv/dl.c +++ b/mach/arm/cv/dl.c @@ -39,7 +39,7 @@ convert () while (sect[i].os_size) { unsigned int sz = 8096, fl; extern char *calloc(); - register char *buf; + char *buf; char *pbuf; if (sz > sect[i].os_size) sz = sect[i].os_size; @@ -91,7 +91,7 @@ S1record (buf) } record (buf) - register char *buf; + char *buf; { while (bytcnt != 0) { diff --git a/mach/arm/ncg/mach.c b/mach/arm/ncg/mach.c index 11b124d35d..bf17579a6a 100644 --- a/mach/arm/ncg/mach.c +++ b/mach/arm/ncg/mach.c @@ -21,7 +21,7 @@ char *segname[] = { }; con_part(sz, w) - register int sz; + int sz; word w; { while (part_size % sz) part_size++; diff --git a/mach/arm/top/table b/mach/arm/top/table index 3a26a5ecbd..b2c5cfb1ed 100644 --- a/mach/arm/top/table +++ b/mach/arm/top/table @@ -677,7 +677,7 @@ ANY R11,X1,X2 : MOV R10,Y1 : MOV R9,Z1 : MOV R8,V1 : STMFD R12<,WW : BA %%; int is_register(s) -register char *s; +char *s; { if (*s++ == 'R' && *s >= '0' && *s <= '9') { if (*s++ == '1' && (*s >= '0' && *s <= '5')) s++; return *s == '\0'; @@ -715,7 +715,7 @@ char *s,*t1,*t2; } int no_side_effects(s) -register char *s; +char *s; { for (;;) { switch(*s++) { @@ -727,7 +727,7 @@ register char *s; } int is_greater(s1, s2, rl) -register char *s1, *s2, *rl; +char *s1, *s2, *rl; { long a1, a2; @@ -743,14 +743,14 @@ register char *s1, *s2, *rl; } int is_local(s) -register char *s; +char *s; { if (strcmp(s, "[R13") == 0) return(TRUE); return(FALSE); } int is_reglist_11(s) -register char *s; +char *s; { if (strcmp(s, "{R11}") == 0){ return(TRUE); @@ -759,14 +759,14 @@ register char *s; } int is_reglist(s) -register char *s; +char *s; { if (*s == '{') return(TRUE); return(FALSE); } int is_reglist1(s) -register char *s; +char *s; { if (*s != '{') return(FALSE); for (;;) { @@ -778,7 +778,7 @@ register char *s; } int is_lams(s) -register char *s; +char *s; { /* if (strcmp(s,"LDR") == 0) return(TRUE); if (strcmp(s,"ADD") == 0) return(TRUE); @@ -791,7 +791,7 @@ return(TRUE); } int is_unequal(s1, s2) -register char *s1, *s2; +char *s1, *s2; { long a1, a2; @@ -803,7 +803,7 @@ register char *s1, *s2; } int is_unequal3(s1, s2, s3) -register char *s1, *s2, *s3; +char *s1, *s2, *s3; { long a1, a2, a3; @@ -818,28 +818,28 @@ register char *s1, *s2, *s3; } int list_f_10(s) -register char *s; +char *s; { sprintf(s,"{R10,R11}"); return(TRUE); } int list_f_9(s) -register char *s; +char *s; { sprintf(s,"{R9,R10,R11}"); return(TRUE); } int list_f_8(s) -register char *s; +char *s; { sprintf(s,"{R8,R9,R10,R11}"); return(TRUE); } int ok_regcheck1(r, s1) -register char *s1; +char *s1; int r; { int a1; @@ -853,7 +853,7 @@ int r; } int ok_regcheck2(r, s1, s2) -register char *s1, *s2; +char *s1, *s2; int r; { if (ok_regcheck1(r,s1)) @@ -863,7 +863,7 @@ int r; } int ok_regcheck3(r, s1, s2, s3) -register char *s1, *s2, *s3; +char *s1, *s2, *s3; int r; { if (ok_regcheck1(r,s1)) @@ -873,7 +873,7 @@ int r; } int ok_regcheck4(r, s1, s2, s3, s4) -register char *s1, *s2, *s3, *s4; +char *s1, *s2, *s3, *s4; int r; { if (ok_regcheck2(r,s1,s2)) @@ -883,7 +883,7 @@ int r; } int ok_regcheck5(r, s1, s2, s3, s4, s5) -register char *s1, *s2, *s3, *s4, *s5; +char *s1, *s2, *s3, *s4, *s5; int r; { if (ok_regcheck2(r,s1,s2)) @@ -893,7 +893,7 @@ int r; } int ok_regcheck6(r, s1, s2, s3, s4, s5, s6) -register char *s1, *s2, *s3, *s4, *s5, *s6; +char *s1, *s2, *s3, *s4, *s5, *s6; int r; { if (ok_regcheck2(r,s1,s2)) @@ -903,7 +903,7 @@ int r; } int ok_regcheck7(r, s1, s2, s3, s4, s5, s6, s7) -register char *s1, *s2, *s3, *s4, *s5, *s6, *s7; +char *s1, *s2, *s3, *s4, *s5, *s6, *s7; int r; { if (ok_regcheck4(r,s1,s2,s3,s4)) @@ -913,7 +913,7 @@ int r; } int ok_regcheck8(r, s1, s2, s3, s4, s5, s6, s7, s8) -register char *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8; +char *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8; int r; { if (ok_regcheck4(r,s1,s2,s3,s4)) diff --git a/mach/i386/as/mach1.c b/mach/i386/as/mach1.c index f6c51264c8..12673a8047 100644 --- a/mach/i386/as/mach1.c +++ b/mach/i386/as/mach1.c @@ -110,18 +110,18 @@ void reverse(void); void badsyntax(void); void regsize(int sz); void indexed(void); -void ebranch(register int opc,expr_t exp); -void branch(register int opc,expr_t exp); -void pushop(register int opc); +void ebranch(int opc,expr_t exp); +void branch(int opc,expr_t exp); +void pushop(int opc); void opsize_exp(expr_t exp, int nobyte); void adsize_exp(expr_t exp, int relpc); -void addop(register int opc); -void rolop(register int opc); -void incop(register int opc); -void callop(register int opc); -void xchg(register int opc); -void test(register int opc); -void mov(register int opc); +void addop(int opc); +void rolop(int opc); +void incop(int opc); +void callop(int opc); +void xchg(int opc); +void test(int opc); +void mov(int opc); void extshft(int opc, int reg); void bittestop(int opc); void imul(int reg); diff --git a/mach/i386/as/mach5.c b/mach/i386/as/mach5.c index 2a788651cc..7796903a05 100644 --- a/mach/i386/as/mach5.c +++ b/mach/i386/as/mach5.c @@ -120,7 +120,7 @@ void badsyntax(void) void regsize(int sz) { - register int bit; + int bit; bit = (sz&1) ? 0 : IS_R8; if ((is_reg(reg_1) && (reg_1 & IS_R8) != bit) || @@ -171,7 +171,7 @@ void indexed(void) { } } -void ebranch(register int opc,expr_t exp) +void ebranch(int opc,expr_t exp) { /* Conditional branching; Full displacements are available on the 80386, so the welknown trick with the reverse branch @@ -180,8 +180,8 @@ void ebranch(register int opc,expr_t exp) can be set with a prefix. In this case, the user gets what he asked for. */ - register int sm; - register long dist; + int sm; + long dist; int saving = address_long ? 4 : 2; if (opc == 0353) saving--; @@ -214,12 +214,12 @@ void ebranch(register int opc,expr_t exp) } } -void branch(register int opc,expr_t exp) +void branch(int opc,expr_t exp) { /* LOOP, JCXZ, etc. branch instructions. Here, the offset just must fit in a byte. */ - register long dist; + long dist; dist = exp.val - (DOTVAL + 2); if (pass == PASS_2 && dist > 0 && !(exp.typ & S_DOT)) @@ -229,7 +229,7 @@ void branch(register int opc,expr_t exp) emit1((int)dist); } -void pushop(register int opc) +void pushop(int opc) { regsize(1); @@ -303,7 +303,7 @@ void adsize_exp(expr_t exp, int relpc) } } -void addop(register int opc) +void addop(int opc) { regsize(opc); @@ -336,9 +336,9 @@ void addop(register int opc) badsyntax(); } -void rolop(register int opc) +void rolop(int opc) { - register int oreg; + int oreg; oreg = reg_2; reg_2 = reg_1; @@ -365,7 +365,7 @@ void rolop(register int opc) badsyntax(); } -void incop(register int opc) +void incop(int opc) { regsize(opc); @@ -378,7 +378,7 @@ void incop(register int opc) } } -void callop(register int opc) +void callop(int opc) { regsize(1); @@ -397,7 +397,7 @@ void callop(register int opc) } } -void xchg(register int opc) +void xchg(int opc) { regsize(opc); @@ -412,7 +412,7 @@ void xchg(register int opc) badsyntax(); } -void test(register int opc) +void test(int opc) { regsize(opc); @@ -436,7 +436,7 @@ void test(register int opc) badsyntax(); } -void mov(register int opc) +void mov(int opc) { regsize(opc); diff --git a/mach/i386/ce/as.c b/mach/i386/ce/as.c index b628adb9ac..42da48e800 100644 --- a/mach/i386/ce/as.c +++ b/mach/i386/ce/as.c @@ -113,7 +113,7 @@ int is_reg( str, op) char *str; struct t_operand *op; { - register struct regnam *p = regnam; + struct regnam *p = regnam; while (p->regstr) { if (! strcmp(p->regstr, str)) { diff --git a/mach/i386/cv/cv.c b/mach/i386/cv/cv.c index d5ff13eb05..e7e5c113c3 100644 --- a/mach/i386/cv/cv.c +++ b/mach/i386/cv/cv.c @@ -264,8 +264,8 @@ char buf[0300]; header() { - register char *p = buf; - register int i; + char *p = buf; + int i; shortcvt(exec.x_magic, p); shortcvt(exec.x_ext, p); @@ -316,8 +316,8 @@ header() * Transfer the emitted byted from one file to another. */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -343,17 +343,17 @@ emits(section) struct outsect *section ; { long emit_symtab() { - register int i; + int i; struct xnm { unsigned short s_type, s_seg; long s_value; } xnm; char *chars, *xname; struct outname *names; - register char *xptr; + char *xptr; long off = OFF_CHAR(outhead); - register char *p; - register struct outname *np; + char *p; + struct outname *np; chars = malloc((unsigned)(outhead.oh_nchar)); if (! chars) return 0; diff --git a/mach/i80/dl/mccpm.c b/mach/i80/dl/mccpm.c index 2a9e484f2d..e3d06ba5e9 100644 --- a/mach/i80/dl/mccpm.c +++ b/mach/i80/dl/mccpm.c @@ -56,7 +56,7 @@ convert () while (sect[i].os_size) { unsigned int sz = 8096, fl; extern char *calloc(); - register char *buf; + char *buf; char *pbuf; if (sz > sect[i].os_size) sz = sect[i].os_size; @@ -87,7 +87,7 @@ convert () data (sz, pc, buf) - register char *buf; + char *buf; { printf (":"); outbyte (sz); diff --git a/mach/i80/dl/nascom.c b/mach/i80/dl/nascom.c index e411d9c608..bdee11f3f0 100644 --- a/mach/i80/dl/nascom.c +++ b/mach/i80/dl/nascom.c @@ -45,9 +45,9 @@ stop(code) { } main(argc,argv) char **argv; { - register unsigned nd; + unsigned nd; long pc; - register char *s; + char *s; int i; progname = argv[0]; @@ -116,7 +116,7 @@ main(argc,argv) char **argv; { while (sect[i].os_size) { unsigned int sz = 8096, fl; extern char *calloc(); - register char *buf; + char *buf; char *pbuf; if (sz > sect[i].os_size) sz = sect[i].os_size; @@ -148,10 +148,10 @@ main(argc,argv) char **argv; { } data(nd,pc,buf) - register char *buf; + char *buf; int pc; { - register i; + i; check = 0; pc += disp; diff --git a/mach/i86/as/mach1.c b/mach/i86/as/mach1.c index 93ec0cbd51..3387af83de 100644 --- a/mach/i86/as/mach1.c +++ b/mach/i86/as/mach1.c @@ -48,15 +48,15 @@ void ea_1(int param); void ea_2(int param); void reverse(void); void badsyntax(void); -void regsize(register int sz); +void regsize(int sz); void indexed(void); -void branch(register int opc,expr_t exp); -void pushop(register int opc); -void addop(register int opc); -void rolop(register int opc); -void incop(register int opc); -void callop(register int opc); -void xchg(register int opc); -void test(register int opc); -void mov(register int opc); +void branch(int opc,expr_t exp); +void pushop(int opc); +void addop(int opc); +void rolop(int opc); +void incop(int opc); +void callop(int opc); +void xchg(int opc); +void test(int opc); +void mov(int opc); void imul(int opc); diff --git a/mach/i86/as/mach5.c b/mach/i86/as/mach5.c index 097c8cd434..a37fb8b06a 100644 --- a/mach/i86/as/mach5.c +++ b/mach/i86/as/mach5.c @@ -52,7 +52,7 @@ void ea_2(int param) { void reverse(void) { - register int m, r; + int m, r; expr_t e; m = mrg_1; mrg_1 = mrg_2; mrg_2 = m; @@ -68,9 +68,9 @@ void badsyntax(void) serror("bad operands"); } -void regsize(register int sz) +void regsize(int sz) { - register int bit; + int bit; sz <<= 3; bit = 010; @@ -104,9 +104,9 @@ void indexed(void) } } -void branch(register int opc,expr_t exp) +void branch(int opc,expr_t exp) { - register int sm,dist; + int sm,dist; int saving = opc == 0353 ? 1 : 3; dist = exp.val - (DOTVAL + 2); @@ -139,7 +139,7 @@ void branch(register int opc,expr_t exp) emit1(dist); } -void pushop(register int opc) +void pushop(int opc) { regsize(1); @@ -169,7 +169,7 @@ void pushop(register int opc) } } -void addop(register int opc) +void addop(int opc) { regsize(opc); if (mrg_2 >= 0300) { @@ -205,9 +205,9 @@ void addop(register int opc) badsyntax(); } -void rolop(register int opc) +void rolop(int opc) { - register int cmrg; + int cmrg; cmrg = mrg_2; mrg_2 = mrg_1; @@ -226,7 +226,7 @@ void rolop(register int opc) badsyntax(); } -void incop(register int opc) +void incop(int opc) { regsize(opc); @@ -238,7 +238,7 @@ void incop(register int opc) } } -void callop(register int opc) +void callop(int opc) { regsize(1); if (mrg_1 & 040) { @@ -259,7 +259,7 @@ void callop(register int opc) } } -void xchg(register int opc) +void xchg(int opc) { regsize(opc); if (mrg_2 == 0300 || mrg_1 < 0300) @@ -272,7 +272,7 @@ void xchg(register int opc) badsyntax(); } -void test(register int opc) +void test(int opc) { regsize(opc); if ((mrg_1 & 040) || mrg_2 >= 0300) @@ -298,7 +298,7 @@ void test(register int opc) badsyntax(); } -void mov(register int opc) +void mov(int opc) { regsize(opc); if (mrg_1 & 020) { diff --git a/mach/i86/cv/cv.c b/mach/i86/cv/cv.c index 7f329ad6ec..342ddab120 100644 --- a/mach/i86/cv/cv.c +++ b/mach/i86/cv/cv.c @@ -80,7 +80,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -91,7 +91,7 @@ main(argc, argv) int argc; char *argv[]; { - register struct exec *e = &exec; + struct exec *e = &exec; output = stdout; program= argv[0] ; @@ -217,8 +217,8 @@ wr_long(l) * Transfer the emitted byted from one file to another. */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -245,7 +245,7 @@ emit_symtab() { struct outname ACK_name; /* symbol table entry in ACK format */ struct nlist IX_name; /* symbol table entry in PC/IX format */ - register unsigned short i; + unsigned short i; long l; long off = OFF_CHAR(outhead); diff --git a/mach/m68020/as/mach1.c b/mach/m68020/as/mach1.c index 0e0ac10c01..1629e9080e 100644 --- a/mach/m68020/as/mach1.c +++ b/mach/m68020/as/mach1.c @@ -154,7 +154,7 @@ void link_instr(int sz, int areg); void move(int sz); void move_special(int sz); void movem(int dr, int sz, int regs); -int reverse(register int regs, int max); +int reverse(int regs, int max); void movep(int sz); void branch(int opc, expr_t exp); void cpbcc(int opc, expr_t exp); diff --git a/mach/m68020/as/mach5.c b/mach/m68020/as/mach5.c index 8a82b63135..3bfb622c3a 100644 --- a/mach/m68020/as/mach5.c +++ b/mach/m68020/as/mach5.c @@ -25,7 +25,7 @@ void emit_instr(void) { - register instr_t *ip; + instr_t *ip; for (ip=instr; ipi_word)) { #ifdef RELOCATION @@ -72,8 +72,8 @@ void ea_1(int sz, int bits) * one of these calls is a dummy call. */ - register int flag; - register int sm, sm1, sm2; + int flag; + int sm, sm1, sm2; if (mrg_1 > 074) serror("no specials"); @@ -258,7 +258,7 @@ void shift_op(int opc, int sz) void bitop(int opc) { - register int bits; + int bits; bits = DTA|ALT; if (opc == 0 && (mrg_1 < 010 || mrg_2 != 074)) @@ -365,7 +365,7 @@ int from_dreg(int opc, int sz, int bits) void cmp(int sz) { - register int opc; + int opc; if ((mrg_1&070) == 030 && (mrg_2&070) == 030) { T_EMIT2(0130410 | sz | (mrg_1&7) | (mrg_2&7)<<9, 0, 0, 0); @@ -411,7 +411,7 @@ void link_instr(int sz, int areg) void move(int sz) { - register int opc; + int opc; if (mrg_1 > 074 || mrg_2 > 074) { move_special(sz); @@ -472,7 +472,7 @@ void move_special(int sz) void movem(int dr, int sz, int regs) { - register int i; + int i; if ((mrg_2>>3) == 04) { regs = reverse(regs, 16); @@ -492,9 +492,9 @@ void movem(int dr, int sz, int regs) ea_2(sz, i); } -int reverse(register int regs, int max) +int reverse(int regs, int max) { - register int r, i; + int r, i; r = regs; regs = 0; for (i = max; i > 0; i--) { @@ -524,7 +524,7 @@ void movep(int sz) void branch(int opc, expr_t exp) { - register int sm; + int sm; exp.val -= (DOTVAL + 2); if ((pass == PASS_2) @@ -559,7 +559,7 @@ void branch(int opc, expr_t exp) void cpbcc(int opc, expr_t exp) { - register int sm; + int sm; exp.val -= (DOTVAL + 2); if ((pass == PASS_2) @@ -663,7 +663,7 @@ void ea7071(int sz) void fbranch(int opc, expr_t exp) { - register int sm; + int sm; exp.val -= (DOTVAL + 2); if ((pass == PASS_2) diff --git a/mach/m68020/ce/as.c b/mach/m68020/ce/as.c index 6aaf538401..bfeef2b7b3 100644 --- a/mach/m68020/ce/as.c +++ b/mach/m68020/ce/as.c @@ -18,8 +18,8 @@ char *m; process_operand( str, op) -register char *str; -register struct t_operand *op; +char *str; +struct t_operand *op; { char *glob_lbl(), *strchr(); @@ -178,7 +178,7 @@ char *reg; } int is_reg( str) -register char *str; +char *str; { switch ( *str) { case 'a' : @@ -206,7 +206,7 @@ char *lbl; int mode_reg( eaddr) -register struct t_operand *eaddr; +struct t_operand *eaddr; { switch ( eaddr->type) { case IS_A_REG : return( 0x08 | eaddr->reg); @@ -249,7 +249,7 @@ register struct t_operand *eaddr; code_extension( eaddr) -register struct t_operand *eaddr; +struct t_operand *eaddr; { switch ( eaddr->type) { @@ -385,9 +385,9 @@ struct t_operand *dst; int two_log( nr) -register int nr; +int nr; { - register int log; + int log; for ( log = 0; nr >= 2; nr >>= 1) log++; diff --git a/mach/m68020/cv/cv.c b/mach/m68020/cv/cv.c index e289086900..692b895382 100644 --- a/mach/m68020/cv/cv.c +++ b/mach/m68020/cv/cv.c @@ -112,7 +112,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -123,7 +123,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; long magic ; long textsize, datasize, bsssize; extern long ftell(); @@ -261,8 +261,8 @@ char *ptr; * Transfer the emitted bytes from one file to another. */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -295,7 +295,7 @@ rsect(f,sect) struct outsect *sect ; FILE *f ; { iconvert(buf,str,fmt) char *buf, *str, *fmt ; { - register char *nf, *ni, *no ; + char *nf, *ni, *no ; int last, i ; long value ; ni=buf ; no=str ; nf=fmt ; diff --git a/mach/m68020/libsys/Xstat.c b/mach/m68020/libsys/Xstat.c index 3569aac499..b743c409c4 100644 --- a/mach/m68020/libsys/Xstat.c +++ b/mach/m68020/libsys/Xstat.c @@ -33,8 +33,8 @@ static Xcvt(buf, statbuf) char *buf, *statbuf; { - register char *s, *t; - register int i; + char *s, *t; + int i; s = buf; t = statbuf; for (i = 14; i; i--) *t++ = *s++; diff --git a/mach/m68020/libsys/_Xstat.c b/mach/m68020/libsys/_Xstat.c index 772200ec9e..9e08a57919 100644 --- a/mach/m68020/libsys/_Xstat.c +++ b/mach/m68020/libsys/_Xstat.c @@ -20,8 +20,8 @@ static Xcvt(buf, statbuf) char *buf, *statbuf; { - register char *s, *t; - register int i; + char *s, *t; + int i; s = buf; t = statbuf; for (i = 14; i; i--) *t++ = *s++; diff --git a/mach/m68020/ncg/mach.c b/mach/m68020/ncg/mach.c index 70b3f86291..803fba61fd 100644 --- a/mach/m68020/ncg/mach.c +++ b/mach/m68020/ncg/mach.c @@ -106,7 +106,7 @@ full nlocals; void regreturn(void) { - register struct regsav_t *p; + struct regsav_t *p; if (regnr > 1) { #ifdef SYNTAX_68020 @@ -134,7 +134,7 @@ regreturn(void) void f_regsave(void) { - register struct regsav_t *p; + struct regsav_t *p; nlocals += regnr*4; #ifdef TBL68020 diff --git a/mach/m68k2/as/mach1.c b/mach/m68k2/as/mach1.c index adbd5cb2e0..7c50c37e22 100644 --- a/mach/m68k2/as/mach1.c +++ b/mach/m68k2/as/mach1.c @@ -93,7 +93,7 @@ int from_dreg(int opc, int sz, int bits); void cmp(int sz); void move(int sz); void move_special(int sz); -int reverse(register int regs, int max); +int reverse(int regs, int max); void movem(int dr, int sz, int regs); void movep(int sz); void branch(int opc, expr_t exp); diff --git a/mach/m68k2/as/mach5.c b/mach/m68k2/as/mach5.c index 9e121f4e4d..b8ea83808b 100644 --- a/mach/m68k2/as/mach5.c +++ b/mach/m68k2/as/mach5.c @@ -26,7 +26,7 @@ static int extension_offset(void) void ea_1(int sz, int bits) { - register int flag; + int flag; if (mrg_1 > 074) serror("no specials"); @@ -114,7 +114,7 @@ void shift_op(int opc, int sz) void bitop(int opc) { - register int bits; + int bits; bits = DTA|ALT; if (opc == 0 && (mrg_1 < 010 || mrg_2 != 074)) @@ -213,7 +213,7 @@ int from_dreg(int opc, int sz, int bits) void cmp(int sz) { - register int opc; + int opc; if ((mrg_1&070) == 030 && (mrg_2&070) == 030) { emit2(0130410 | sz | (mrg_1&7) | (mrg_2&7)<<9); @@ -260,7 +260,7 @@ void cmp(int sz) void move(int sz) { - register int opc; + int opc; if (mrg_1 > 074 || mrg_2 > 074) { move_special(sz); @@ -321,9 +321,9 @@ void move_special(int sz) badoperand(); } -int reverse(register int regs, int max) +int reverse(int regs, int max) { - register int r, i; + int r, i; r = regs; regs = 0; for (i = max; i > 0; i--) { @@ -336,7 +336,7 @@ int reverse(register int regs, int max) void movem(int dr, int sz, int regs) { - register int i; + int i; if ((mrg_2>>3) == 04) { regs = reverse(regs, 16); @@ -374,7 +374,7 @@ void movep(int sz) void branch(int opc, expr_t exp) { - register int sm; + int sm; exp.val -= (DOTVAL + 2); if ((pass == PASS_2) @@ -424,7 +424,7 @@ void ea5x73(int rg, int sz) void ea707172(int sz) { - register int sm; + int sm; mrg_2 = 071; switch (sz) { @@ -498,7 +498,7 @@ void Xnofit(void) void fbranch(int opc, expr_t exp) { - register int sm; + int sm; exp.val -= (DOTVAL + 2); if ((pass == PASS_2) diff --git a/mach/m68k2/cv/cv.c b/mach/m68k2/cv/cv.c index 4989b6102d..8da5c46c89 100644 --- a/mach/m68k2/cv/cv.c +++ b/mach/m68k2/cv/cv.c @@ -75,7 +75,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -86,7 +86,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; long magic ; long textsize ; long datasize ; @@ -196,8 +196,8 @@ main(argc, argv) * and zero fill the uninitialized space */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -225,7 +225,7 @@ emits(section) struct outsect *section ; { */ names() { - register unsigned n = outhead.oh_nname - outhead.oh_nsect; + unsigned n = outhead.oh_nname - outhead.oh_nsect; int type = 0 ; struct outname outname ; char buffer[100] ; @@ -296,8 +296,8 @@ names() */ chars() { - register long n = outhead.oh_nchar; - register int blk; + long n = outhead.oh_nchar; + int blk; char *curr ; extern char *malloc() ; @@ -343,7 +343,7 @@ rname(f,name) struct outname *name ; FILE *f ; { } iconvert(buf,str,fmt) char *buf, *str, *fmt ; { - register char *nf, *ni, *no ; + char *nf, *ni, *no ; int last, i ; long value ; ni=buf ; no=str ; nf=fmt ; diff --git a/mach/m68k2/cv/cv.prev.c b/mach/m68k2/cv/cv.prev.c index 8fb222fffc..02d1db1e02 100644 --- a/mach/m68k2/cv/cv.prev.c +++ b/mach/m68k2/cv/cv.prev.c @@ -26,10 +26,10 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; - register struct outsect *sectp; - register FILE *input; - register FILE *output; + int nsect; + struct outsect *sectp; + FILE *input; + FILE *output; ASSERT(sizeof(struct outhead) == SZ_HEAD); ASSERT(sizeof(struct outsect) == SZ_SECT); @@ -60,9 +60,9 @@ main(argc, argv) nsect = outhead.oh_nsect; sectp = outsect; while (nsect--) { - register long flen; + long flen; #ifdef DO_BSS - register long zero; + long zero; #endif DO_BSS long base; short cnt; @@ -134,7 +134,7 @@ rname(f,name) struct outname *name ; FILE *f ; { } iconvert(buf,str,fmt) char *buf, *str, *fmt ; { - register char *nf, *ni, *no ; + char *nf, *ni, *no ; int last, i ; long value ; ni=buf ; no=str ; nf=fmt ; diff --git a/mach/m68k2/dl/dl.c b/mach/m68k2/dl/dl.c index 411082cfb2..1b242aa77e 100644 --- a/mach/m68k2/dl/dl.c +++ b/mach/m68k2/dl/dl.c @@ -43,7 +43,7 @@ convert () while (sect[i].os_size) { unsigned int sz = 8096, fl; extern char *calloc(); - register char *buf; + char *buf; char *pbuf; if (sz > sect[i].os_size) sz = sect[i].os_size; @@ -95,7 +95,7 @@ S1record (buf) } record (buf) - register char *buf; + char *buf; { while (bytcnt != 0) { diff --git a/mach/mantra/cv/Xcv.c b/mach/mantra/cv/Xcv.c index d8a9f49885..b4fd1e0419 100644 --- a/mach/mantra/cv/Xcv.c +++ b/mach/mantra/cv/Xcv.c @@ -95,7 +95,7 @@ main(argc, argv) int argc; char *argv[]; { - register struct outsect *p; + struct outsect *p; char *malloc(); input = stdin; @@ -166,12 +166,12 @@ symtab(name, string) struct outname *name; char *string; { - register struct outname *oname = name; - register char *strings = string; - register int c; + struct outname *oname = name; + char *strings = string; + int c; unsigned nnames = 3; - register long ssize = bh.ssize; - register char *b; + long ssize = bh.ssize; + char *b; oname->on_valu = 0; oname->on_foff = 0; oname->on_desc = 0; oname->on_type = (S_MIN+TEXTSG) | S_SCT; @@ -245,9 +245,9 @@ symtab(name, string) long get4(c) - register char *c; + char *c; { - register long l = (long) (*c++ & 0377) << 24; + long l = (long) (*c++ & 0377) << 24; l |= (long) (*c++ & 0377) << 16; l |= (long) (*c++ & 0377) << 8; @@ -256,8 +256,8 @@ get4(c) } put4(l, c) - register char *c; - register long l; + char *c; + long l; { *c++ = (l >> 24); *c++ = (l >> 16); @@ -269,10 +269,10 @@ relo(orelo, txt, data) struct outrelo *orelo; char *txt, *data; { - register struct outrelo *relo = orelo; - register relocnt = outhead.oh_nrelo; + struct outrelo *relo = orelo; + relocnt = outhead.oh_nrelo; struct reloc rel; - register struct reloc *relp = &rel; + struct reloc *relp = &rel; int ndat = bh.rdsize / sizeof(struct reloc); while (relocnt-- > 0) { @@ -304,7 +304,7 @@ relo(orelo, txt, data) relo->or_type = RELO2|RELBR|RELWR; break; case RLONG: { - register char *sct = (relocnt >= ndat ? txt : data) + + char *sct = (relocnt >= ndat ? txt : data) + relo->or_addr; long x; diff --git a/mach/mantra/cv/cv.c b/mach/mantra/cv/cv.c index 2dfeb1b89d..867413f0e6 100644 --- a/mach/mantra/cv/cv.c +++ b/mach/mantra/cv/cv.c @@ -81,7 +81,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -92,7 +92,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; long magic ; long textsize ; long datasize ; @@ -221,10 +221,10 @@ emits(section) struct outsect *section ; { emit_symtab() { struct outname *ACK_names; - register unsigned short i; - register struct outname *A; - register char x; - register char *p; + unsigned short i; + struct outname *A; + char x; + char *p; extern char *malloc(), *calloc(); long l; long off = OFF_CHAR(outhead); @@ -285,7 +285,7 @@ emit_symtab() } write_long(l) - register long l; + long l; { /* write long "l" in 68000 order */ @@ -297,7 +297,7 @@ write_long(l) } write_header(h) - register struct bhdr *h; + struct bhdr *h; { write_long(h->fmagic); write_long(h->tsize); diff --git a/mach/minix/libsys/_exec.c b/mach/minix/libsys/_exec.c index cc4ddf9ad6..de72ea5e7a 100644 --- a/mach/minix/libsys/_exec.c +++ b/mach/minix/libsys/_exec.c @@ -74,8 +74,8 @@ char *path; /* pointer to name of file to be executed */ char *argv[]; /* pointer to argument array */ char *envp[]; /* pointer to environment */ { - register char **argtop; - register char **envtop; + char **argtop; + char **envtop; /* Count the argument pointers and environment pointers. */ for (argtop = argv; *argtop != (char *) NULL; ) argtop++; diff --git a/mach/minix/libsys/_execn.c b/mach/minix/libsys/_execn.c index e3ce35efa0..1ac59ec15d 100644 --- a/mach/minix/libsys/_execn.c +++ b/mach/minix/libsys/_execn.c @@ -10,7 +10,7 @@ char *name; /* pointer to file to be exec'd */ * is principally used by INIT, to avoid having to allocate ARG_MAX. */ - PRIVATE char stack[3 * PTRSIZE]; + static char stack[3 * PTRSIZE]; return(_callm1(MM, EXEC, _len(name), sizeof(stack), 0, name, stack, NIL_PTR)); } diff --git a/mach/minix/libsys/_execnl.c b/mach/minix/libsys/_execnl.c index 97a9e75492..71dcc7ae7b 100644 --- a/mach/minix/libsys/_execnl.c +++ b/mach/minix/libsys/_execnl.c @@ -12,13 +12,13 @@ _PROTOTYPE(int _execn,(char *name)); _PROTOTYPE(int _execnl,(char *name, char *arg0)); -PRIVATE _PROTOTYPE(int _nexec,(char *name, char *argv[])); +static _PROTOTYPE(int _nexec,(char *name, char *argv[])); PUBLIC int _execn(name) char *name; /* pointer to file to be exec'd */ { /* This funcion uses no arguments at all. */ - PRIVATE char stack[3 * PTRSIZE]; + static char stack[3 * PTRSIZE]; return(_callm1(MM, EXEC, _len(name), sizeof(stack), 0, name, stack, NIL_PTR)); } @@ -33,7 +33,7 @@ char *arg0; return(_nexec(name, &arg0)); } -PRIVATE int _nexec(name, argv) +static int _nexec(name, argv) char *name; /* pointer to name of file to be executed */ char *argv[]; /* pointer to argument array */ { diff --git a/mach/minix/libsys/_getcwd.c b/mach/minix/libsys/_getcwd.c index 92546aa739..de7e923f2f 100644 --- a/mach/minix/libsys/_getcwd.c +++ b/mach/minix/libsys/_getcwd.c @@ -13,7 +13,7 @@ #define DIRECT_SIZE (sizeof (struct direct)) -PRIVATE _PROTOTYPE(void go_back, (char *path) ); +static _PROTOTYPE(void go_back, (char *path) ); char *getcwd(buffer, size) char *buffer; @@ -103,7 +103,7 @@ int size; return(chdir(buffer) ? (char *)NULL : buffer); } -PRIVATE void go_back(path) +static void go_back(path) char *path; { /* If getcwd() gets in trouble and can't complete normally, reverse the diff --git a/mach/minix/libsys/call.c b/mach/minix/libsys/call.c index 46678ef802..c9e8a50453 100644 --- a/mach/minix/libsys/call.c +++ b/mach/minix/libsys/call.c @@ -33,8 +33,8 @@ _CONST char *name; /* string */ * one integer parameter along with a string. If the string fits in the * message, it is copied there. If not, a pointer to it is passed. */ - register int k; - register char *rp; + int k; + char *rp; k = _len(name); _M.m3_i1 = k; _M.m3_i2 = int1; @@ -70,7 +70,7 @@ PUBLIC int _len(s) _CONST register char *s; /* character string whose length is needed */ { /* Return the length of a character string, including the 0 at the end. */ - register int k; + int k; k = 0; while (*s++ != 0) k++; diff --git a/mach/minixST/cv/cv.c b/mach/minixST/cv/cv.c index b102fac61c..28564d8691 100644 --- a/mach/minixST/cv/cv.c +++ b/mach/minixST/cv/cv.c @@ -84,7 +84,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -198,7 +198,7 @@ emits(section) struct outsect *section ; { int compare(a,b) - register struct outrelo *a, *b; + struct outrelo *a, *b; { if (a->or_sect < b->or_sect) return -1; if (a->or_sect > b->or_sect) return 1; @@ -210,12 +210,12 @@ compare(a,b) emit_relo() { struct outrelo *ACKrelo; - register struct outrelo *ap; + struct outrelo *ap; unsigned int cnt = outhead.oh_nrelo; long last, curr, base; int sect; char *bp; - register char *b; + char *b; ACKrelo = ap = (struct outrelo *) calloc(cnt, sizeof(struct outrelo)); bp = b = malloc(4 + cnt); @@ -289,7 +289,7 @@ chmem(str, old) char *str; long old; { - register long num, new; + long num, new; long atol(); num = atol(str+1); diff --git a/mach/minixST/libsys/_exec.c b/mach/minixST/libsys/_exec.c index cc4ddf9ad6..de72ea5e7a 100644 --- a/mach/minixST/libsys/_exec.c +++ b/mach/minixST/libsys/_exec.c @@ -74,8 +74,8 @@ char *path; /* pointer to name of file to be executed */ char *argv[]; /* pointer to argument array */ char *envp[]; /* pointer to environment */ { - register char **argtop; - register char **envtop; + char **argtop; + char **envtop; /* Count the argument pointers and environment pointers. */ for (argtop = argv; *argtop != (char *) NULL; ) argtop++; diff --git a/mach/minixST/libsys/_execn.c b/mach/minixST/libsys/_execn.c index e3ce35efa0..1ac59ec15d 100644 --- a/mach/minixST/libsys/_execn.c +++ b/mach/minixST/libsys/_execn.c @@ -10,7 +10,7 @@ char *name; /* pointer to file to be exec'd */ * is principally used by INIT, to avoid having to allocate ARG_MAX. */ - PRIVATE char stack[3 * PTRSIZE]; + static char stack[3 * PTRSIZE]; return(_callm1(MM, EXEC, _len(name), sizeof(stack), 0, name, stack, NIL_PTR)); } diff --git a/mach/minixST/libsys/_execnl.c b/mach/minixST/libsys/_execnl.c index 97a9e75492..71dcc7ae7b 100644 --- a/mach/minixST/libsys/_execnl.c +++ b/mach/minixST/libsys/_execnl.c @@ -12,13 +12,13 @@ _PROTOTYPE(int _execn,(char *name)); _PROTOTYPE(int _execnl,(char *name, char *arg0)); -PRIVATE _PROTOTYPE(int _nexec,(char *name, char *argv[])); +static _PROTOTYPE(int _nexec,(char *name, char *argv[])); PUBLIC int _execn(name) char *name; /* pointer to file to be exec'd */ { /* This funcion uses no arguments at all. */ - PRIVATE char stack[3 * PTRSIZE]; + static char stack[3 * PTRSIZE]; return(_callm1(MM, EXEC, _len(name), sizeof(stack), 0, name, stack, NIL_PTR)); } @@ -33,7 +33,7 @@ char *arg0; return(_nexec(name, &arg0)); } -PRIVATE int _nexec(name, argv) +static int _nexec(name, argv) char *name; /* pointer to name of file to be executed */ char *argv[]; /* pointer to argument array */ { diff --git a/mach/minixST/libsys/_getcwd.c b/mach/minixST/libsys/_getcwd.c index 92546aa739..de7e923f2f 100644 --- a/mach/minixST/libsys/_getcwd.c +++ b/mach/minixST/libsys/_getcwd.c @@ -13,7 +13,7 @@ #define DIRECT_SIZE (sizeof (struct direct)) -PRIVATE _PROTOTYPE(void go_back, (char *path) ); +static _PROTOTYPE(void go_back, (char *path) ); char *getcwd(buffer, size) char *buffer; @@ -103,7 +103,7 @@ int size; return(chdir(buffer) ? (char *)NULL : buffer); } -PRIVATE void go_back(path) +static void go_back(path) char *path; { /* If getcwd() gets in trouble and can't complete normally, reverse the diff --git a/mach/minixST/libsys/call.c b/mach/minixST/libsys/call.c index 46678ef802..c9e8a50453 100644 --- a/mach/minixST/libsys/call.c +++ b/mach/minixST/libsys/call.c @@ -33,8 +33,8 @@ _CONST char *name; /* string */ * one integer parameter along with a string. If the string fits in the * message, it is copied there. If not, a pointer to it is passed. */ - register int k; - register char *rp; + int k; + char *rp; k = _len(name); _M.m3_i1 = k; _M.m3_i2 = int1; @@ -70,7 +70,7 @@ PUBLIC int _len(s) _CONST register char *s; /* character string whose length is needed */ { /* Return the length of a character string, including the 0 at the end. */ - register int k; + int k; k = 0; while (*s++ != 0) k++; diff --git a/mach/ns/as/mach1.c b/mach/ns/as/mach1.c index 736e40de14..e7548f33e6 100644 --- a/mach/ns/as/mach1.c +++ b/mach/ns/as/mach1.c @@ -136,11 +136,11 @@ void frm15_1(int id,int i_type,int s_type); void frm15_5(int id); void gen1(int id); void gengen(int id); -void disp(register expr_t *expr, int relpc); +void disp(expr_t *expr, int relpc); void putdisp(valu_t val,int size); -void dot_adjust(register expr_t *expr); +void dot_adjust(expr_t *expr); int testsize(int type,int val); -void imm(int i_type,register expr_t *expr); +void imm(int i_type, expr_t *expr); int reg_list(int list,int reverse); int cpu_opt(int indic); int string_opt(int indic); diff --git a/mach/ns/as/mach4.c b/mach/ns/as/mach4.c index 3c8df50010..37c5a2cbd3 100644 --- a/mach/ns/as/mach4.c +++ b/mach/ns/as/mach4.c @@ -88,7 +88,7 @@ | ADD_I gen1 ',' gen2 /* format 4 */ { - register opc ; + opc ; opc=id_op($1) ; if ( opc==0x9 ) not_imm(&mode1) ; /* addr */ if ( opc!=0x1 ) not_imm(&mode2) ; /* !cmp */ @@ -153,7 +153,7 @@ | MOVM gen1 ',' gen2 ',' expr /* format 7 */ { - register s_size ; + s_size ; s_size= id_g1($1)+1 ; /* $6.val= $6.val*s_size - s_size ; */ $6.val= $6.val -1 ; diff --git a/mach/ns/as/mach5.c b/mach/ns/as/mach5.c index 30bb2c1499..f782ace538 100644 --- a/mach/ns/as/mach5.c +++ b/mach/ns/as/mach5.c @@ -163,8 +163,8 @@ void gengen(int id) { } } -void disp(register expr_t *expr, int relpc) { - register int sm1, sm2 ; +void disp(expr_t *expr, int relpc) { + int sm1, sm2 ; sm1=0 ; sm2=0 ; if (DOTTYP >= 0x2 && DOTTYP<=0x7F && @@ -221,7 +221,7 @@ void putdisp(valu_t val,int size) } } -void dot_adjust(register expr_t *expr) +void dot_adjust(expr_t *expr) { expr->val -= DOTVAL ; if ( pass==PASS_2 ) { @@ -251,7 +251,7 @@ int testsize(int type,int val) } } -void imm(int i_type,register expr_t *expr) +void imm(int i_type, expr_t *expr) { /* emit value of immediate expression , after check on FIT */ if (!testsize(i_type,(int)expr->val)) @@ -284,7 +284,7 @@ void imm(int i_type,register expr_t *expr) int reg_list(int list,int reverse) { - register int rev_list, i ; + int rev_list, i ; if ( !reverse ) { return list ; } diff --git a/mach/ns/ncg/mach.c b/mach/ns/ncg/mach.c index 3cd5b85bad..0b6b30f818 100644 --- a/mach/ns/ncg/mach.c +++ b/mach/ns/ncg/mach.c @@ -8,7 +8,7 @@ static char rcsid[] = "$Id$" ; #endif con_part(sz, w) - register int sz; + int sz; word w; { while (part_size % sz) part_size++; @@ -71,8 +71,8 @@ i_regsave() { } f_regsave(){ - register i; - register int c = ' '; + i; + int c = ' '; fprintf(codefile, "enter ["); for (i=0; i> 1; sm = fitb(eval); @@ -58,7 +58,7 @@ void branch(int opc,expr_t exp) void ejump(int opc, expr_t exp) { - register int sm,eval; + int sm,eval; int gain; # ifdef THREE_PASS @@ -98,11 +98,11 @@ void sob(int reg, expr_t exp) int jump(int opc,int opr) { - register int val; + int val; # ifdef THREE_PASS if (opr==067) { - register int sm = 0; + int sm = 0; val = adjust(exp_1) >> 1; if ( fitb(val) && (exp_1.typ & ~S_DOT) == DOTTYP) { diff --git a/mach/pdp/cg/mach.c b/mach/pdp/cg/mach.c index 15c816f361..1172f16e8c 100644 --- a/mach/pdp/cg/mach.c +++ b/mach/pdp/cg/mach.c @@ -13,7 +13,7 @@ -void con_part(register int sz, word w) +void con_part(int sz, word w) { while (part_size % sz) part_size++; @@ -84,7 +84,7 @@ void i_regsave(void) { } void f_regsave(void) { - register int i; + int i; if (n_regvars==0 || lbytes==0) { #ifdef REGPATCH diff --git a/mach/pdp/cg/mach.h b/mach/pdp/cg/mach.h index f1977fc172..966701ef46 100644 --- a/mach/pdp/cg/mach.h +++ b/mach/pdp/cg/mach.h @@ -62,7 +62,7 @@ void con_float(void); void con_mult(word sz); -void con_part(register int sz, word w); +void con_part(int sz, word w); void dlbdlb(string as,string ls); void mes(word type); void prolog(full nlocals); diff --git a/mach/pdp/cv/cv.c b/mach/pdp/cv/cv.c index 429abb77e2..4a4c2f28b8 100644 --- a/mach/pdp/cv/cv.c +++ b/mach/pdp/cv/cv.c @@ -74,7 +74,7 @@ char flag ; int main(int argc, char* argv[]) { - register struct exec *e = &exec; + struct exec *e = &exec; output = stdout; program= argv[0] ; @@ -209,8 +209,8 @@ cv_long(l) * Transfer the emitted byted from one file to another. */ void emits(struct outsect* section) { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -237,7 +237,7 @@ void emit_symtab(void) { struct outname ACK_name; /* symbol table entry in ACK format */ struct nlist PDP_name; /* symbol table entry in PDP V7 format */ - register unsigned short i; + unsigned short i; char *chars; long l; diff --git a/mach/pdp/ncg/mach.c b/mach/pdp/ncg/mach.c index 54eb6077db..8a45d3b7fd 100644 --- a/mach/pdp/ncg/mach.c +++ b/mach/pdp/ncg/mach.c @@ -86,7 +86,7 @@ i_regsave() { } f_regsave() { - register i; + i; if (n_regvars==0 || lbytes==0) { #ifdef REGPATCH diff --git a/mach/pmds/cv/cv.c b/mach/pmds/cv/cv.c index 4d6c9cec61..44906e4de7 100644 --- a/mach/pmds/cv/cv.c +++ b/mach/pmds/cv/cv.c @@ -62,7 +62,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -73,7 +73,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; long magic ; long textsize ; long datasize ; diff --git a/mach/proto/cg/codegen.c b/mach/proto/cg/codegen.c index 6bcadceabf..4fdafa0463 100644 --- a/mach/proto/cg/codegen.c +++ b/mach/proto/cg/codegen.c @@ -64,7 +64,7 @@ unsigned int codegen(byte *codep, int ply, int toplevel, unsigned int costlimit, byte *bp; int n; unsigned mindistance, dist; - register int i; + int i; int cindex; int npos, npos2, pos[MAXPOS], pos2[MAXPOS]; #ifdef STONSTACK @@ -83,7 +83,7 @@ unsigned int codegen(byte *codep, int ply, int toplevel, unsigned int costlimit, token_p tp; tkdef_p tdp; int tinstno; - register struct reginfo *rp; + struct reginfo *rp; struct reginfo **rpp; token_t token, mtoken, token2; int propno; @@ -319,7 +319,7 @@ unsigned int codegen(byte *codep, int ply, int toplevel, unsigned int costlimit, { if (!match(tp, &machsets[tokexp[i]], 0)) { - register c3_p cp = findcoerc(tp, &machsets[tokexp[i]]); + c3_p cp = findcoerc(tp, &machsets[tokexp[i]]); if (cp == 0) { for (j = 0; j < nregneeded; j++) @@ -368,7 +368,7 @@ unsigned int codegen(byte *codep, int ply, int toplevel, unsigned int costlimit, tp = &fakestack[stackpad - 1]; while (i < tokpatlen && tp >= fakestack) { - register c3_p cp = findcoerc((token_p) 0, + c3_p cp = findcoerc((token_p) 0, &machsets[tokexp[i]]); if (cp == 0) { diff --git a/mach/proto/cg/compute.c b/mach/proto/cg/compute.c index 0fec25a472..8ca6be8bbe 100644 --- a/mach/proto/cg/compute.c +++ b/mach/proto/cg/compute.c @@ -76,7 +76,7 @@ char opdesc[] = { string mycat(string s1,string s2) { - register string s; + string s; s=salloc(strlen(s1)+strlen(s2)); strcpy(s,s1); @@ -86,7 +86,7 @@ string mycat(string s1,string s2) string mystrcpy(string s) { - register string r; + string r; r=salloc(strlen(s)); strcpy(r,s); @@ -110,7 +110,7 @@ string tostring(word n) result_t undefres= {EV_UNDEF}; -result_t compute(register node_p node) +result_t compute(node_p node) { result_t leaf1,leaf2,result; token_p tp; diff --git a/mach/proto/cg/equiv.c b/mach/proto/cg/equiv.c index f18e4dcb28..ba56945bc6 100644 --- a/mach/proto/cg/equiv.c +++ b/mach/proto/cg/equiv.c @@ -31,7 +31,7 @@ static void permute(int index); struct perm* tuples(rl_p* regls, int nregneeded) { int class = 0; - register int i, j; + int i, j; /* * First compute equivalence classes of registers. @@ -67,9 +67,9 @@ struct perm* tuples(rl_p* regls, int nregneeded) static void permute(int index) { - register struct perm* pp; - register rl_p rlp; - register int i, j; + struct perm* pp; + rl_p rlp; + int i, j; if (index == maxindex) { diff --git a/mach/proto/cg/fillem.c b/mach/proto/cg/fillem.c index 1482178de7..c2ca92d8d6 100644 --- a/mach/proto/cg/fillem.c +++ b/mach/proto/cg/fillem.c @@ -116,10 +116,10 @@ extern short em_ptyp[]; /* Own version of atol that continues computing on overflow. We don't know that about the ANSI C one. */ -static long our_atol(register char *s) +static long our_atol(char *s) { - register long total = 0; - register unsigned digit; + long total = 0; + unsigned digit; int minus = 0; while (*s == ' ' || *s == '\t') s++; @@ -157,7 +157,7 @@ void in_finish(void) { void fillemlines(void) { int t,i; - register struct emline *lp; + struct emline *lp; while ((emlines+nemlines)-emp= sp_fmnem) { @@ -448,7 +448,7 @@ static int table1(void) { } static int table2(void) { - register int i; + int i; i = get8(); if (i < sp_fcst0+sp_ncst0 && i >= sp_fcst0) { @@ -502,7 +502,7 @@ static int table3(int i) { } static int get16(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = get8(); h_byte = get8(); @@ -511,8 +511,8 @@ static int get16(void) { } static long get32(void) { - register long l; - register int h_byte; + long l; + int h_byte; l = get8(); l |= ((unsigned) get8())*256 ; @@ -523,8 +523,8 @@ static long get32(void) { } static void getstring(void) { - register char *p; - register int n; + char *p; + int n; getarg(cst_ptyp); if (argval < 0 || argval > MAXSTR-1) @@ -537,7 +537,7 @@ static void getstring(void) { } static char *strarg(int t) { - register char *p; + char *p; switch (t) { case sp_ilb1: @@ -586,7 +586,7 @@ static char *strarg(int t) { static void bss(full n, int t, int b) { - register long s; + long s; if (n % TEM_WSIZE) fatal("bad BSS size"); @@ -609,7 +609,7 @@ static void bss(full n, int t, int b) } static long con(int t) { - register int i; + int i; strarg(t); switch (t) { @@ -668,7 +668,7 @@ static void switchseg(int s) { static void savelab(void) { - register char *p,*q; + char *p,*q; part_flush(); if (labstr[0]) { dlbdlb(argstr,labstr); diff --git a/mach/proto/cg/gencode.c b/mach/proto/cg/gencode.c index 47ba70293f..16b0b8c1bf 100644 --- a/mach/proto/cg/gencode.c +++ b/mach/proto/cg/gencode.c @@ -57,11 +57,11 @@ void tstoutput(void) { error("Write error on output"); } -void gencode(register char *code) +void gencode(char *code) { - register int c; + int c; int tokno,fldno,insno,regno,subno; - register token_p tp; + token_p tp; swtxt(); while ((c= *code++)!=0) switch(c) { @@ -156,9 +156,9 @@ void gennl(void) void prtoken(token_p tp) { - register int c; - register char *code; - register tkdef_p tdp; + int c; + char *code; + tkdef_p tdp; tdp = &tokens[tp->t_token]; assert(tdp->t_format != -1); diff --git a/mach/proto/cg/gencode.h b/mach/proto/cg/gencode.h index a6fb78b70e..793ebc1997 100644 --- a/mach/proto/cg/gencode.h +++ b/mach/proto/cg/gencode.h @@ -13,7 +13,7 @@ void out_init(char *filename); void out_finish(void); void tstoutput(void); -void gencode(register char *code); +void gencode(char *code); void genexpr(int nodeno); void gennl(void); void prtoken(token_p tp); diff --git a/mach/proto/cg/glosym.c b/mach/proto/cg/glosym.c index 55e283ffce..987c2ccda9 100644 --- a/mach/proto/cg/glosym.c +++ b/mach/proto/cg/glosym.c @@ -19,8 +19,8 @@ glosym_p glolist= (glosym_p) 0; void enterglo(string name,word *romp) { - register glosym_p gp; - register int i; + glosym_p gp; + int i; gp = (glosym_p) myalloc(sizeof *gp); gp->gl_next = glolist; @@ -33,7 +33,7 @@ void enterglo(string name,word *romp) glosym_p lookglo(string name) { - register glosym_p gp; + glosym_p gp; for (gp=glolist;gp != (glosym_p) 0; gp=gp->gl_next) if (strcmp(gp->gl_name,name)==0) diff --git a/mach/proto/cg/main.c b/mach/proto/cg/main.c index f7fc09a113..ac4c721e00 100644 --- a/mach/proto/cg/main.c +++ b/mach/proto/cg/main.c @@ -29,7 +29,7 @@ extern int endofprog; unsigned ggd(unsigned int a,unsigned int b) { - register unsigned c; + unsigned c; do { c = a%b; a=b; b=c; @@ -40,7 +40,7 @@ unsigned ggd(unsigned int a,unsigned int b) int main(int argc, char **argv) { - register unsigned n; + unsigned n; extern unsigned cc1,cc2,cc3,cc4; diff --git a/mach/proto/cg/move.c b/mach/proto/cg/move.c index 8aa739f8fd..c27961f368 100644 --- a/mach/proto/cg/move.c +++ b/mach/proto/cg/move.c @@ -19,9 +19,9 @@ int move(token_p tp1,token_p tp2,int ply,int toplevel,unsigned int maxcost) { - register move_p mp; - register unsigned t; - register struct reginfo *rp; + move_p mp; + unsigned t; + struct reginfo *rp; tkdef_p tdp; int i; diff --git a/mach/proto/cg/nextem.c b/mach/proto/cg/nextem.c index f0d9af598b..7415c94a55 100644 --- a/mach/proto/cg/nextem.c +++ b/mach/proto/cg/nextem.c @@ -41,9 +41,9 @@ static int argtyp(int mn) { } } -byte *trypat(register byte *bp, int len) +byte *trypat(byte *bp, int len) { - register int patlen,i; + int patlen,i; result_t result; getint(patlen,bp); @@ -91,12 +91,12 @@ byte *trypat(register byte *bp, int len) byte *nextem(int toplevel) { - register int i; + int i; short hash[3]; - register byte *bp; + byte *bp; byte *cp; int index; - register struct emline *ep; + struct emline *ep; if (toplevel) { if (nemlines && emp>emlines) { diff --git a/mach/proto/cg/reg.c b/mach/proto/cg/reg.c index 4675c3557c..ee4865d9fb 100644 --- a/mach/proto/cg/reg.c +++ b/mach/proto/cg/reg.c @@ -20,8 +20,8 @@ static void awayreg(int); void chrefcount(int regno, int amount, int tflag) { - register struct reginfo *rp; - register int i; + struct reginfo *rp; + int i; rp= &machregs[regno]; #if MAXMEMBERS!=0 @@ -41,8 +41,8 @@ void chrefcount(int regno, int amount, int tflag) int getrefcount(int regno, int tflag) { - register struct reginfo *rp; - register int i,maxcount; + struct reginfo *rp; + int i,maxcount; rp= &machregs[regno]; #if MAXMEMBERS!=0 @@ -62,8 +62,8 @@ int getrefcount(int regno, int tflag) void erasereg(int regno) { - register struct reginfo *rp; - register int i; + struct reginfo *rp; + int i; rp = &machregs[regno]; rp->r_contents.t_token = 0; @@ -88,9 +88,9 @@ void erasereg(int regno) static void awayreg(int regno) { - register struct reginfo *rp; - register tkdef_p tdp; - register int i; + struct reginfo *rp; + tkdef_p tdp; + int i; /* Now erase recursively all registers containing * something using this one @@ -113,8 +113,8 @@ static void awayreg(int regno) void cleanregs(void) { - register struct reginfo *rp; - register int i; + struct reginfo *rp; + int i; for (rp=machregs;rpr_contents.t_token = 0; @@ -126,8 +126,8 @@ void cleanregs(void) #ifndef NDEBUG void inctcount(int regno) { - register struct reginfo *rp; - register int i; + struct reginfo *rp; + int i; rp = &machregs[regno]; #if MAXMEMBERS!=0 @@ -145,9 +145,9 @@ void inctcount(int regno) void chkregs(void) { - register struct reginfo *rp; - register token_p tp; - register tkdef_p tdp; + struct reginfo *rp; + token_p tp; + tkdef_p tdp; int i; for (rp=machregs;rprv_next) if(rvlp->rv_off == off) @@ -126,8 +126,8 @@ int isregvar(long off) } void unlinkregs(void) { - register struct regvar *rvlp,*t; - register struct regassigned *ra; + struct regvar *rvlp,*t; + struct regassigned *ra; int rvtyp,i; for(rvlp=rvlist;rvlp!=0;rvlp=t) { diff --git a/mach/proto/cg/salloc.c b/mach/proto/cg/salloc.c index 9355948726..354a37ad0b 100644 --- a/mach/proto/cg/salloc.c +++ b/mach/proto/cg/salloc.c @@ -32,7 +32,7 @@ int nstab=0; static void chkstr(string str,char used[]) { - register int low,middle,high; + int low,middle,high; low=0; high=nstab-1; while (high>low) { @@ -57,7 +57,7 @@ static void chkstr(string str,char used[]) string myalloc(int size) { - register string p; + string p; p = (string) malloc(size); if (p==0) @@ -72,7 +72,7 @@ void myfree(void* p) void popstr(int nnstab) { - register int i; + int i; for (i=nnstab;ist_ns = nstab; } -void restorestatus(register state_p sp) +void restorestatus(state_p sp) { stackheight = sp->st_sh; bmove((short *)sp->st_fs,(short *)fakestack,stackheight*sizeof(token_t)); diff --git a/mach/proto/cg/state.h b/mach/proto/cg/state.h index bb5afcfd16..41ffc08dc4 100644 --- a/mach/proto/cg/state.h +++ b/mach/proto/cg/state.h @@ -29,7 +29,7 @@ typedef struct state { void savestatus(void); #endif -void restorestatus(register state_p sp); -void savestatus(register state_p sp); +void restorestatus(state_p sp); +void savestatus(state_p sp); #endif /* STATE_H_ */ diff --git a/mach/proto/cg/subr.c b/mach/proto/cg/subr.c index 67cc3a4320..071b979fc8 100644 --- a/mach/proto/cg/subr.c +++ b/mach/proto/cg/subr.c @@ -27,9 +27,9 @@ extern unsigned cc1,cc2,cc3,cc4; -int match(register token_p tp, register set_p tep, int optexp) +int match(token_p tp, set_p tep, int optexp) { - register int bitno; + int bitno; token_p ct; result_t result; @@ -54,9 +54,9 @@ int match(register token_p tp, register set_p tep, int optexp) return(result.e_v.e_con); } -void instance(int instno,register token_p token) +void instance(int instno, token_p token) { - register inst_p inp; + inst_p inp; int i; token_p tp; struct reginfo *rp; @@ -134,10 +134,10 @@ void instance(int instno,register token_p token) } } -void cinstance(int instno,register token_p token, - register token_p tp,int regno) +void cinstance(int instno, token_p token, + token_p tp,int regno) { - register inst_p inp; + inst_p inp; int i; struct reginfo *rp; result_t result; @@ -205,8 +205,8 @@ void cinstance(int instno,register token_p token, int eqtoken(token_p tp1,token_p tp2) { - register int i; - register tkdef_p tdp; + int i; + tkdef_p tdp; if (tp1->t_token!=tp2->t_token) return(0); @@ -239,9 +239,9 @@ int eqtoken(token_p tp1,token_p tp2) } int distance(int cindex) { - register byte *bp; - register int i; - register token_p tp; + byte *bp; + int i; + token_p tp; int tokexp,tpl; int expsize,toksize,exact; int xsekt=0; @@ -305,7 +305,7 @@ int ssize(int tokexpno) { return(machsets[tokexpno].set_size); } -int tsize(register token_p tp) +int tsize(token_p tp) { if (tp->t_token==-1) return(machregs[tp->t_att[0].ar].r_size); @@ -344,9 +344,9 @@ int instsize(int tinstno,token_p tp) { } #endif /* MAXSPLIT */ -void tref(register token_p tp,int amount) { - register int i; - register tkdef_p tdp; +void tref(token_p tp,int amount) { + int i; + tkdef_p tdp; if (tp->t_token==-1) chrefcount(tp->t_att[0].ar,amount,FALSE); @@ -366,7 +366,7 @@ int split(token_p tp,int *ip,int ply,int toplevel) c2_p cp; token_t savestack[MAXSAVE]; int ok; - register int i; + int i; int diff; token_p stp; int tpl; @@ -435,7 +435,7 @@ unsigned stackupto(token_p limit,int ply,int toplevel) int nareg; /* saved nareg */ int areg[MAXALLREG]; c1_p cp; - register token_p tp; + token_p tp; unsigned totalcost=0; struct reginfo *rp,**rpp; @@ -487,10 +487,10 @@ unsigned stackupto(token_p limit,int ply,int toplevel) c3_p findcoerc(token_p tp,set_p tep) { - register c3_p cp; + c3_p cp; token_t rtoken; - register int i; - register struct reginfo **rpp; + int i; + struct reginfo **rpp; for (cp=c3coercs;cp< &c3coercs[NC3]; cp++) { if (tp!=(token_p) 0) { diff --git a/mach/proto/cg/subr.h b/mach/proto/cg/subr.h index 8d3e78addd..650c940022 100644 --- a/mach/proto/cg/subr.h +++ b/mach/proto/cg/subr.h @@ -11,21 +11,21 @@ #include "data.h" #include "types.h" -int match(register token_p tp, register set_p tep, int optexp); -void instance(int instno,register token_p token); -void cinstance(int instno,register token_p token, +int match(token_p tp, set_p tep, int optexp); +void instance(int instno, token_p token); +void cinstance(int instno, token_p token, register token_p tp,int regno); int eqtoken(token_p tp1,token_p tp2); int distance(int cindex); unsigned costcalc(cost_t cost); int ssize(int tokexpno); -int tsize(register token_p tp); +int tsize(token_p tp); #ifdef MAXSPLIT int instsize(int tinstno,token_p tp); #endif /* MAXSPLIT */ -void tref(register token_p tp,int amount); +void tref(token_p tp,int amount); #ifdef MAXSPLIT int split(token_p tp,int *ip,int ply,int toplevel); diff --git a/mach/proto/fp/add_ext.c b/mach/proto/fp/add_ext.c index 5bde636fe7..b2b18e0df2 100644 --- a/mach/proto/fp/add_ext.c +++ b/mach/proto/fp/add_ext.c @@ -13,7 +13,7 @@ void add_ext(e1,e2) -register EXTEND *e1,*e2; +EXTEND *e1,*e2; { if ((e2->m1 | e2->m2) == 0L) { return; diff --git a/mach/proto/fp/div_ext.c b/mach/proto/fp/div_ext.c index 96a3464ce7..c36aa82d46 100644 --- a/mach/proto/fp/div_ext.c +++ b/mach/proto/fp/div_ext.c @@ -37,8 +37,8 @@ EXTEND *e1,*e2; short count; #else unsigned short u[9], v[5]; - register int j; - register unsigned short *u_p = u; + int j; + unsigned short *u_p = u; int maxv = 4; #endif diff --git a/mach/proto/fp/extend.c b/mach/proto/fp/extend.c index 3b9d6158f7..2808531e88 100644 --- a/mach/proto/fp/extend.c +++ b/mach/proto/fp/extend.c @@ -38,7 +38,7 @@ unsigned long *from; EXTEND *to; int size; { - register char *cpt1; + char *cpt1; unsigned long tmp; int leadbit = 0; diff --git a/mach/proto/fp/fef4.c b/mach/proto/fp/fef4.c index 71bd86b856..d1e30f6b26 100644 --- a/mach/proto/fp/fef4.c +++ b/mach/proto/fp/fef4.c @@ -17,7 +17,7 @@ SINGLE s1; struct fef4_returns *r; { EXTEND buf; - register struct fef4_returns *p = r; /* make copy; r might refer + struct fef4_returns *p = r; /* make copy; r might refer to itself (see table) */ diff --git a/mach/proto/fp/fef8.c b/mach/proto/fp/fef8.c index 3b177ac9bc..7720cd98d9 100644 --- a/mach/proto/fp/fef8.c +++ b/mach/proto/fp/fef8.c @@ -17,7 +17,7 @@ DOUBLE s1; struct fef8_returns *r; { EXTEND buf; - register struct fef8_returns *p = r; /* make copy, r might refer + struct fef8_returns *p = r; /* make copy, r might refer to itself (see table) */ diff --git a/mach/proto/fp/mul_ext.c b/mach/proto/fp/mul_ext.c index c2061f2565..fc109aa1ce 100644 --- a/mach/proto/fp/mul_ext.c +++ b/mach/proto/fp/mul_ext.c @@ -18,11 +18,11 @@ void mul_ext(e1,e2) EXTEND *e1,*e2; { - register int i,j; /* loop control */ + int i,j; /* loop control */ unsigned short mp[4]; /* multiplier */ unsigned short mc[4]; /* multipcand */ unsigned short result[8]; /* result */ - register unsigned short *pres; + unsigned short *pres; /* first save the sign (XOR) */ e1->sign ^= e2->sign; diff --git a/mach/proto/grind/atlin.c b/mach/proto/grind/atlin.c index 37f604df6f..77c4a70dcc 100644 --- a/mach/proto/grind/atlin.c +++ b/mach/proto/grind/atlin.c @@ -22,10 +22,10 @@ static struct message_hdr ok_message; static char * BUFTOA(p) - register char *p; + char *p; { - register long l = 0; - register int i; + long l = 0; + int i; for (i = PS; i>0; i--) { l = (l << 8) | (*p++ & 0377); @@ -35,10 +35,10 @@ BUFTOA(p) static long BUFTOL(p) - register char *p; + char *p; { - register long l = 0; - register int i; + long l = 0; + int i; for (i = LS; i>0; i--) { l = (l << 8) | (*p++ & 0377); @@ -48,11 +48,11 @@ BUFTOL(p) static ATOBUF(p, cp) - register char *p; + char *p; char *cp; { - register int i; - register long l = (long) cp; + int i; + long l = (long) cp; p += PS; for (i = PS; i > 0; i--) { @@ -63,10 +63,10 @@ ATOBUF(p, cp) static LTOBUF(p, l) - register char *p; - register long l; + char *p; + long l; { - register int i; + int i; p += LS; for (i = LS; i > 0; i--) { @@ -200,8 +200,8 @@ do_request() { /* obtain a request from the debugger and perform it */ int fail = 0; - register int i; - register char *c; + int i; + char *c; char *c1; long sz; struct message_hdr message; @@ -413,7 +413,7 @@ sigcatch() static int check_bp() { - register int i; + int i; for (i = 0; i < nbp; i++) { if (bp[i] == retaddr) { @@ -426,7 +426,7 @@ check_bp() static int check_trace() { - register int i; + int i; for (i = 0; i < ntrace; i++) { if (trace_buf[i].begin_trace <= retaddr && @@ -440,7 +440,7 @@ check_trace() static send_ok(type) { - register int i; + int i; ok_message.m_type = type; LTOBUF(ok_message.m_buf+1, (long) retaddr); diff --git a/mach/proto/ncg/compute.c b/mach/proto/ncg/compute.c index aa97329a41..4dfc86d1f6 100644 --- a/mach/proto/ncg/compute.c +++ b/mach/proto/ncg/compute.c @@ -100,7 +100,7 @@ static string mycat(string s1, string s2) { } string mystrcpy(string s) { - register string r; + string r; r=salloc(strlen(s)); strcpy(r,s); diff --git a/mach/proto/ncg/fillem.c b/mach/proto/ncg/fillem.c index 6308967715..270c9442a2 100644 --- a/mach/proto/ncg/fillem.c +++ b/mach/proto/ncg/fillem.c @@ -706,7 +706,7 @@ static void switchseg(int s) { } static void savelab(void) { - register char *p,*q; + char *p,*q; part_flush(); if (labstr[0]) { diff --git a/mach/sparc/ce/ce.src/ms_reg.c b/mach/sparc/ce/ce.src/ms_reg.c index 017fea09e2..540e10dd8b 100644 --- a/mach/sparc/ce/ce.src/ms_reg.c +++ b/mach/sparc/ce/ce.src/ms_reg.c @@ -420,13 +420,13 @@ arith l; void C_scon(s, l) -register char *s; -register arith l; +char *s; +arith l; { if (db_mes) { fprint(codefile, ".stabs \""); while (--l) { - register int c = *s++; + int c = *s++; if (isprint(c) && c != '"' && c != '\\') fprint(codefile, "%c", c); diff --git a/mach/sparc/ce_cg/convert.c b/mach/sparc/ce_cg/convert.c index acc89b82cb..8d266bba43 100644 --- a/mach/sparc/ce_cg/convert.c +++ b/mach/sparc/ce_cg/convert.c @@ -36,7 +36,7 @@ main(argc,argv) char **argv; { struct e_instr buf; - register struct e_instr *p = &buf; + struct e_instr *p = &buf; int ac; char **av; diff --git a/mach/sparc/libsys/_sigvec.c b/mach/sparc/libsys/_sigvec.c index 378d465a39..86090a4411 100644 --- a/mach/sparc/libsys/_sigvec.c +++ b/mach/sparc/libsys/_sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sparc/libsys/sigvec.c b/mach/sparc/libsys/sigvec.c index c63461ce4a..73d906e03d 100644 --- a/mach/sparc/libsys/sigvec.c +++ b/mach/sparc/libsys/sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sparc/libsys/uname.c b/mach/sparc/libsys/uname.c index 4670c25c88..67da9978b0 100644 --- a/mach/sparc/libsys/uname.c +++ b/mach/sparc/libsys/uname.c @@ -10,9 +10,9 @@ static char ver[] = "vm"; static char mach[] = "sun"; uname(nm) - register struct utsname *nm; + struct utsname *nm; { - register char *p = nm->nodename; + char *p = nm->nodename; while (p <= nm->release) *p++ = 0; if (gethostname(nm->nodename,9) == -1) { diff --git a/mach/sun2/libsys/_sigvec.c b/mach/sun2/libsys/_sigvec.c index 0a8225afd5..1d4735865e 100644 --- a/mach/sun2/libsys/_sigvec.c +++ b/mach/sun2/libsys/_sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; _sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sun2/libsys/sigvec.c b/mach/sun2/libsys/sigvec.c index 9b2fb21f84..ab4df35556 100644 --- a/mach/sun2/libsys/sigvec.c +++ b/mach/sun2/libsys/sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sun3/ce/as.c b/mach/sun3/ce/as.c index a9fa7eef29..824f27ce15 100644 --- a/mach/sun3/ce/as.c +++ b/mach/sun3/ce/as.c @@ -18,8 +18,8 @@ char *m; process_operand( str, op) -register char *str; -register struct t_operand *op; +char *str; +struct t_operand *op; { char *glob_lbl(), *strchr(); @@ -171,7 +171,7 @@ char *reg; } int is_reg( str) -register char *str; +char *str; { switch ( *str) { case 'a' : @@ -199,7 +199,7 @@ char *lbl; int mode_reg( eaddr) -register struct t_operand *eaddr; +struct t_operand *eaddr; { switch ( eaddr->type) { case IS_A_REG : return( 0x08 | eaddr->reg); @@ -240,7 +240,7 @@ register struct t_operand *eaddr; code_extension( eaddr) -register struct t_operand *eaddr; +struct t_operand *eaddr; { switch ( eaddr->type) { @@ -365,9 +365,9 @@ struct t_operand *dst; int two_log( nr) -register int nr; +int nr; { - register int log; + int log; for ( log = 0; nr >= 2; nr >>= 1) log++; diff --git a/mach/sun3/ce/end_back.c b/mach/sun3/ce/end_back.c index 152ca50749..b7f779a631 100644 --- a/mach/sun3/ce/end_back.c +++ b/mach/sun3/ce/end_back.c @@ -16,8 +16,8 @@ end_back() static finish_tables() { - register struct outname *np = symbol_table; - register int i = nname; + struct outname *np = symbol_table; + int i = nname; for (; i; i--, np++) { if ((np->on_type & S_COM) && ! (np->on_type & S_EXT)) { diff --git a/mach/sun3/ce/output.c b/mach/sun3/ce/output.c index 8f89e2c319..22dbdc7dcc 100644 --- a/mach/sun3/ce/output.c +++ b/mach/sun3/ce/output.c @@ -30,9 +30,9 @@ static convert_name(), convert_reloc(), init_unixheader(); output_back() { - register int i; - register struct nlist *u_name; - register struct outrelo *rp; + int i; + struct nlist *u_name; + struct outrelo *rp; /* * Convert relocation data structures. This also requires @@ -106,13 +106,13 @@ reduce_name_table() #define S_NEEDED S_MOD #define removable(nm) (!(nm->on_type & (S_NEEDED|S_STB)) && *(nm->on_foff+string_area) == GENLAB) - register int *diff_index = + int *diff_index = (int *) Malloc((unsigned)(nname + 1) * sizeof(int)); - register int i; - register struct outname *np; + int i; + struct outname *np; char *new_str; - register char *p, *q; - register struct relocation_info *rp; + char *p, *q; + struct relocation_info *rp; *diff_index++ = 0; rp = u_reloc; @@ -199,8 +199,8 @@ init_unixheader() static convert_reloc( a_relo, u_relo) -register struct outrelo *a_relo; -register struct relocation_info *u_relo; +struct outrelo *a_relo; +struct relocation_info *u_relo; { int retval = 1; @@ -238,8 +238,8 @@ register struct relocation_info *u_relo; static convert_name( a_name, u_name) -register struct outname *a_name; -register struct nlist *u_name; +struct outname *a_name; +struct nlist *u_name; { /* print( "naam is %s\n", a_name->on_foff + string_area); */ diff --git a/mach/sun3/ce/relocation.c b/mach/sun3/ce/relocation.c index 7a8595c17c..817df5224c 100644 --- a/mach/sun3/ce/relocation.c +++ b/mach/sun3/ce/relocation.c @@ -8,7 +8,7 @@ extern long B_base_address[]; do_local_relocation() { - register struct outrelo *rp; + struct outrelo *rp; /* print( "n relocation records %d\n", relo - reloc_info); */ @@ -16,10 +16,10 @@ do_local_relocation() B_base_address[SEGCON] = text - text_area; B_base_address[SEGBSS] = B_base_address[SEGCON] + data - data_area; for ( rp = reloc_info; rp < relo; rp++) { - register struct outname *np = &symbol_table[rp->or_nami]; + struct outname *np = &symbol_table[rp->or_nami]; if ( np->on_valu != -1 && ! (np->on_type & S_COM)) { - register char *sect; + char *sect; switch( rp->or_sect - S_MIN) { case SEGTXT: diff --git a/mach/sun3/cv/Xcv.c b/mach/sun3/cv/Xcv.c index 696155959b..9c6ff54cd0 100644 --- a/mach/sun3/cv/Xcv.c +++ b/mach/sun3/cv/Xcv.c @@ -47,7 +47,7 @@ main(argc, argv) int argc; char *argv[]; { - register struct outsect *p; + struct outsect *p; char *malloc(); input = stdin; @@ -129,10 +129,10 @@ symtab(name, string) struct outname *name; char *string; { - register struct outname *oname = name; - register char *strings = string+nstrings; - register int c; - register char *b; + struct outname *oname = name; + char *strings = string+nstrings; + int c; + char *b; struct nlist n; oname->on_valu = 0; oname->on_foff = strings - string + OFF_CHAR(outhead); oname->on_desc = 0; diff --git a/mach/sun3/cv/cv.c b/mach/sun3/cv/cv.c index 5a5670d50e..58be11dad9 100644 --- a/mach/sun3/cv/cv.c +++ b/mach/sun3/cv/cv.c @@ -109,7 +109,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -120,7 +120,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; program= argv[0] ; if ( argc>1 && argv[1][0]=='-' ) { @@ -328,8 +328,8 @@ emit_relo() { struct outrelo *ACKrelo; struct machrelo *MACHtrelo,*MACHdrelo; - register struct outrelo *ap; - register struct machrelo *mtp, *mdp; + struct outrelo *ap; + struct machrelo *mtp, *mdp; unsigned int cnt = outhead.oh_nrelo; ACKrelo = (struct outrelo *) calloc(cnt, sizeof(struct outrelo)); @@ -343,7 +343,7 @@ emit_relo() rd_relo(ACKrelo, cnt); rd_name(ACKnames, outhead.oh_nname); while (cnt-- != 0) { - register struct machrelo *mp; + struct machrelo *mp; if (ap->or_sect - S_MIN <= ROMSG) mp = mtp++; else mp = mdp++; @@ -383,7 +383,7 @@ get(sz) { char buf[10]; long l = 0; - register char *p = buf; + char *p = buf; read(output,buf,sz); while (sz--) { @@ -396,7 +396,7 @@ put(l,sz) long l; { char buf[10]; - register char *p = buf; + char *p = buf; *p++ = l >> 24; *p++ = l >> 16; @@ -409,9 +409,9 @@ put(l,sz) } patch(ap, an, mp) - register struct outrelo *ap; - register struct outname *an; - register struct machrelo *mp; + struct outrelo *ap; + struct outname *an; + struct machrelo *mp; { int whichsect = (an->on_type & S_TYP) - S_MIN; long correction = 0; @@ -487,8 +487,8 @@ cvshort(s) int is_rest_local(A, i) - register int i; - register struct outname *A; + int i; + struct outname *A; { while (i--) { if (A->on_type & S_EXT) return 0; @@ -499,10 +499,10 @@ is_rest_local(A, i) emit_symtab() { - register unsigned short i = outhead.oh_nname; - register struct outname *A; + unsigned short i = outhead.oh_nname; + struct outname *A; struct sym *MACHnames; - register struct sym *M; + struct sym *M; char *chars; long offX = OFF_CHAR(outhead) - 4; diff --git a/mach/sun3/libsys/_sigvec.c b/mach/sun3/libsys/_sigvec.c index 0a8225afd5..1d4735865e 100644 --- a/mach/sun3/libsys/_sigvec.c +++ b/mach/sun3/libsys/_sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; _sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sun3/libsys/sigvec.c b/mach/sun3/libsys/sigvec.c index 9b2fb21f84..ab4df35556 100644 --- a/mach/sun3/libsys/sigvec.c +++ b/mach/sun3/libsys/sigvec.c @@ -6,7 +6,7 @@ extern int _sigtramp(); extern int errno; sigvec(sig,vec,ovec) - register struct sigvec *vec; + struct sigvec *vec; struct sigvec *ovec; { struct sigvec tmp; diff --git a/mach/sun3/libsys/uname.c b/mach/sun3/libsys/uname.c index 4670c25c88..67da9978b0 100644 --- a/mach/sun3/libsys/uname.c +++ b/mach/sun3/libsys/uname.c @@ -10,9 +10,9 @@ static char ver[] = "vm"; static char mach[] = "sun"; uname(nm) - register struct utsname *nm; + struct utsname *nm; { - register char *p = nm->nodename; + char *p = nm->nodename; while (p <= nm->release) *p++ = 0; if (gethostname(nm->nodename,9) == -1) { diff --git a/mach/vax4/as/mach5.c b/mach/vax4/as/mach5.c index 73658ef6c5..75ec813b45 100644 --- a/mach/vax4/as/mach5.c +++ b/mach/vax4/as/mach5.c @@ -12,7 +12,7 @@ #define rev_cond_branch(opc) ((opc) ^ 1) /* Process one operand. */ -static void oprnd(register struct operand *p) +static void oprnd(struct operand *p) { int sm; @@ -203,9 +203,9 @@ static void oprnd(register struct operand *p) /* Give an upper bound on the size of the operands */ static int size_ops(void) { - register struct operand *p = &opnd[0]; - register int i; - register int sz = 0; + struct operand *p = &opnd[0]; + int i; + int sz = 0; for (i = op_ind; i > 0; i--) { if (p->index_reg >= 0 && p->mode != DISPL) { @@ -337,7 +337,7 @@ void ext_branch(int opc, expr_t exp) /* Generate code for the operands */ void operands(void) { - register int i; + int i; for (i = 0; i < op_ind; i++) { oprnd(&opnd[i]); diff --git a/mach/vax4/ce/as.c b/mach/vax4/ce/as.c index 6d022ba4de..d10726ff9c 100644 --- a/mach/vax4/ce/as.c +++ b/mach/vax4/ce/as.c @@ -57,10 +57,10 @@ char *m; process_operand( arg, op) -register char *arg; -register struct t_operand *op; +char *arg; +struct t_operand *op; { - register char *einde; + char *einde; if ( n_index == 3) n_index = 0; @@ -116,7 +116,7 @@ register struct t_operand *op; char *ind( buf, str) -register char *buf, *str; +char *buf, *str; /* Reads the index in front of '(register)'. */ @@ -129,7 +129,7 @@ register char *buf, *str; char *lab( buf, str) -register char *buf, *str; +char *buf, *str; /* Reads 'label' in front of '+offset'. */ @@ -146,8 +146,8 @@ register char *buf, *str; int is_reg( str, num) -register char *str; -register int *num; +char *str; +int *num; /* Is "str" a 'registers' ? */ @@ -181,7 +181,7 @@ register int *num; char *end_arg( str) -register char *str; +char *str; /* Shift to the last character of "str". */ @@ -193,7 +193,7 @@ register char *str; char *match( str, sym) -register char *str; +char *str; char sym; { while ( *str != sym) @@ -207,7 +207,7 @@ char sym; char my_buf[256]; gen_operand( op) -register struct t_operand *op; +struct t_operand *op; /* Generate object-code for a argument. */ diff --git a/mach/vax4/ce/end_back.c b/mach/vax4/ce/end_back.c index 152ca50749..b7f779a631 100644 --- a/mach/vax4/ce/end_back.c +++ b/mach/vax4/ce/end_back.c @@ -16,8 +16,8 @@ end_back() static finish_tables() { - register struct outname *np = symbol_table; - register int i = nname; + struct outname *np = symbol_table; + int i = nname; for (; i; i--, np++) { if ((np->on_type & S_COM) && ! (np->on_type & S_EXT)) { diff --git a/mach/vax4/ce/output.c b/mach/vax4/ce/output.c index 0251e77442..4b5e2a1359 100644 --- a/mach/vax4/ce/output.c +++ b/mach/vax4/ce/output.c @@ -30,9 +30,9 @@ static convert_name(), convert_reloc(), init_unixheader(); output_back() { - register int i; - register struct nlist *u_name; - register struct outrelo *rp; + int i; + struct nlist *u_name; + struct outrelo *rp; /* * Convert relocation data structures. This also requires @@ -106,13 +106,13 @@ reduce_name_table() #define S_NEEDED S_MOD #define removable(nm) (!(nm->on_type & (S_NEEDED|S_STB)) && *(nm->on_foff+string_area) == GENLAB) - register int *diff_index = + int *diff_index = (int *) Malloc((unsigned)(nname + 1) * sizeof(int)); - register int i; - register struct outname *np; + int i; + struct outname *np; char *new_str; - register char *p, *q; - register struct relocation_info *rp; + char *p, *q; + struct relocation_info *rp; *diff_index++ = 0; rp = u_reloc; @@ -198,8 +198,8 @@ init_unixheader() static convert_reloc( a_relo, u_relo) -register struct outrelo *a_relo; -register struct relocation_info *u_relo; +struct outrelo *a_relo; +struct relocation_info *u_relo; { int retval = 1; @@ -238,8 +238,8 @@ register struct relocation_info *u_relo; static convert_name( a_name, u_name) -register struct outname *a_name; -register struct nlist *u_name; +struct outname *a_name; +struct nlist *u_name; { /* print( "naam is %s\n", a_name->on_foff + string_area); */ diff --git a/mach/vax4/ce/relocation.c b/mach/vax4/ce/relocation.c index c05fe0ddb7..6d7408308b 100644 --- a/mach/vax4/ce/relocation.c +++ b/mach/vax4/ce/relocation.c @@ -8,7 +8,7 @@ extern long B_base_address[]; do_local_relocation() { - register struct outrelo *rp; + struct outrelo *rp; /* print( "n relocation records %d\n", relo - reloc_info); */ @@ -16,10 +16,10 @@ do_local_relocation() B_base_address[SEGCON] = text - text_area; B_base_address[SEGBSS] = B_base_address[SEGCON] + data - data_area; for ( rp = reloc_info; rp < relo; rp++) { - register struct outname *np = &symbol_table[rp->or_nami]; + struct outname *np = &symbol_table[rp->or_nami]; if ( np->on_valu != -1 && ! (np->on_type & S_COM)) { - register char *sect; + char *sect; switch( rp->or_sect - S_MIN) { case SEGTXT: diff --git a/mach/vax4/cg/mach.c b/mach/vax4/cg/mach.c index 66b016d4ef..ef50019dc4 100644 --- a/mach/vax4/cg/mach.c +++ b/mach/vax4/cg/mach.c @@ -16,7 +16,7 @@ static char rcsid[] = "$Id$"; /* * Byte order: | 3 | 2 | 1 | 0 | */ -void con_part(register int sz, word w) +void con_part(int sz, word w) { /* * Align new bytes on boundary of its on size. @@ -206,10 +206,10 @@ void regsave(char *str, long off, int size) */ void f_regsave(void) { - register struct s_reg *p; - register int mask; - register int i; - register int count; + struct s_reg *p; + int mask; + int i; + int count; mask = 0; count = p_reg - a_reg; @@ -260,7 +260,7 @@ regreturn() { } int regscore(long off, int size, int typ, int score, int totyp) { - register int i = score; + int i = score; /* * If the offset doesn't fit in a byte, word-offset is used, diff --git a/mach/vax4/cg/mach.h b/mach/vax4/cg/mach.h index ed58cbbdc6..84d7d14bbe 100644 --- a/mach/vax4/cg/mach.h +++ b/mach/vax4/cg/mach.h @@ -36,6 +36,6 @@ void con_float(void); void con_mult(word sz); -void con_part(register int sz, word w); +void con_part(int sz, word w); void mes(word type); void prolog(full nlocals); diff --git a/mach/vax4/cv/cv.c b/mach/vax4/cv/cv.c index 0345426b35..bcd120848e 100644 --- a/mach/vax4/cv/cv.c +++ b/mach/vax4/cv/cv.c @@ -106,7 +106,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -117,7 +117,7 @@ main(argc, argv) int argc; char *argv[]; { - register int nsect; + int nsect; program= argv[0] ; while ( argc>1 && argv[1][0]=='-' ) { @@ -309,8 +309,8 @@ emit_relo() { struct outrelo *ACKrelo; struct machrelo *MACHtrelo,*MACHdrelo; - register struct outrelo *ap; - register struct machrelo *mtp, *mdp; + struct outrelo *ap; + struct machrelo *mtp, *mdp; unsigned int cnt = outhead.oh_nrelo; ACKrelo = (struct outrelo *) calloc(cnt, sizeof(struct outrelo)); @@ -324,7 +324,7 @@ emit_relo() rd_relo(ACKrelo, cnt); rd_name(ACKnames, outhead.oh_nname); while (cnt-- != 0) { - register struct machrelo *mp; + struct machrelo *mp; if (ap->or_sect - S_MIN <= ROMSG) mp = mtp++; else mp = mdp++; @@ -364,7 +364,7 @@ get(sz) { char buf[10]; long l = 0; - register char *p = buf + sz; + char *p = buf + sz; read(output,buf,sz); while (sz--) { @@ -377,7 +377,7 @@ put(l,sz) long l; { char buf[10]; - register char *p = buf; + char *p = buf; *p++ = l; *p++ = l >> 8; @@ -390,9 +390,9 @@ put(l,sz) } patch(ap, an, mp) - register struct outrelo *ap; - register struct outname *an; - register struct machrelo *mp; + struct outrelo *ap; + struct outname *an; + struct machrelo *mp; { int whichsect = (an->on_type & S_TYP) - S_MIN; long correction = 0; @@ -468,8 +468,8 @@ cvshort(s) int is_rest_local(A, i) - register int i; - register struct outname *A; + int i; + struct outname *A; { while (i--) { if (A->on_type & S_EXT) return 0; @@ -480,10 +480,10 @@ is_rest_local(A, i) emit_symtab() { - register unsigned short i = outhead.oh_nname; - register struct outname *A; + unsigned short i = outhead.oh_nname; + struct outname *A; struct sym *MACHnames; - register struct sym *M; + struct sym *M; char *chars; long offX = OFF_CHAR(outhead) - 4; diff --git a/mach/xenix3/cv/cv.c b/mach/xenix3/cv/cv.c index 921eeba5b0..44910bddf3 100644 --- a/mach/xenix3/cv/cv.c +++ b/mach/xenix3/cv/cv.c @@ -118,7 +118,7 @@ long align(a,b) int follows(pa, pb) - register struct outsect *pa, *pb; + struct outsect *pa, *pb; { /* return 1 if pa follows pb */ @@ -135,7 +135,7 @@ main(argc, argv) program= argv[0] ; if ( argc>1 && argv[1][0]=='-' ) { if (argv[1][1] == 'F') { - register char *p = &argv[1][2]; + char *p = &argv[1][2]; stacksize = 0; while (*p) { @@ -282,8 +282,8 @@ char buf[0300]; header() { - register char *p = buf; - register int i; + char *p = buf; + int i; shortcvt(exec.x_magic, p); shortcvt(exec.x_ext, p); @@ -334,8 +334,8 @@ header() * Transfer the emitted byted from one file to another. */ emits(section) struct outsect *section ; { - register long n ; - register int blk; + long n ; + int blk; char buffer[BUFSIZ]; n= section->os_flen ; @@ -361,17 +361,17 @@ emits(section) struct outsect *section ; { long emit_symtab() { - register unsigned short i; + unsigned short i; struct xnm { unsigned short s_type, s_seg; long s_value; } xnm; char *chars, *xname; struct outname *names; - register char *xptr; + char *xptr; extern char *malloc(); long off = OFF_CHAR(outhead); - register char *p; + char *p; chars = malloc((unsigned)(outhead.oh_nchar)); if (! chars) return 0; diff --git a/mach/z80/as/mach1.c b/mach/z80/as/mach1.c index c201dca2c5..9895090853 100644 --- a/mach/z80/as/mach1.c +++ b/mach/z80/as/mach1.c @@ -40,4 +40,4 @@ extern int rel_ind; */ void xyreg(int r,int byte); void xymem(int r,int byte); -void branch(register int opc,expr_t exp); +void branch(int opc,expr_t exp); diff --git a/mach/z80/as/mach5.c b/mach/z80/as/mach5.c index 64da160870..7ff90d7c86 100644 --- a/mach/z80/as/mach5.c +++ b/mach/z80/as/mach5.c @@ -33,9 +33,9 @@ void xymem(int r,int byte) } } -void branch(register int opc,expr_t exp) +void branch(int opc,expr_t exp) { - register int sm,dist; + int sm,dist; dist = exp.val - (DOTVAL + 2); if (pass == PASS_2 && dist > 0 && !(exp.typ & S_DOT)) diff --git a/mach/z80/cg/mach.c b/mach/z80/cg/mach.c index 1ab1cd0fab..49d63c88c0 100644 --- a/mach/z80/cg/mach.c +++ b/mach/z80/cg/mach.c @@ -9,7 +9,7 @@ */ -void con_part(register int sz, word w) +void con_part(int sz, word w) { while (part_size % sz) diff --git a/mach/z80/cg/mach.h b/mach/z80/cg/mach.h index a0e1eb2718..c24bc64ae4 100644 --- a/mach/z80/cg/mach.h +++ b/mach/z80/cg/mach.h @@ -35,6 +35,6 @@ void con_float(void); void con_mult(word sz); -void con_part(register int sz, word w); +void con_part(int sz, word w); void mes(word type); void prolog(full nlocals); diff --git a/mach/z80/int/cv.c b/mach/z80/int/cv.c index fa141ff559..fbb8c62b6c 100644 --- a/mach/z80/int/cv.c +++ b/mach/z80/int/cv.c @@ -11,7 +11,7 @@ unsigned memaddr = 0x100; main() { char buf[256]; - register i,len; + i,len; while((len=read(0,buf,sizeof(buf))) > 0) { putw(memaddr,stdout); diff --git a/mach/z80/int/dl.c b/mach/z80/int/dl.c index 8d79832b3d..f7a1df01dd 100644 --- a/mach/z80/int/dl.c +++ b/mach/z80/int/dl.c @@ -29,8 +29,8 @@ char *progname; char hex[] = "0123456789ABCDEF"; main(argc,argv) char **argv; { - register nd,pc,sg,osg,first; - register char *s; + nd,pc,sg,osg,first; + char *s; int uid; progname = argv[0]; @@ -164,7 +164,7 @@ put(c) { } reply() { - register i; + i; int c; if (echo == 0) @@ -175,7 +175,7 @@ reply() { } get2c(f) FILE *f; { - register c; + c; c = getc(f); return((getc(f) << 8) | c); diff --git a/mach/z8000/cg/mach.c b/mach/z8000/cg/mach.c index 38b7dd6d5b..7f7bac3f59 100644 --- a/mach/z8000/cg/mach.c +++ b/mach/z8000/cg/mach.c @@ -9,7 +9,7 @@ * machine dependent back end routines for the z8000 */ -void con_part(register int sz, word w) +void con_part(int sz, word w) { while (part_size % sz) part_size++; diff --git a/mach/z8000/cg/mach.h b/mach/z8000/cg/mach.h index 7a54dd0b71..fa8dd61208 100644 --- a/mach/z8000/cg/mach.h +++ b/mach/z8000/cg/mach.h @@ -33,6 +33,6 @@ void con_float(void); void con_mult(word sz); -void con_part(register int sz, word w); +void con_part(int sz, word w); void mes(word type); void prolog(full nlocals); diff --git a/modules/src/alloc/Malloc.c b/modules/src/alloc/Malloc.c index 567b2dc08f..793334ea56 100644 --- a/modules/src/alloc/Malloc.c +++ b/modules/src/alloc/Malloc.c @@ -19,7 +19,7 @@ extern char *malloc(); char *Malloc(unsigned int sz) { - register char *res = malloc(sz); + char *res = malloc(sz); if (sz && res == 0) No_Mem(); return res; diff --git a/modules/src/alloc/Realloc.c b/modules/src/alloc/Realloc.c index 35c6fbf1dc..29f946779d 100644 --- a/modules/src/alloc/Realloc.c +++ b/modules/src/alloc/Realloc.c @@ -21,7 +21,7 @@ extern char *realloc(); char *Realloc(char ptr[], unsigned int sz) { - register char *mptr; + char *mptr; if (!ptr) mptr = malloc(sz); else mptr = realloc(ptr, sz); diff --git a/modules/src/alloc/Salloc.c b/modules/src/alloc/Salloc.c index 1422b1878d..fbd3a9429e 100644 --- a/modules/src/alloc/Salloc.c +++ b/modules/src/alloc/Salloc.c @@ -19,13 +19,13 @@ extern char *malloc(); #include "alloc.h" -char *Salloc(register char *str, register unsigned int sz) +char *Salloc(char *str, unsigned int sz) { /* Salloc() is not a primitive function: it just allocates a piece of storage and copies a given string into it. */ char *res = malloc(sz); - register char *m = res; + char *m = res; if (sz && m == 0) No_Mem(); while (sz--) diff --git a/modules/src/alloc/botch.c b/modules/src/alloc/botch.c index 0946272528..e27c0adceb 100644 --- a/modules/src/alloc/botch.c +++ b/modules/src/alloc/botch.c @@ -9,7 +9,7 @@ #include "alloc.h" -void botch(register char *ptr, register unsigned int n) +void botch(char *ptr, unsigned int n) { while (n >= sizeof (long)) { /* high-speed botch loop */ diff --git a/modules/src/alloc/clear.c b/modules/src/alloc/clear.c index 4cf0c87def..927fd0bd0d 100644 --- a/modules/src/alloc/clear.c +++ b/modules/src/alloc/clear.c @@ -10,9 +10,9 @@ /* instead of Calloc: */ -void clear(register char *ptr, register unsigned int n) +void clear(char *ptr, unsigned int n) { - register long *q = (long *) ptr; + long *q = (long *) ptr; while (n >= 8*sizeof (long)) { /* high-speed clear loop */ diff --git a/modules/src/alloc/st_alloc.c b/modules/src/alloc/st_alloc.c index 0457420cc4..b0828e21fe 100644 --- a/modules/src/alloc/st_alloc.c +++ b/modules/src/alloc/st_alloc.c @@ -19,10 +19,10 @@ extern char *malloc(); #include "alloc.h" -char *st_alloc(char **phead, register unsigned int size, int count) +char *st_alloc(char **phead, unsigned int size, int count) { - register char *p = NULL; - register long *q; + char *p = NULL; + long *q; char *retval; if (*phead == 0) { diff --git a/modules/src/alloc/std_alloc.c b/modules/src/alloc/std_alloc.c index c66eb8d116..0b8f460024 100644 --- a/modules/src/alloc/std_alloc.c +++ b/modules/src/alloc/std_alloc.c @@ -17,10 +17,10 @@ extern char *malloc(); #include "alloc.h" -char *std_alloc(char **phead, register unsigned int size, int count, int *pcnt) +char *std_alloc(char **phead, unsigned int size, int count, int *pcnt) { - register char *p; - register long *q; + char *p; + long *q; char *retval; if (*phead == 0) { diff --git a/modules/src/em_code/C_out.c b/modules/src/em_code/C_out.c index f03c10c451..76b4ff1081 100644 --- a/modules/src/em_code/C_out.c +++ b/modules/src/em_code/C_out.c @@ -24,7 +24,7 @@ struct e_instr *C_alloc(void) return &b; } -int C_out(register struct e_instr *p) +int C_out(struct e_instr *p) { /* Generate EM-code from the e_instr structure "p" */ @@ -79,7 +79,7 @@ int C_out(register struct e_instr *p) return 1; } -static void arg(register struct e_instr *p, int comma) +static void arg(struct e_instr *p, int comma) { /* Output the argument of "p". */ @@ -140,7 +140,7 @@ static void arg(register struct e_instr *p, int comma) } } -static void pseudo(register struct e_instr *p) +static void pseudo(struct e_instr *p) { PS(p->em_opcode); diff --git a/modules/src/em_code/convert.c b/modules/src/em_code/convert.c index 0e24c820b2..81a3b52964 100644 --- a/modules/src/em_code/convert.c +++ b/modules/src/em_code/convert.c @@ -32,7 +32,7 @@ main(argc,argv) char **argv; { struct e_instr buf; - register struct e_instr *p = &buf; + struct e_instr *p = &buf; if (argc >= 2) { filename = argv[1]; diff --git a/modules/src/em_code/em.c b/modules/src/em_code/em.c index 96712ef10b..f0eeae41fa 100644 --- a/modules/src/em_code/em.c +++ b/modules/src/em_code/em.c @@ -175,7 +175,7 @@ void C_magic(void) /*** the readable code generating routines ***/ -static int wrs(register char *s) +static int wrs(char *s) { while (*s) { @@ -218,7 +218,7 @@ void C_pt_cst(arith l) void C_pt_scon(char *x, arith y) { char xbuf[1024]; - register char *p; + char *p; C_putbyte('\''); p = bts2str(x, (int) y, xbuf); @@ -329,7 +329,7 @@ void C_magic(void) #define fit16i(x) ((x) >= (long)(-0x8000) && (x) <= (long)0x7FFF) #define fit8u(x) ((x) <= 0xFF) /* x is already unsigned */ -void C_pt_ilb(register label l) +void C_pt_ilb(label l) { if (fit8u(l)) { put8(sp_ilb1); @@ -341,7 +341,7 @@ void C_pt_ilb(register label l) } } -void C_pt_dlb(register label l) +void C_pt_dlb(label l) { if (fit8u(l)) { put8(sp_dlb1); @@ -353,7 +353,7 @@ void C_pt_dlb(register label l) } } -void C_pt_cst(register arith l) +void C_pt_cst(arith l) { if (l >= (arith) -sp_zcst0 && l < (arith) (sp_ncst0 - sp_zcst0)) { /* we can convert 'l' to an int because its value @@ -384,9 +384,9 @@ void C_pt_doff(label l, arith v) } } -void C_pt_str(register char *s) +void C_pt_str(char *s) { - register int len; + int len; C_pt_cst((arith) (len = strlen(s))); while (--len >= 0) { @@ -426,7 +426,7 @@ void C_pt_wcon(int sp, char* v, arith sz) /* sp_icon, sp_ucon or sp_fcon with in C_pt_str(v); } -void C_pt_scon(register char *b, register arith n) +void C_pt_scon(char *b, arith n) { put8(sp_scon); C_pt_cst(n); diff --git a/modules/src/em_code/insert.c b/modules/src/em_code/insert.c index 2048d04140..ae0aa80d1e 100644 --- a/modules/src/em_code/insert.c +++ b/modules/src/em_code/insert.c @@ -65,7 +65,7 @@ getbyte(b) } #endif -static void C_out_parts(register PartOfPart *pp); +static void C_out_parts(PartOfPart *pp); static Part *C_findpart(int part); static int outpart(int id) @@ -81,7 +81,7 @@ static int outpart(int id) return 0; } -static void C_out_parts(register PartOfPart *pp) +static void C_out_parts(PartOfPart *pp) { /* Output the list of chunks started by "pp". The list is build in reverse order, so this routine is @@ -103,7 +103,7 @@ static void C_out_parts(register PartOfPart *pp) } else { /* copy the chunk to output */ - register long b = pp->pp_begin; + long b = pp->pp_begin; while (b < pp->pp_end) { #ifdef INCORE @@ -128,7 +128,7 @@ static Part *C_findpart(int part) /* Look for part "part" in the table. Return 0 if not present, */ - register Part *p = C_stable[part % TABSIZ]; + Part *p = C_stable[part % TABSIZ]; while (p && p->p_id != part) { p = p->p_next; @@ -145,7 +145,7 @@ static int swttmp(void) if (C_tmpfile == NULL) { static char tmpbuf[FILENAME_MAX]; - register char *p = tmpbuf; + char *p = tmpbuf; if (C_tmpdir == NULL) { @@ -221,8 +221,8 @@ static int available(int part) /* See if part "part", and all the parts it consists of, are available. Return 1 if they are, 0 otherwize */ - register Part *p = C_findpart(part); - register PartOfPart *pp; + Part *p = C_findpart(part); + PartOfPart *pp; int retval = 1; if (p == 0) return 0; @@ -255,8 +255,8 @@ static Part *mkpart(int part) pointer to it, after checking that is does not exist already. */ - register Part *p = C_findpart(part); - register int index = part % TABSIZ; + Part *p = C_findpart(part); + int index = part % TABSIZ; if (p != 0) { /* multiple defined part ... */ @@ -273,13 +273,13 @@ static Part *mkpart(int part) return p; } -static void end_partofpart(register Part *p) +static void end_partofpart(Part *p) { /* End the current chunk of part *p. */ if (p) { - register PartOfPart *pp = p->p_parts; + PartOfPart *pp = p->p_parts; pp->pp_end = C_current_out - C_BASE; if (pp->pp_begin == pp->pp_end) { @@ -290,12 +290,12 @@ static void end_partofpart(register Part *p) } } -static void resume(register Part *p) +static void resume(Part *p) { /* Resume part "p", by creating a new PartOfPart structure for it. */ - register PartOfPart *pp = (PartOfPart *) Malloc(sizeof(PartOfPart)); + PartOfPart *pp = (PartOfPart *) Malloc(sizeof(PartOfPart)); swttmp(); C_curr_part = p; @@ -311,8 +311,8 @@ void C_insertpart(int part) still set and the part to be inserted is available now, just write it out. */ - register Part *p; - register PartOfPart *pp; + Part *p; + PartOfPart *pp; C_outpart = outpart; C_swttmp = swttmp; @@ -348,7 +348,7 @@ void C_beginpart(int part) Suspend the current part, and add part "part" to the table. */ - register Part *p = mkpart(part); + Part *p = mkpart(part); C_outpart = outpart; C_swttmp = swttmp; @@ -365,7 +365,7 @@ void C_endpart(int part) /* End the current part. The parameter "part" is just there for the checking. Do we really need it ??? */ - register Part *p = C_curr_part; + Part *p = C_curr_part; if (p->p_id != part) { /* illegal C_endpart ... */ diff --git a/modules/src/em_opt/findworst.c b/modules/src/em_opt/findworst.c index 10b9451201..2ef0b139e3 100644 --- a/modules/src/em_opt/findworst.c +++ b/modules/src/em_opt/findworst.c @@ -6,8 +6,8 @@ static char rcsidp3[] = "$Id$"; #define UPDATEWORST(backups) if(backups>mostbackups) mostbackups = backups; -PRIVATE int rightmatch(struct mnems,struct mnems,int, int); -PRIVATE int leftmatch(struct mnems, struct mnems, int, int); +static int rightmatch(struct mnems,struct mnems,int, int); +static int leftmatch(struct mnems, struct mnems, int, int); void findworst(struct mnems patt,struct mnems repl) @@ -112,7 +112,7 @@ void findfail(int state, int *resout, int *rescpy, int *resgto) *resgto = 0; } -PRIVATE int leftmatch(struct mnems patt,struct mnems repl,int i,int j) +static int leftmatch(struct mnems patt,struct mnems repl,int i,int j) { /* / Return the first complete match of the mnems of @@ -134,7 +134,7 @@ PRIVATE int leftmatch(struct mnems patt,struct mnems repl,int i,int j) return(0); } -PRIVATE int rightmatch(struct mnems patt,struct mnems repl,int i,int j) +static int rightmatch(struct mnems patt,struct mnems repl,int i,int j) { /* / Return the first complete match of the mnems of diff --git a/modules/src/em_opt/initlex.c b/modules/src/em_opt/initlex.c index b5431bd9ec..4daa881a35 100644 --- a/modules/src/em_opt/initlex.c +++ b/modules/src/em_opt/initlex.c @@ -13,11 +13,11 @@ static char rcsidp2[] = "$Id$"; extern char em_flag[]; extern char em_mnem[][4]; -PRIVATE void idinit(char *, int, int); +static void idinit(char *, int, int); void initlex(void) { - register int i,j; + int i,j; init_idf(); idinit("lab",op_lab,DEFILB); for(i=sp_fmnem;i<=sp_lmnem;i++) { @@ -48,7 +48,7 @@ void initlex(void) } -PRIVATE void idinit(char *tag, int opcode, int argfmt) +static void idinit(char *tag, int opcode, int argfmt) { struct idf *p; p = str2idf(tag,0); diff --git a/modules/src/em_opt/main.c b/modules/src/em_opt/main.c index 0ac5a16174..91163a619d 100644 --- a/modules/src/em_opt/main.c +++ b/modules/src/em_opt/main.c @@ -19,7 +19,7 @@ main(argc,argv) char **argv; { static struct e_instr buff; - register p_instr p = &buff; + p_instr p = &buff; if (argc >= 2) { filename = argv[1]; diff --git a/modules/src/em_opt/mkstrct.c b/modules/src/em_opt/mkstrct.c index fd15948e12..faa961fbd7 100644 --- a/modules/src/em_opt/mkstrct.c +++ b/modules/src/em_opt/mkstrct.c @@ -5,7 +5,7 @@ static char rcsid3[] = "$Id$"; #include "nopt.h" void EM_mkop(p, opcode) - register p_instr p;int opcode; + p_instr p;int opcode; { p->em_type = EM_MNEM; p->em_opcode = opcode; @@ -13,7 +13,7 @@ void EM_mkop(p, opcode) } void EM_mknarg(p, opcode) - register p_instr p;int opcode; + p_instr p;int opcode; { p->em_type = EM_MNEM; p->em_opcode = opcode; @@ -22,7 +22,7 @@ void EM_mknarg(p, opcode) } void EM_mkilb(p, opcode, lab) - register p_instr p;int opcode;label lab; + p_instr p;int opcode;label lab; { p->em_type = EM_MNEM; p->em_argtype = ilb_ptyp; @@ -31,7 +31,7 @@ void EM_mkilb(p, opcode, lab) } void EM_mknof(p, opcode, lab, off) - register p_instr p;int opcode;label lab; + p_instr p;int opcode;label lab; arith off; { p->em_type = EM_MNEM; @@ -42,7 +42,7 @@ void EM_mknof(p, opcode, lab, off) } void EM_mksof(p, opcode, name, off) - register p_instr p;int opcode;char *name; + p_instr p;int opcode;char *name; arith off; { p->em_type = EM_MNEM; @@ -53,7 +53,7 @@ void EM_mksof(p, opcode, name, off) } void EM_mkcst(p, opcode, cst) - register p_instr p;int opcode; + p_instr p;int opcode; arith cst; { p->em_type = EM_MNEM; @@ -63,7 +63,7 @@ void EM_mkcst(p, opcode, cst) } void EM_mkpro(p, opcode, pnam) - register p_instr p;int opcode;char *pnam; + p_instr p;int opcode;char *pnam; { p->em_type = EM_MNEM; p->em_argtype = pro_ptyp; @@ -72,7 +72,7 @@ void EM_mkpro(p, opcode, pnam) } void EM_mkdefilb(p, opcode, deflb) - register p_instr p;int opcode;label deflb; + p_instr p;int opcode;label deflb; { p->em_type = EM_DEFILB; p->em_opcode = opcode; @@ -83,7 +83,7 @@ void EM_mkdefilb(p, opcode, deflb) void EM_Nop(opcode) int opcode; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_opcode = opcode; p->em_argtype = 0; @@ -92,7 +92,7 @@ void EM_Nop(opcode) void EM_Nnarg(opcode) int opcode; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_opcode = opcode; p->em_argtype = 0; @@ -102,7 +102,7 @@ void EM_Nnarg(opcode) void EM_Nilb(opcode, lab) int opcode;label lab; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_argtype = ilb_ptyp; p->em_opcode = opcode; @@ -113,7 +113,7 @@ void EM_Nnof(opcode, lab, off) int opcode;label lab; arith off; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_argtype = nof_ptyp; p->em_opcode = opcode; @@ -125,7 +125,7 @@ void EM_Nsof(opcode, name, off) int opcode;char *name; arith off; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_argtype = sof_ptyp; p->em_opcode = opcode; @@ -137,7 +137,7 @@ void EM_Ncst(opcode, cst) int opcode; arith cst; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_argtype = cst_ptyp; p->em_opcode = opcode; @@ -147,7 +147,7 @@ void EM_Ncst(opcode, cst) void EM_Npro(opcode, pnam) int opcode;char *pnam; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_MNEM; p->em_argtype = pro_ptyp; p->em_opcode = opcode; @@ -157,7 +157,7 @@ void EM_Npro(opcode, pnam) void EM_Ndefilb(opcode, deflb) int opcode;label deflb; { - register p_instr p = GETNXTPATT(); + p_instr p = GETNXTPATT(); p->em_type = EM_DEFILB; p->em_opcode = opcode; p->em_argtype = 0; @@ -167,7 +167,7 @@ void EM_Ndefilb(opcode, deflb) void EM_Rop(opcode) int opcode; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_opcode = opcode; p->em_argtype = 0; @@ -176,7 +176,7 @@ void EM_Rop(opcode) void EM_Rnarg(opcode) int opcode; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_opcode = opcode; p->em_argtype = 0; @@ -186,7 +186,7 @@ void EM_Rnarg(opcode) void EM_Rilb(opcode, lab) int opcode;label lab; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_argtype = ilb_ptyp; p->em_opcode = opcode; @@ -197,7 +197,7 @@ void EM_Rnof(opcode, lab, off) int opcode;label lab; arith off; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_argtype = nof_ptyp; p->em_opcode = opcode; @@ -209,7 +209,7 @@ void EM_Rsof(opcode, name, off) int opcode;char *name; arith off; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_argtype = sof_ptyp; p->em_opcode = opcode; @@ -221,7 +221,7 @@ void EM_Rcst(opcode, cst) int opcode; arith cst; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_argtype = cst_ptyp; p->em_opcode = opcode; @@ -231,7 +231,7 @@ void EM_Rcst(opcode, cst) void EM_Rpro(opcode, pnam) int opcode;char *pnam; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_MNEM; p->em_argtype = pro_ptyp; p->em_opcode = opcode; @@ -241,7 +241,7 @@ void EM_Rpro(opcode, pnam) void EM_Rdefilb(opcode, deflb) int opcode;label deflb; { - register p_instr p = GETNXTREPL(); + p_instr p = GETNXTREPL(); p->em_type = EM_DEFILB; p->em_opcode = opcode; p->em_argtype = 0; diff --git a/modules/src/em_opt/nopt.c b/modules/src/em_opt/nopt.c index d10fd18cb9..939d3c21a0 100644 --- a/modules/src/em_opt/nopt.c +++ b/modules/src/em_opt/nopt.c @@ -46,7 +46,7 @@ int OO_wrstats = 1; /* pattern statistics output */ **************************/ #define BTSCPY(pp,qq,i,p,q,n) for(pp=(p),qq=(q),i=(n);i--;*pp++ = *qq++) -PRIVATE void allocmem(void); +static void allocmem(void); void O_init(arith wsize, arith psize) { @@ -73,11 +73,11 @@ void O_close(void) C_close(); } -void OO_dfa(register int last) +void OO_dfa(int last) { - register struct dfa *b; - register struct dodefault *d; - register int (*f)(); + struct dfa *b; + struct dodefault *d; + int (*f)(); for (;;) { printstate("OO_dfa"); @@ -107,7 +107,7 @@ void OO_dfa(register int last) } } -PRIVATE void fatal(s, a) +static void fatal(s, a) char *s;int a; { fprint(STDERR, "%s: ", filename ? filename : "standard input"); @@ -116,7 +116,7 @@ PRIVATE void fatal(s, a) sys_stop(S_EXIT); } -PRIVATE void allocmem(void) +static void allocmem(void) { /* Allocate memory for queues on heap */ OO_buffer = (p_instr) Malloc( @@ -131,8 +131,8 @@ PRIVATE void allocmem(void) char * OO_freestr(char *str) { - register char *s = str; - register char *res; + char *s = str; + char *res; while (*s++) ; again: if ((s - str) > (laststr - nextstr)) @@ -160,8 +160,8 @@ void OO_flush(void) Output all instructions waiting in the output queue and free their storage including the saved strings. */ - register p_instr p, q; - register int i, n; + p_instr p, q; + int i, n; printstate("Flush"); for (p = OO_buffer; p < OO_patternqueue; p++) C_out(p); @@ -187,8 +187,8 @@ p_instr OO_halfflush(void) Note that OO_endbackup is always NIL (i.e. there are no instructions on the backup queue) when this is invoked. */ - register int i, n; - register p_instr p, q; + int i, n; + p_instr p, q; printstate("Half flush"); n = MAXBUFFER / 2; for (p = OO_buffer, i = n; i--;) @@ -201,7 +201,7 @@ p_instr OO_halfflush(void) return (OO_nxtpatt++); } -void OO_mkext(register p_instr p, int opcode, p_instr arg, arith off) +void OO_mkext(p_instr p, int opcode, p_instr arg, arith off) { switch (arg->em_argtype) { @@ -223,8 +223,8 @@ void OO_mkrepl(int lrepl, int diff, int numbkup) { /* copy the replacement queue into the buffer queue */ /* then move the pattern queue back n places */ - register p_instr p, q; - register int i; + p_instr p, q; + int i; printstate("Before backup"); if (OO_endbackup) { diff --git a/modules/src/em_opt/outputdfa.c b/modules/src/em_opt/outputdfa.c index 6059eee0ae..d6b3d69d2d 100644 --- a/modules/src/em_opt/outputdfa.c +++ b/modules/src/em_opt/outputdfa.c @@ -9,23 +9,23 @@ static char rcsidp5[] = "$Id$"; FILE *ofile; -PRIVATE void openofile(char *); -PRIVATE void installofile(void); -PRIVATE void UNLINK(char *); -PRIVATE void RENAME(char *, char *); -PRIVATE void increase_next(unsigned int); -PRIVATE void store_row(int, register int *); -PRIVATE void outdfa(void); -PRIVATE void outmnems(struct mnems); -PRIVATE int sametest(int, int, struct exp_node *, struct exp_node *); -PRIVATE int samerepl(int, int, struct mnems, struct mnems); -PRIVATE int samecode(int, int); -PRIVATE void outdotrans(void); -PRIVATE void outoneaction(int, struct action *); -PRIVATE void outrepl(int, struct mnems); -PRIVATE void outexp(struct exp_node *, int); -PRIVATE void outext(struct exp_node *); -PRIVATE void outop(int op); +static void openofile(char *); +static void installofile(void); +static void UNLINK(char *); +static void RENAME(char *, char *); +static void increase_next(unsigned int); +static void store_row(int, int *); +static void outdfa(void); +static void outmnems(struct mnems); +static int sametest(int, int, struct exp_node *, struct exp_node *); +static int samerepl(int, int, struct mnems, struct mnems); +static int samecode(int, int); +static void outdotrans(void); +static void outoneaction(int, struct action *); +static void outrepl(int, struct mnems); +static void outexp(struct exp_node *, int); +static void outext(struct exp_node *); +static void outop(int op); void outputnopt(void) { @@ -43,7 +43,7 @@ void outputnopt(void) static char ofilename[80]; static char ofiletemp[80]; -PRIVATE void openofile(char *filename) +static void openofile(char *filename) { strcpy(ofilename, filename); strcpy(ofiletemp, filename); @@ -55,15 +55,15 @@ PRIVATE void openofile(char *filename) } } -PRIVATE void installofile(void) +static void installofile(void) { /* * if contents of newly generated ofiletemp is different * from that of ofilename then copy over old file else * delete newly generated file */ - register FILE *f1, *f2; - register int c1, c2; + FILE *f1, *f2; + int c1, c2; fclose(ofile); if ((f1 = fopen(ofiletemp, "rb")) == NULL) { @@ -91,13 +91,13 @@ PRIVATE void installofile(void) UNLINK(ofiletemp); } -PRIVATE void UNLINK(char *x) +static void UNLINK(char *x) { /* Must remove the file "x" */ remove(x); /* systemcall to remove file */ } -PRIVATE void RENAME(char *x, char*y) +static void RENAME(char *x, char*y) { /* Must move the file "x" to the file "y" */ if (rename(x, y) != 0) @@ -114,13 +114,13 @@ int *next, *check, *base; unsigned currsize; /* current size of next and check arrays */ int maxpos = 0; /* highest used position in these arrayes */ -PRIVATE void increase_next(unsigned int size) +static void increase_next(unsigned int size) { /* realloc arrays next and check so they are at least * of size 'size' */ unsigned newsize = currsize; - register unsigned int i; + unsigned int i; do { newsize *= 2; @@ -135,11 +135,11 @@ PRIVATE void increase_next(unsigned int size) currsize = newsize; } -PRIVATE void store_row(int state, register int *row) +static void store_row(int state, int *row) { /* find a place to store row in arrays */ - register int b, i, o; - register int *n = next; + int b, i, o; + int *n = next; b = 0; for (;;) { @@ -169,10 +169,10 @@ PRIVATE void store_row(int state, register int *row) } } -PRIVATE void outdfa(void) +static void outdfa(void) { - register int s, i; - register struct state *p; + int s, i; + struct state *p; int nout, ncpy, ngto; int row[MAXOPCODE]; int numinrow; @@ -252,14 +252,14 @@ PRIVATE void outdfa(void) fprintf(ofile, "};\n\n"); } -PRIVATE void outmnems(struct mnems l) +static void outmnems(struct mnems l) { int i; for (i = 1; i <= l.m_len; i++) fprintf(ofile, "%s ", l.m_elems[i - 1]->op_code->id_text); } -PRIVATE int sametest(int s1, int s2, struct exp_node *e1, struct exp_node *e2) +static int sametest(int s1, int s2, struct exp_node *e1, struct exp_node *e2) { /* return 1 if tests are identical */ if (e1) @@ -324,11 +324,11 @@ PRIVATE int sametest(int s1, int s2, struct exp_node *e1, struct exp_node *e2) return (e2 == 0); } -PRIVATE int samerepl(int s1, int s2, struct mnems r1, struct mnems r2) +static int samerepl(int s1, int s2, struct mnems r1, struct mnems r2) { /* return 1 if replacements are identical */ - register int i; - register struct mnem_elem *m1, *m2; + int i; + struct mnem_elem *m1, *m2; if (r1.m_len != r2.m_len) return 0; /* different length */ for (i = 0; i < r1.m_len; i++) @@ -343,10 +343,10 @@ PRIVATE int samerepl(int s1, int s2, struct mnems r1, struct mnems r2) return 1; } -PRIVATE int samecode(int s1, int s2) +static int samecode(int s1, int s2) { /* return 1 if replacement code of state s1 and s2 are identical */ - register struct action *a1, *a2; + struct action *a1, *a2; if (patterns[s1].m_len != patterns[s2].m_len) return 0; a1 = actions[s1]; @@ -367,9 +367,9 @@ PRIVATE int samecode(int s1, int s2) return 1; } -PRIVATE void outdotrans(void) +static void outdotrans(void) { - register int s, t; + int s, t; struct action *a; int seennontested; int *farray; @@ -441,7 +441,7 @@ PRIVATE void outdotrans(void) fprintf(ofile, "};\n"); } -PRIVATE void outoneaction(int s, struct action *a) +static void outoneaction(int s, struct action *a) { fprintf(ofile, "\t\t/* -> "); outmnems(a->replacement); @@ -454,7 +454,7 @@ PRIVATE void outoneaction(int s, struct action *a) findworst(patterns[s], a->replacement); } -PRIVATE void outrepl(int state, struct mnems repl) +static void outrepl(int state, struct mnems repl) { /* Contruct =r1 r2 ... rn and put on output queue. */ @@ -512,7 +512,7 @@ PRIVATE void outrepl(int state, struct mnems repl) } } -PRIVATE void outexp(struct exp_node *e, int state) +static void outexp(struct exp_node *e, int state) { switch (e->node_type) { @@ -622,7 +622,7 @@ PRIVATE void outexp(struct exp_node *e, int state) } } -PRIVATE void outext(struct exp_node *e) +static void outext(struct exp_node *e) { if (e->node_type != PATARG) { @@ -632,7 +632,7 @@ PRIVATE void outext(struct exp_node *e) fprintf(ofile, "patt+%d", e->leaf_val - 1); } -PRIVATE void outop(int op) +static void outop(int op) { switch (op) { diff --git a/modules/src/em_opt/utils.c b/modules/src/em_opt/utils.c index 953b8c09c6..bf861f2bee 100644 --- a/modules/src/em_opt/utils.c +++ b/modules/src/em_opt/utils.c @@ -23,7 +23,7 @@ int OO_signsame(arith a, arith b) int OO_sfit(arith val, arith nbits) { - register long mask = ~((1L << (nbits - 1)) - 1); + long mask = ~((1L << (nbits - 1)) - 1); return (((val & mask) == 0) | ((val & mask) == mask)); } @@ -32,7 +32,7 @@ int OO_ufit(arith val, arith nbits) return ((val & (~((1L << (nbits - 1)) - 1))) == 0); } -int OO_extsame(register p_instr a1, register p_instr a2) +int OO_extsame(p_instr a1, p_instr a2) { if (a1->em_argtype != a2->em_argtype) return (0); @@ -54,7 +54,7 @@ int OO_extsame(register p_instr a1, register p_instr a2) } } -int OO_namsame(register p_instr a1, register p_instr a2) +int OO_namsame(p_instr a1, p_instr a2) { if (a1->em_argtype != a2->em_argtype) return (0); @@ -72,7 +72,7 @@ int OO_namsame(register p_instr a1, register p_instr a2) } } -arith OO_offset(register p_instr a) +arith OO_offset(p_instr a) { switch (a->em_argtype) { diff --git a/modules/src/flt_arith/b64_sft.c b/modules/src/flt_arith/b64_sft.c index cf774accc7..d481691068 100644 --- a/modules/src/flt_arith/b64_sft.c +++ b/modules/src/flt_arith/b64_sft.c @@ -8,8 +8,8 @@ #include "flt_misc.h" void flt_b64_sft( - register struct flt_mantissa *e, - register int n) + struct flt_mantissa *e, + int n) { if (n > 63 || n < -63) { e->flt_l_32 = 0; diff --git a/modules/src/flt_arith/flt_arith.h b/modules/src/flt_arith/flt_arith.h index beb5cc6fe2..976caf599b 100644 --- a/modules/src/flt_arith/flt_arith.h +++ b/modules/src/flt_arith/flt_arith.h @@ -95,7 +95,7 @@ void flt_arith2flt(arith n, flt_arith *e, int uns); * returns this value. If the uns flag is set, the result is to be * regarded as unsigned. */ -arith flt_flt2arith(register flt_arith *e, int uns); +arith flt_flt2arith(flt_arith *e, int uns); /** Negates the number indicated by `e` and stores the result * in `e`. */ void flt_umin(flt_arith *e); diff --git a/modules/src/flt_arith/flt_div.c b/modules/src/flt_arith/flt_div.c index 42bae252d3..7929b2e7db 100644 --- a/modules/src/flt_arith/flt_div.c +++ b/modules/src/flt_arith/flt_div.c @@ -11,10 +11,10 @@ void flt_div(flt_arith *e1,flt_arith *e2,flt_arith *res) { uint32_t result[2]; - register uint32_t *rp; + uint32_t *rp; unsigned short u[9], v[5]; - register int j; - register unsigned short *u_p = u; + int j; + unsigned short *u_p = u; int maxv = 4; flt_arith cpe1 = *e1; diff --git a/modules/src/flt_arith/flt_flt2ar.c b/modules/src/flt_arith/flt_flt2ar.c index 7815d9bfde..6e6da1a6e7 100644 --- a/modules/src/flt_arith/flt_flt2ar.c +++ b/modules/src/flt_arith/flt_flt2ar.c @@ -8,7 +8,7 @@ #include "flt_misc.h" #include -arith flt_flt2arith(register flt_arith *e, int uns) +arith flt_flt2arith(flt_arith *e, int uns) { /* Convert the flt_arith "n" to an arith. */ diff --git a/modules/src/flt_arith/flt_mul.c b/modules/src/flt_arith/flt_mul.c index 70bb538bc7..daf0c973f2 100644 --- a/modules/src/flt_arith/flt_mul.c +++ b/modules/src/flt_arith/flt_mul.c @@ -10,12 +10,12 @@ void flt_mul(flt_arith *e1, flt_arith *e2, flt_arith *res) { - register int i,j; /* loop control */ + int i,j; /* loop control */ unsigned short mp[4]; unsigned short mc[4]; unsigned short result[8]; /* result */ - register unsigned short *pres; + unsigned short *pres; flt_status = 0; diff --git a/modules/src/flt_arith/flt_str2fl.c b/modules/src/flt_arith/flt_str2fl.c index e0c793dd8c..f3dd7b7d6c 100644 --- a/modules/src/flt_arith/flt_str2fl.c +++ b/modules/src/flt_arith/flt_str2fl.c @@ -193,12 +193,12 @@ static flt_arith r_big_10pow[] = { /* representation of 10 ** -(28*i) */ #define BIGSZ (sizeof(big_10pow)/sizeof(big_10pow[0])) #define SMALLSZ (sizeof(s10pow)/sizeof(s10pow[0])) -static void add_exponent(register flt_arith *e, int exp) +static void add_exponent(flt_arith *e, int exp) { int neg = exp < 0; int divsz, modsz; flt_arith x; - register int status = 0; + int status = 0; if (neg) exp = -exp; divsz = exp / SMALLSZ; @@ -218,7 +218,7 @@ static void add_exponent(register flt_arith *e, int exp) void flt_str2flt(const char *s, flt_arith *e) { - register int c; + int c; int dotseen = 0; int digitseen = 0; int exp = 0; @@ -286,14 +286,14 @@ void flt_str2flt(const char *s, flt_arith *e) #define NDIG 18 -static char *flt_ecvt(register flt_arith *e, int *decpt, int *sign) +static char *flt_ecvt(flt_arith *e, int *decpt, int *sign) { /* Like ecvt(), but for extended precision */ static char buf[NDIG+1]; - register char *p = buf; - register char *pe; - register int findex = 0; + char *p = buf; + char *pe; + int findex = 0; pe = &buf[NDIG]; buf[0] = '\0'; @@ -306,7 +306,7 @@ static char *flt_ecvt(register flt_arith *e, int *decpt, int *sign) *decpt = 0; if (e->m1 != 0) { - register flt_arith *pp = &big_10pow[1]; + flt_arith *pp = &big_10pow[1]; findex = 1; while (flt_cmp(e, &big_10pow[BIGSZ-1]) >= 0) { @@ -416,10 +416,10 @@ void flt_flt2str(flt_arith *e, char *buf, int bufsize) { int sign, dp; - register int i; - register char *s1; + int i; + char *s1; char Xbuf[NDIG+12]; - register char *s = Xbuf; + char *s = Xbuf; flt_arith e1; e1 = *e; diff --git a/modules/src/flt_arith/test.c b/modules/src/flt_arith/test.c index 9a8a9707c6..ad0192f224 100644 --- a/modules/src/flt_arith/test.c +++ b/modules/src/flt_arith/test.c @@ -24,12 +24,12 @@ struct tests { { 0, 0, 0, 0} }; -int dotest(register struct tests *p); +int dotest(struct tests *p); int main() { - register struct tests *p = tests; + struct tests *p = tests; int exit_status = 0; while (p->op1) { @@ -39,7 +39,7 @@ main() return exit_status; } -int dotest(register struct tests *p) +int dotest(struct tests *p) { char buf[128]; flt_arith e1, e2, e; diff --git a/modules/src/object/object.h b/modules/src/object/object.h index 2c4716fb4a..75ad723f22 100644 --- a/modules/src/object/object.h +++ b/modules/src/object/object.h @@ -47,8 +47,8 @@ void rd_rew_relos(struct outhead *head); void rd_name(struct outname* name, unsigned int cnt); void rd_string(char* addr, long len); -int rd_arhdr(FILE* fd, register struct ar_hdr *arhdr); -void rd_ranlib(FILE* fd, register struct ranlib *ran, register long cnt); +int rd_arhdr(FILE* fd, struct ar_hdr *arhdr); +void rd_ranlib(FILE* fd, struct ranlib *ran, long cnt); int rd_int2(FILE* fd); long rd_int4(FILE* fd); unsigned int rd_unsigned2(FILE* fd); diff --git a/modules/src/object/rd.c b/modules/src/object/rd.c index 140bf2eb5d..05fb033897 100644 --- a/modules/src/object/rd.c +++ b/modules/src/object/rd.c @@ -47,7 +47,7 @@ static int sectionnr; static void OUTREAD(int p, char* b, long n) { - register long l = outseek[p]; + long l = outseek[p]; if (currpos != l) { fseek(outfile, l, SEEK_SET); @@ -73,7 +73,7 @@ static int offcnt; int rd_fdopen(FILE* fd) { - register int i; + int i; for (i = 0; i < NPARTS; i++) outseek[i] = 0; offcnt = 0; @@ -103,11 +103,11 @@ FILE* rd_fd(void) void rd_ohead(struct outhead* head) { - register long off; + long off; OUTREAD(PARTEMIT, (char *) head, (long) SZ_HEAD); { - register char *c = (char *) head + (SZ_HEAD-4); + char *c = (char *) head + (SZ_HEAD-4); head->oh_nchar = get4(c); c -= 4; head->oh_nemit = get4(c); @@ -133,7 +133,7 @@ rd_ohead(struct outhead* head) void rd_rew_relos(struct outhead* head) { - register long off = OFF_RELO(*head) + rd_base; + long off = OFF_RELO(*head) + rd_base; BEGINSEEK(PARTRELO, off); } @@ -141,7 +141,7 @@ rd_rew_relos(struct outhead* head) void rd_sect(struct outsect* sect, unsigned int cnt) { - register char *c = (char *) sect + cnt * SZ_SECT; + char *c = (char *) sect + cnt * SZ_SECT; OUTREAD(PARTEMIT, (char *) sect, (long)cnt * SZ_SECT); sect += cnt; @@ -182,7 +182,7 @@ rd_relo(struct outrelo* relo, unsigned int cnt) OUTREAD(PARTRELO, (char *) relo, (long) cnt * SZ_RELO); { - register char *c = (char *) relo + (long) cnt * SZ_RELO; + char *c = (char *) relo + (long) cnt * SZ_RELO; relo += cnt; while (cnt--) { @@ -201,7 +201,7 @@ rd_name(struct outname* name, unsigned int cnt) OUTREAD(PARTNAME, (char *) name, (long) cnt * SZ_NAME); { - register char *c = (char *) name + (long) cnt * SZ_NAME; + char *c = (char *) name + (long) cnt * SZ_NAME; name += cnt; while (cnt--) { diff --git a/modules/src/object/rd_arhdr.c b/modules/src/object/rd_arhdr.c index cab479e3f7..986e7bfdff 100644 --- a/modules/src/object/rd_arhdr.c +++ b/modules/src/object/rd_arhdr.c @@ -14,12 +14,12 @@ extern void rd_fatal(void); -int rd_arhdr(FILE* fd, register struct ar_hdr *arhdr) +int rd_arhdr(FILE* fd, struct ar_hdr *arhdr) { char buf[AR_TOTAL]; - register char *c = buf; - register char *p = arhdr->ar_name; - register size_t i; + char *c = buf; + char *p = arhdr->ar_name; + size_t i; i = fread(c, 1, AR_TOTAL, fd); if (i == 0) return 0; diff --git a/modules/src/object/rd_bytes.c b/modules/src/object/rd_bytes.c index 099f408b14..f15147a51a 100644 --- a/modules/src/object/rd_bytes.c +++ b/modules/src/object/rd_bytes.c @@ -23,11 +23,11 @@ extern void rd_fatal(void); * Just read "cnt" bytes from file-descriptor "fd". */ void -rd_bytes(FILE* fd, register char *string, register long cnt) +rd_bytes(FILE* fd, char *string, long cnt) { size_t read_bytes; while (cnt) { - register size_t n = cnt >= maxchunk ? maxchunk : cnt; + size_t n = cnt >= maxchunk ? maxchunk : cnt; read_bytes = fread(string, 1, n, fd); if (read_bytes != n) diff --git a/modules/src/object/rd_ranlib.c b/modules/src/object/rd_ranlib.c index 84c17b1709..ed939908aa 100644 --- a/modules/src/object/rd_ranlib.c +++ b/modules/src/object/rd_ranlib.c @@ -12,11 +12,11 @@ #include "object.h" #include "obj.h" -void rd_ranlib(FILE* fd, register struct ranlib *ran, register long cnt) +void rd_ranlib(FILE* fd, struct ranlib *ran, long cnt) { rd_bytes(fd, (char *) ran, cnt * SZ_RAN); { - register char *c = (char *) ran + cnt * SZ_RAN; + char *c = (char *) ran + cnt * SZ_RAN; ran += cnt; while (cnt--) { diff --git a/modules/src/object/wr_arhdr.c b/modules/src/object/wr_arhdr.c index e574f059bd..298634612d 100644 --- a/modules/src/object/wr_arhdr.c +++ b/modules/src/object/wr_arhdr.c @@ -13,12 +13,12 @@ #include "obj.h" -void wr_arhdr(FILE* fd, register struct ar_hdr *arhdr) +void wr_arhdr(FILE* fd, struct ar_hdr *arhdr) { char buf[AR_TOTAL]; - register char *c = buf; - register char *p = arhdr->ar_name; - register int i = AR_NAME_MAX; + char *c = buf; + char *p = arhdr->ar_name; + int i = AR_NAME_MAX; while (i--) { *c++ = *p++; diff --git a/modules/src/read_em/mkcalls.c b/modules/src/read_em/mkcalls.c index 8651427b83..87b3c624ff 100644 --- a/modules/src/read_em/mkcalls.c +++ b/modules/src/read_em/mkcalls.c @@ -31,7 +31,7 @@ static int listtype = 0; /* indicates pseudo when generating code for The argument must be of a type allowed by "typset". Return a pointer to the next argument. */ -PRIVATE int checkarg(register struct e_arg *arg, int typset) +static int checkarg(struct e_arg *arg, int typset) { if (((!typset) && arg->ema_argtype) || @@ -56,9 +56,9 @@ PRIVATE int checkarg(register struct e_arg *arg, int typset) /* EM_doinstr: An EM instruction */ -PRIVATE void EM_doinstr(register struct e_instr *p) +static void EM_doinstr(struct e_instr *p) { - register int parametertype; /* parametertype of the instruction */ + int parametertype; /* parametertype of the instruction */ parametertype = em_flag[p->em_opcode-sp_fmnem] & EM_PAR; #ifdef CHECKING @@ -90,7 +90,7 @@ PRIVATE void EM_doinstr(register struct e_instr *p) #include "C_mnem.h" } -PRIVATE void EM_dopseudo(register struct e_instr *p) +static void EM_dopseudo(struct e_instr *p) { switch(p->em_opcode) { @@ -320,7 +320,7 @@ PRIVATE void EM_dopseudo(register struct e_instr *p) } } -PRIVATE void EM_docon(register struct e_instr *p) +static void EM_docon(struct e_instr *p) { checkarg(&(p->em_arg), val_ptyp); switch(p->em_argtype) { @@ -357,7 +357,7 @@ PRIVATE void EM_docon(register struct e_instr *p) } } -PRIVATE void EM_dostartmes(register struct e_instr *p) +static void EM_dostartmes(struct e_instr *p) { if (listtype) { @@ -369,7 +369,7 @@ PRIVATE void EM_dostartmes(register struct e_instr *p) listtype = ps_mes; } -EXPORT int EM_mkcalls(register struct e_instr *line) +EXPORT int EM_mkcalls(struct e_instr *line) { #ifdef CHECKING diff --git a/modules/src/read_em/read_em.c b/modules/src/read_em/read_em.c index 7a3556fd0e..2c644f148a 100644 --- a/modules/src/read_em/read_em.c +++ b/modules/src/read_em/read_em.c @@ -40,7 +40,7 @@ static FILE *fd; static char *_ich; -PRIVATE int _fill(void) +static int _fill(void) { static char text[BUFSIZ + 1]; static int sz; @@ -97,7 +97,7 @@ static char *argrange = "Argument range error"; /* Error handling */ -PRIVATE void xerror(char *s) +static void xerror(char *s) { if (emhead->em_type != EM_FATAL) emhead->em_type = EM_ERROR; @@ -106,7 +106,7 @@ PRIVATE void xerror(char *s) } #ifdef COMPACT -PRIVATE void xfatal(char *s) +static void xfatal(char *s) { emhead->em_type = EM_FATAL; if (!EM_error) EM_error = s; @@ -177,7 +177,7 @@ EXPORT void EM_close(void) again, but also to deliver the arguments on next calls to EM_getinstr. This is indicated by the variable "argp". */ -PRIVATE void startmes(register struct e_instr *p) +static void startmes(struct e_instr *p) { getarg(cst_ptyp, &(p->em_arg)); @@ -208,13 +208,13 @@ PRIVATE void startmes(register struct e_instr *p) /* EM_getinstr: read an "EM_line" */ -EXPORT int EM_getinstr(register struct e_instr *p) +EXPORT int EM_getinstr(struct e_instr *p) { EM_error = 0; if (ahead) { - register int i; + int i; ahead--; *p = aheads[0]; @@ -242,7 +242,7 @@ EXPORT int EM_getinstr(register struct e_instr *p) return EM_error == 0; case EM_MNEM: { - register int i, j; + int i, j; extern char em_flag[]; extern short em_ptyp[]; diff --git a/modules/src/read_em/reade.c b/modules/src/read_em/reade.c index 8b64e9f460..28c49595d0 100644 --- a/modules/src/read_em/reade.c +++ b/modules/src/read_em/reade.c @@ -32,8 +32,8 @@ static int argnum; /* Number of arguments */ #define COMMENTSTARTER ';' /* Forward declarations */ -PRIVATE void gettyp(int, register struct e_arg *); -PRIVATE int getexpr(register int, register struct e_arg *); +static void gettyp(int, struct e_arg *); +static int getexpr(int, struct e_arg *); /* External definitions */ extern char em_mnem[][4]; @@ -41,9 +41,9 @@ extern char em_pseu[][4]; /* inithash, pre_hash, hash: Simple hashtable mechanism */ -PRIVATE int hash(register char *s) +static int hash(char *s) { - register int h = 0; + int h = 0; while (*s) { h <<= 1; @@ -52,9 +52,9 @@ PRIVATE int hash(register char *s) return h; } -PRIVATE void pre_hash(int i, char *s) +static void pre_hash(int i, char *s) { - register int h; + int h; assert(i != 0); h = hash(s); @@ -72,9 +72,9 @@ PRIVATE void pre_hash(int i, char *s) -PRIVATE void inithash(void) +static void inithash(void) { - register int i; + int i; /* Enter instructions ... */ for (i = sp_fmnem; i <= sp_lmnem; i++) { @@ -90,9 +90,9 @@ PRIVATE void inithash(void) /* nospace: skip until we find a non-space character. Also skip comments. */ -PRIVATE int nospace(void) +static int nospace(void) { - register int c; + int c; do c = getbyte(); while (isspace(c) && c != '\n'); @@ -107,9 +107,9 @@ PRIVATE int nospace(void) /* syntax: Put an error message in EM_error and skip to the end of the line */ -PRIVATE void syntax(char *s) +static void syntax(char *s) { - register int c; + int c; xerror(s); state = 0; @@ -119,7 +119,7 @@ PRIVATE void syntax(char *s) /* checkeol: check that we have a complete line (except maybe for spaces) */ -PRIVATE void checkeol(void) +static void checkeol(void) { if (nospace() != '\n') { @@ -130,9 +130,9 @@ PRIVATE void checkeol(void) /* getescape: read a '\' escape sequence */ -PRIVATE int getescape(void) +static int getescape(void) { - register int c, j, r; + int c, j, r; if ((c = getbyte()) >= '0' && c <= '7') { /* numeric escape */ r = c - '0'; @@ -162,11 +162,11 @@ PRIVATE int getescape(void) /* getname: Read a string of characters representing an identifier */ -PRIVATE struct string *getname(void) +static struct string *getname(void) { - register char *p; - register struct string *s; - register int c; + char *p; + struct string *s; + int c; s = &string; p = s->str; @@ -200,11 +200,11 @@ PRIVATE struct string *getname(void) /* getstring: read a string of characters between quotes */ -PRIVATE struct string *getstring(int isident) +static struct string *getstring(int isident) { - register char *p; + char *p; struct string *s; - register int c; + int c; static int termc; s = &string; @@ -252,9 +252,9 @@ PRIVATE struct string *getstring(int isident) -PRIVATE int offsetted(int argtyp, arith *ap) +static int offsetted(int argtyp, arith *ap) { - register int c; + int c; if ((c = nospace()) == '+' || c == '-') { struct e_arg dummy; @@ -270,10 +270,10 @@ PRIVATE int offsetted(int argtyp, arith *ap) return argtyp; } -PRIVATE int getnumber(register int c, register struct e_arg *ap) +static int getnumber(int c, struct e_arg *ap) { char str[256 + 1]; - register char *p = str; + char *p = str; int n; int expsign; @@ -358,7 +358,7 @@ PRIVATE int getnumber(register int c, register struct e_arg *ap) } -PRIVATE int getfactor(register int c, register struct e_arg *ap) +static int getfactor(int c, struct e_arg *ap) { if (c == '(') { if (getexpr(nospace(), ap) != sp_cst4) { @@ -373,7 +373,7 @@ PRIVATE int getfactor(register int c, register struct e_arg *ap) return getnumber(c, ap); } -PRIVATE int getterm(register int c, register struct e_arg *ap) +static int getterm(int c, struct e_arg *ap) { arith left; @@ -398,7 +398,7 @@ PRIVATE int getterm(register int c, register struct e_arg *ap) return sp_cst4; } -PRIVATE int getexpr(register int c, register struct e_arg *ap) +static int getexpr(int c, struct e_arg *ap) { arith left; @@ -422,7 +422,7 @@ PRIVATE int getexpr(register int c, register struct e_arg *ap) return sp_cst4; } -PRIVATE int get15u(void) +static int get15u(void) { struct e_arg dummy; @@ -433,10 +433,10 @@ PRIVATE int get15u(void) return (int) (dummy.ema_cst); } -PRIVATE void gettyp(int typset, register struct e_arg *ap) +static void gettyp(int typset, struct e_arg *ap) { - register int c, t; - register int argtyp; + int c, t; + int argtyp; if ((c = nospace()) == '\n') { ungetbyte(c); @@ -474,7 +474,7 @@ PRIVATE void gettyp(int typset, register struct e_arg *ap) argtyp = sp_pnam; } else if (c == '"' || c == '\'') { - register struct string *s; + struct string *s; out("string\n"); ungetbyte(c); @@ -507,9 +507,9 @@ PRIVATE void gettyp(int typset, register struct e_arg *ap) } } -PRIVATE void getarg(int typset, struct e_arg *ap) +static void getarg(int typset, struct e_arg *ap) { - register int c; + int c; if (argnum != 1) { if ((c = nospace()) != ',') { @@ -527,11 +527,11 @@ PRIVATE void getarg(int typset, struct e_arg *ap) /* getmnem: We found the start of either an instruction or a pseudo. get the rest of it */ -PRIVATE void getmnem(int c, register struct e_instr *p) +static void getmnem(int c, struct e_instr *p) { - register int h; + int h; int i; - register struct string *s; + struct string *s; ungetbyte(c); s = getname(); @@ -567,7 +567,7 @@ PRIVATE void getmnem(int c, register struct e_instr *p) } } -PRIVATE void line_line(void) +static void line_line(void) { static char filebuf[256 + 1]; struct e_arg dummy; @@ -579,7 +579,7 @@ PRIVATE void line_line(void) EM_filename = filebuf; } -PRIVATE void getlabel(int c, register struct e_instr *p) +static void getlabel(int c, struct e_instr *p) { ungetbyte(c); @@ -600,9 +600,9 @@ PRIVATE void getlabel(int c, register struct e_instr *p) checkeol(); } -PRIVATE void gethead(register struct e_instr *p) +static void gethead(struct e_instr *p) { - register int c; + int c; argnum = 1; for (;;) { diff --git a/modules/src/read_em/readk.c b/modules/src/read_em/readk.c index 2f0e81d9c2..1d36b3e4ca 100644 --- a/modules/src/read_em/readk.c +++ b/modules/src/read_em/readk.c @@ -9,13 +9,13 @@ #include -PRIVATE struct string *getstring(int isident); +static struct string *getstring(int isident); /* get16, get32: read a signed constant */ -PRIVATE int get16(void) +static int get16(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = getbyte(); h_byte = getbyte(); @@ -23,10 +23,10 @@ PRIVATE int get16(void) return l_byte | (h_byte << 8); } -PRIVATE arith get32(void) +static arith get32(void) { - register arith l; - register int h_byte; + arith l; + int h_byte; l = getbyte(); l |= ((unsigned) getbyte() << 8); @@ -39,9 +39,9 @@ PRIVATE arith get32(void) /* getarg : read an argument of any type, and check it against "typset" if neccesary. Put result in "ap". */ -PRIVATE void getarg(int typset, register struct e_arg *ap) +static void getarg(int typset, struct e_arg *ap) { - register int i = getbyte(); + int i = getbyte(); #ifdef CHECKING int argtyp; #endif /* CHECKING */ @@ -102,7 +102,7 @@ PRIVATE void getarg(int typset, register struct e_arg *ap) case sp_pnam: /* A procedure name */ { - register struct string *p; + struct string *p; p = getstring(1); ap->ema_pnam = p->str; @@ -112,7 +112,7 @@ PRIVATE void getarg(int typset, register struct e_arg *ap) case sp_dnam: /* A Non-numeric data label */ { - register struct string *p; + struct string *p; p = getstring(1); ap->ema_dnam = p->str; @@ -135,7 +135,7 @@ PRIVATE void getarg(int typset, register struct e_arg *ap) case sp_ucon: /* An unsigned constant */ case sp_fcon: /* A floating constant */ { - register struct string *p; + struct string *p; getarg(cst_ptyp, ap); ap->ema_szoroff = ap->ema_cst; @@ -147,7 +147,7 @@ PRIVATE void getarg(int typset, register struct e_arg *ap) case sp_scon: /* A string constant */ { - register struct string *p; + struct string *p; p = getstring(0); ap->ema_argtype = str_ptyp; @@ -186,10 +186,10 @@ PRIVATE void getarg(int typset, register struct e_arg *ap) #ifdef CHECKING /* checkident: check that a string indeed represents an identifier */ -PRIVATE int checkident(register struct string *s) +static int checkident(struct string *s) { - register char *p; - register int n; + char *p; + int n; p = s->str; if (!isascii(*p) || (!isalpha(*p) && *p != '_')) { @@ -208,11 +208,11 @@ PRIVATE int checkident(register struct string *s) /* getstring: read a string from the input */ /*ARGSUSED*/ -PRIVATE struct string *getstring(int isident) +static struct string *getstring(int isident) { - register char *p; - register int n; - register struct string *s = &string; + char *p; + int n; + struct string *s = &string; struct e_arg dummy; getarg(cst_ptyp, &dummy); @@ -252,9 +252,9 @@ PRIVATE struct string *getstring(int isident) /* gethead: read the start of an EM-line */ -PRIVATE void gethead(register struct e_instr *p) +static void gethead(struct e_instr *p) { - register int i; + int i; EM_lineno++; diff --git a/modules/src/string/bts2str.c b/modules/src/string/bts2str.c index 2caf14bfec..90e338f623 100644 --- a/modules/src/string/bts2str.c +++ b/modules/src/string/bts2str.c @@ -15,9 +15,9 @@ -char *bts2str(char *b, register int n, char *s) +char *bts2str(char *b, int n, char *s) { - register char *f = b, *t = s; + char *f = b, *t = s; while (n-- > 0) { if (is_print(*f)) { diff --git a/modules/src/string/btscat.c b/modules/src/string/btscat.c index 2506007a75..f3dd3d8afd 100644 --- a/modules/src/string/btscat.c +++ b/modules/src/string/btscat.c @@ -8,9 +8,9 @@ #include "ack_string.h" -char *btscat(char* b1, int n1, register char *b2, register int n2) +char *btscat(char* b1, int n1, char *b2, int n2) { - register char *b = b1 + n1; + char *b = b1 + n1; while (n2-- > 0) *b++ = *b2++; diff --git a/modules/src/string/btscmp.c b/modules/src/string/btscmp.c index 5f9ad329aa..601a51cc5e 100644 --- a/modules/src/string/btscmp.c +++ b/modules/src/string/btscmp.c @@ -8,9 +8,9 @@ #include "ack_string.h" -int btscmp(register char *b1, int n1, register char *b2, int n2) +int btscmp(char *b1, int n1, char *b2, int n2) { - register int n = (n1 <= n2) ? n1 : n2; + int n = (n1 <= n2) ? n1 : n2; while (n-- > 0) { if (*b1++ != *b2++) diff --git a/modules/src/string/btscpy.c b/modules/src/string/btscpy.c index fe43ea43b1..86e608cdfa 100644 --- a/modules/src/string/btscpy.c +++ b/modules/src/string/btscpy.c @@ -8,7 +8,7 @@ #include "ack_string.h" -char *btscpy(register char *b1, register char *b2, register int n) +char *btscpy(char *b1, char *b2, int n) { char *b1s = b1; diff --git a/modules/src/string/btszero.c b/modules/src/string/btszero.c index edb50577d9..9f6c297753 100644 --- a/modules/src/string/btszero.c +++ b/modules/src/string/btszero.c @@ -8,9 +8,9 @@ #include "ack_string.h" -char *btszero(char *b, register int n) +char *btszero(char *b, int n) { - register char *s = b; + char *s = b; while (n-- > 0) *s++ = '\0'; diff --git a/modules/src/string/long2str.c b/modules/src/string/long2str.c index eb54ac2853..709d92c737 100644 --- a/modules/src/string/long2str.c +++ b/modules/src/string/long2str.c @@ -14,11 +14,11 @@ #define MAXWIDTH 32 -char *long2str(register long val, register int base) +char *long2str(long val, int base) { static char numbuf[MAXWIDTH]; static char vec[] = "0123456789ABCDEF"; - register char *p = &numbuf[MAXWIDTH]; + char *p = &numbuf[MAXWIDTH]; int sign = (base > 0); *--p = '\0'; /* null-terminate string */ @@ -37,7 +37,7 @@ char *long2str(register long val, register int base) if (base < 0) { /* unsigned */ base = -base; if (val < 0L) { /* taken from Amoeba src */ - register int mod, i; + int mod, i; overflow: mod = 0; for (i = 0; i < 8 * (int)sizeof(val); i++) { diff --git a/modules/src/string/str2bts.c b/modules/src/string/str2bts.c index c9ad2aac1b..aa289d968c 100644 --- a/modules/src/string/str2bts.c +++ b/modules/src/string/str2bts.c @@ -18,9 +18,9 @@ static int is_oct(char c) The ascii length of the resulting string is returned, including the terminating null-character. */ -char *str2bts(register char *str, char *bts, int *pn) +char *str2bts(char *str, char *bts, int *pn) { - register char *t = bts; + char *t = bts; while (*str) { if (*str == '\\') { @@ -47,7 +47,7 @@ char *str2bts(register char *str, char *bts, int *pn) break; default: if (is_oct(*str)) { - register int cnt = 0, oct = 0; + int cnt = 0, oct = 0; do oct = oct * 8 + *str - '0'; diff --git a/modules/src/string/str2long.c b/modules/src/string/str2long.c index 3225449ebd..c97e56df9b 100644 --- a/modules/src/string/str2long.c +++ b/modules/src/string/str2long.c @@ -10,7 +10,7 @@ static int value(char c, int b) { - register int ch; + int ch; ch = c - '0'; if ((unsigned) ch <= 9) return ch; @@ -21,7 +21,7 @@ static int value(char c, int b) return b; } -long str2long(register char *str, int base) +long str2long(char *str, int base) { int minus = 0, d; long l = 0; diff --git a/modules/src/string/strindex.c b/modules/src/string/strindex.c index 1d901b72fd..072ed57112 100644 --- a/modules/src/string/strindex.c +++ b/modules/src/string/strindex.c @@ -8,7 +8,7 @@ #include "ack_string.h" -char *strindex(register char *s, int c) +char *strindex(char *s, int c) { while (*s) if (*s++ == c) diff --git a/modules/src/string/strrindex.c b/modules/src/string/strrindex.c index 0468ca8db8..3738c4c98e 100644 --- a/modules/src/string/strrindex.c +++ b/modules/src/string/strrindex.c @@ -6,9 +6,9 @@ #include "ack_string.h" -char *strrindex(register char *str, int chr) +char *strrindex(char *str, int chr) { - register char *retptr = 0; + char *retptr = 0; while (*str) if (*str++ == chr) diff --git a/modules/src/system/basename.c b/modules/src/system/basename.c index 04322085e1..a7c79b5e2f 100644 --- a/modules/src/system/basename.c +++ b/modules/src/system/basename.c @@ -6,12 +6,12 @@ #include -void sys_basename(char *str, register char *dst) +void sys_basename(char *str, char *dst) { - register char *p1 = str; - register char *p2 = p1; - register char *end; - register char *start; + char *p1 = str; + char *p2 = p1; + char *end; + char *start; int len; if ((str == NULL) || (*str == '\0')) diff --git a/modules/src/system/create.c b/modules/src/system/create.c index 41dedbe609..89449adc7c 100644 --- a/modules/src/system/create.c +++ b/modules/src/system/create.c @@ -10,8 +10,8 @@ int sys_create(File** filep, char* path, int mode) { - register int fd; - register File *fp; + int fd; + File *fp; if ((fp = _get_entry()) == (File *)0) return 0; diff --git a/modules/src/system/open.c b/modules/src/system/open.c index f4a833ea32..cbf43d2817 100644 --- a/modules/src/system/open.c +++ b/modules/src/system/open.c @@ -16,8 +16,8 @@ int sys_open(char* path, int flag, File** filep) { - register int fd; - register File *fp; + int fd; + File *fp; if ((fp = _get_entry()) == (File *)0) return 0; diff --git a/modules/src/system/system.c b/modules/src/system/system.c index c06b8ffe0f..84502c05ca 100644 --- a/modules/src/system/system.c +++ b/modules/src/system/system.c @@ -14,7 +14,7 @@ File _sys_ftab[SYS_NOPEN] = { File * _get_entry(void) { - register File *fp; + File *fp; for (fp = &_sys_ftab[0]; fp < &_sys_ftab[SYS_NOPEN]; fp++) if (fp->o_flags == 0) diff --git a/modules/src/system/system.h b/modules/src/system/system.h index 97bd973a05..8e754d4452 100644 --- a/modules/src/system/system.h +++ b/modules/src/system/system.h @@ -77,7 +77,7 @@ time_t sys_modtime(char *); * * Supports both DOS and UNIX style paths. * */ -extern void sys_basename(const char *str, register char *dst); +extern void sys_basename(const char *str, char *dst); /* Creates a temporary filename, makes it, and returns a malloc'd string * containing the filename. */ diff --git a/plat/em/libsys/signal.c b/plat/em/libsys/signal.c index 20d262b3db..f99b18b657 100644 --- a/plat/em/libsys/signal.c +++ b/plat/em/libsys/signal.c @@ -47,7 +47,7 @@ static int catchtrp(int trapno) ; static int procesig(int signo) ; sighandler_t signal(int sig, sighandler_t func) { - register index, i ; + int index, i ; sighandler_t prev ; index= sig-1 ; @@ -60,7 +60,7 @@ sighandler_t signal(int sig, sighandler_t func) { } prev= vector[index] ; if ( prev!=func ) { - register int mapval ; + int mapval ; vector[index]= func ; if ( func==SIG_IGN ) { mapval= -3; @@ -88,7 +88,7 @@ static int catchtrp(int trapno) { } static int procesig(int sig) { - register index ; + int index ; sighandler_t trf ; index= sig-1 ; diff --git a/plat/linux68k/emu/musashi/m68k_in.c b/plat/linux68k/emu/musashi/m68k_in.c index d280bf0f1c..1f66c43941 100755 --- a/plat/linux68k/emu/musashi/m68k_in.c +++ b/plat/linux68k/emu/musashi/m68k_in.c @@ -68,8 +68,8 @@ must fix: * For C and D where nothing is specified, use "." * * Example: - * M68KMAKE_OP(abcd, 8, rr, .) abcd, size 8, register to register, default EA - * M68KMAKE_OP(abcd, 8, mm, ax7) abcd, size 8, memory to memory, register X is A7 + * M68KMAKE_OP(abcd, 8, rr, .) abcd, size 8, to register, default EA + * M68KMAKE_OP(abcd, 8, mm, ax7) abcd, size 8, memory to memory, X is A7 * M68KMAKE_OP(tst, 16, ., pcix) tst, size 16, PCIX addressing * * All opcode handler primitives end with a closing curly brace "}" at column 1 diff --git a/plat/pc86/emu/x86emu/prim_ops.c b/plat/pc86/emu/x86emu/prim_ops.c index 5604c7e81d..a87b634342 100644 --- a/plat/pc86/emu/x86emu/prim_ops.c +++ b/plat/pc86/emu/x86emu/prim_ops.c @@ -230,8 +230,8 @@ Implements the ADC instruction and side effects. u8 adc_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; if (ACCESS_FLAG(F_CF)) res = 1 + d + s; @@ -257,8 +257,8 @@ Implements the ADC instruction and side effects. u16 adc_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; if (ACCESS_FLAG(F_CF)) res = 1 + d + s; @@ -284,10 +284,10 @@ Implements the ADC instruction and side effects. u32 adc_long(u32 d, u32 s) { - register u32 lo; /* all operands in native machine order */ - register u32 hi; - register u32 res; - register u32 cc; + u32 lo; /* all operands in native machine order */ + u32 hi; + u32 res; + u32 cc; if (ACCESS_FLAG(F_CF)) { lo = 1 + (d & 0xFFFF) + (s & 0xFFFF); @@ -318,8 +318,8 @@ Implements the ADD instruction and side effects. u8 add_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; res = d + s; CONDITIONAL_SET_FLAG(res & 0x100, F_CF); @@ -341,8 +341,8 @@ Implements the ADD instruction and side effects. u16 add_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; res = d + s; CONDITIONAL_SET_FLAG(res & 0x10000, F_CF); @@ -364,10 +364,10 @@ Implements the ADD instruction and side effects. u32 add_long(u32 d, u32 s) { - register u32 lo; /* all operands in native machine order */ - register u32 hi; - register u32 res; - register u32 cc; + u32 lo; /* all operands in native machine order */ + u32 hi; + u32 res; + u32 cc; lo = (d & 0xFFFF) + (s & 0xFFFF); res = d + s; @@ -393,7 +393,7 @@ Implements the AND instruction and side effects. u8 and_byte(u8 d, u8 s) { - register u8 res; /* all operands in native machine order */ + u8 res; /* all operands in native machine order */ res = d & s; @@ -414,7 +414,7 @@ Implements the AND instruction and side effects. u16 and_word(u16 d, u16 s) { - register u16 res; /* all operands in native machine order */ + u16 res; /* all operands in native machine order */ res = d & s; @@ -435,7 +435,7 @@ Implements the AND instruction and side effects. u32 and_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d & s; @@ -456,8 +456,8 @@ Implements the CMP instruction and side effects. u8 cmp_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CLEAR_FLAG(F_CF); @@ -480,8 +480,8 @@ Implements the CMP instruction and side effects. u16 cmp_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); @@ -503,8 +503,8 @@ Implements the CMP instruction and side effects. u32 cmp_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); @@ -570,8 +570,8 @@ Implements the DEC instruction and side effects. u8 dec_byte(u8 d) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - 1; CONDITIONAL_SET_FLAG(res & 0x80, F_SF); @@ -594,8 +594,8 @@ Implements the DEC instruction and side effects. u16 dec_word(u16 d) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - 1; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); @@ -618,8 +618,8 @@ Implements the DEC instruction and side effects. u32 dec_long(u32 d) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - 1; @@ -642,8 +642,8 @@ Implements the INC instruction and side effects. u8 inc_byte(u8 d) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF); @@ -664,8 +664,8 @@ Implements the INC instruction and side effects. u16 inc_word(u16 d) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF); @@ -686,8 +686,8 @@ Implements the INC instruction and side effects. u32 inc_long(u32 d) { - register u32 res; /* all operands in native machine order */ - register u32 cc; + u32 res; /* all operands in native machine order */ + u32 cc; res = d + 1; CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF); @@ -708,7 +708,7 @@ Implements the OR instruction and side effects. u8 or_byte(u8 d, u8 s) { - register u8 res; /* all operands in native machine order */ + u8 res; /* all operands in native machine order */ res = d | s; CLEAR_FLAG(F_OF); @@ -727,7 +727,7 @@ Implements the OR instruction and side effects. u16 or_word(u16 d, u16 s) { - register u16 res; /* all operands in native machine order */ + u16 res; /* all operands in native machine order */ res = d | s; /* set the carry flag to be bit 8 */ @@ -747,7 +747,7 @@ Implements the OR instruction and side effects. u32 or_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d | s; @@ -768,8 +768,8 @@ Implements the OR instruction and side effects. u8 neg_byte(u8 s) { - register u8 res; - register u8 bc; + u8 res; + u8 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u8) - s; @@ -794,8 +794,8 @@ Implements the OR instruction and side effects. u16 neg_word(u16 s) { - register u16 res; - register u16 bc; + u16 res; + u16 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u16) - s; @@ -821,8 +821,8 @@ Implements the OR instruction and side effects. u32 neg_long(u32 s) { - register u32 res; - register u32 bc; + u32 res; + u32 bc; CONDITIONAL_SET_FLAG(s != 0, F_CF); res = (u32) - s; @@ -878,7 +878,7 @@ Implements the RCL instruction and side effects. u8 rcl_byte(u8 d, u8 s) { - register unsigned int res, cnt, mask, cf; + unsigned int res, cnt, mask, cf; /* s is the rotate distance. It varies from 0 - 8. */ /* have @@ -951,7 +951,7 @@ Implements the RCL instruction and side effects. u16 rcl_word(u16 d, u8 s) { - register unsigned int res, cnt, mask, cf; + unsigned int res, cnt, mask, cf; res = d; if ((cnt = s % 17) != 0) { @@ -975,7 +975,7 @@ Implements the RCL instruction and side effects. u32 rcl_long(u32 d, u8 s) { - register u32 res, cnt, mask, cf; + u32 res, cnt, mask, cf; res = d; if ((cnt = s % 33) != 0) { @@ -1151,7 +1151,7 @@ Implements the ROL instruction and side effects. u8 rol_byte(u8 d, u8 s) { - register unsigned int res, cnt, mask; + unsigned int res, cnt, mask; /* rotate left */ /* @@ -1201,7 +1201,7 @@ Implements the ROL instruction and side effects. u16 rol_word(u16 d, u8 s) { - register unsigned int res, cnt, mask; + unsigned int res, cnt, mask; res = d; if ((cnt = s % 16) != 0) { @@ -1227,7 +1227,7 @@ Implements the ROL instruction and side effects. u32 rol_long(u32 d, u8 s) { - register u32 res, cnt, mask; + u32 res, cnt, mask; res = d; if ((cnt = s % 32) != 0) { @@ -1253,7 +1253,7 @@ Implements the ROR instruction and side effects. u8 ror_byte(u8 d, u8 s) { - register unsigned int res, cnt, mask; + unsigned int res, cnt, mask; /* rotate right */ /* @@ -1301,7 +1301,7 @@ Implements the ROR instruction and side effects. u16 ror_word(u16 d, u8 s) { - register unsigned int res, cnt, mask; + unsigned int res, cnt, mask; res = d; if ((cnt = s % 16) != 0) { @@ -1326,7 +1326,7 @@ Implements the ROR instruction and side effects. u32 ror_long(u32 d, u8 s) { - register u32 res, cnt, mask; + u32 res, cnt, mask; res = d; if ((cnt = s % 32) != 0) { @@ -1895,8 +1895,8 @@ Implements the SBB instruction and side effects. u8 sbb_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; @@ -1921,8 +1921,8 @@ Implements the SBB instruction and side effects. u16 sbb_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; @@ -1947,8 +1947,8 @@ Implements the SBB instruction and side effects. u32 sbb_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; if (ACCESS_FLAG(F_CF)) res = d - s - 1; @@ -1973,8 +1973,8 @@ Implements the SUB instruction and side effects. u8 sub_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80, F_SF); @@ -1996,8 +1996,8 @@ Implements the SUB instruction and side effects. u16 sub_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x8000, F_SF); @@ -2019,8 +2019,8 @@ Implements the SUB instruction and side effects. u32 sub_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ - register u32 bc; + u32 res; /* all operands in native machine order */ + u32 bc; res = d - s; CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF); @@ -2042,7 +2042,7 @@ Implements the TEST instruction and side effects. void test_byte(u8 d, u8 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d & s; @@ -2061,7 +2061,7 @@ Implements the TEST instruction and side effects. void test_word(u16 d, u16 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d & s; @@ -2080,7 +2080,7 @@ Implements the TEST instruction and side effects. void test_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d & s; @@ -2099,7 +2099,7 @@ Implements the XOR instruction and side effects. u8 xor_byte(u8 d, u8 s) { - register u8 res; /* all operands in native machine order */ + u8 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); @@ -2118,7 +2118,7 @@ Implements the XOR instruction and side effects. u16 xor_word(u16 d, u16 s) { - register u16 res; /* all operands in native machine order */ + u16 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); @@ -2137,7 +2137,7 @@ Implements the XOR instruction and side effects. u32 xor_long(u32 d, u32 s) { - register u32 res; /* all operands in native machine order */ + u32 res; /* all operands in native machine order */ res = d ^ s; CLEAR_FLAG(F_OF); @@ -2770,7 +2770,7 @@ NOTE: Do not inline this, as (*sys_rdX) is already inline! u16 pop_word(void) { - register u16 res; + u16 res; DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) @@ -2788,7 +2788,7 @@ NOTE: Do not inline this, as (*sys_rdX) is already inline! u32 pop_long(void) { - register u32 res; + u32 res; DB(if (CHECK_SP_ACCESS()) x86emu_check_sp_access();) diff --git a/tests/plat/bugs/bug-157-i80-varargs_c.c b/tests/plat/bugs/bug-157-i80-varargs_c.c index 028ab74618..6b84032a69 100644 --- a/tests/plat/bugs/bug-157-i80-varargs_c.c +++ b/tests/plat/bugs/bug-157-i80-varargs_c.c @@ -9,8 +9,8 @@ static char buf[34]; char * __ultostr(unsigned long val, int radix) { - register char *p; - register int c; + char *p; + int c; if( radix > 36 || radix < 2 ) return 0; diff --git a/util/LLgen/src/LLgen.c b/util/LLgen/src/LLgen.c index 422551cefb..c68d79f083 100644 --- a/util/LLgen/src/LLgen.c +++ b/util/LLgen/src/LLgen.c @@ -79,14 +79,14 @@ static int max_rules; #define RULEINCR 32 /* Here are defined : */ -STATIC void newnorder(int index); -STATIC void newtorder(int index); -STATIC void mkalt(p_gram prod, int condition,int lc,register p_gram res); -STATIC void mkterm(p_gram prod, int flags,int lc,register p_gram result); -STATIC p_gram copyrule(register p_gram p,int length); +static void newnorder(int index); +static void newtorder(int index); +static void mkalt(p_gram prod, int condition,int lc, p_gram res); +static void mkterm(p_gram prod, int flags,int lc, p_gram result); +static p_gram copyrule(p_gram p,int length); /* and of course LLparse() */ -STATIC void newnorder(int index) { +static void newnorder(int index) { static int porder; if (norder != -1) { @@ -97,7 +97,7 @@ STATIC void newnorder(int index) { nonterms[porder].n_next = -1; } -STATIC void newtorder(int index) { +static void newtorder(int index) { static int porder; if (torder != -1) { @@ -127,10 +127,10 @@ static void LL5_productions( p_gram *p) ; static void LL6_simpleproduction( # line 330 "LLgen.g" -p_gram *p ,register int *conflres) ; +p_gram *p , int *conflres) ; static void LL7_elem( # line 478 "LLgen.g" -register p_gram pres) ; +p_gram pres) ; static void LL8_repeats( # line 600 "LLgen.g" int *kind ,int *cnt) ; @@ -186,7 +186,7 @@ LL1_def( void ) { # line 106 "LLgen.g" - register string p; + string p; switch(LLcsymb) { case /* C_IDENT */ 2 : ; LL2_rule(); @@ -237,8 +237,8 @@ LL_NOSCANDONE(C_IDENT); * Put the declaration in the list * of start symbols */ - register p_gram temp; - register p_start ff; + p_gram temp; + p_start ff; temp = search(NONTERM,lextoken.t_string,BOTH); ff = (p_start) alloc(sizeof(t_start)); @@ -335,9 +335,9 @@ LL2_rule( void ) { # line 198 "LLgen.g" - register p_nont p; + p_nont p; p_gram rr; - register p_gram temp; + p_gram temp; LLtincr(6); LLtincr(7); @@ -540,12 +540,12 @@ goto L_3; # line 304 "LLgen.g" -STATIC void mkalt(p_gram prod, int condition,int lc,register p_gram res) +static void mkalt(p_gram prod, int condition,int lc, p_gram res) { /* * Create an alternation and initialise it. */ - register p_link l; + p_link l; static p_link list; static int cnt; @@ -566,7 +566,7 @@ static void LL6_simpleproduction( # line 330 "LLgen.g" -p_gram *p ,register int *conflres) +p_gram *p , int *conflres) { # line 331 "LLgen.g" t_gram elem; @@ -766,7 +766,7 @@ L_10: ; LLsdecr(4); # line 382 "LLgen.g" { if (g_gettype(&elem) == TERM) { - register p_term q = g_getterm(&elem); + p_term q = g_getterm(&elem); if (! (q->t_flags & RESOLVER) && g_gettype(q->t_rule) != ALTERNATION && @@ -798,7 +798,7 @@ goto L_10; } # line 409 "LLgen.g" { if (!termdeleted && g_gettype(&elem) == TERM) { - register p_term q; + p_term q; q = g_getterm(&elem); r_setkind(q,kind); @@ -850,13 +850,13 @@ break; # line 452 "LLgen.g" -STATIC void mkterm(p_gram prod, int flags,int lc,register p_gram result) +static void mkterm(p_gram prod, int flags,int lc, p_gram result) { /* * Create a term, initialise it and return * a grammar element containing it */ - register p_term q; + p_term q; if (! t_cnt) { t_cnt = 50; @@ -876,10 +876,10 @@ static void LL7_elem( # line 478 "LLgen.g" -register p_gram pres) +p_gram pres) { # line 479 "LLgen.g" - register int t = 0; + int t = 0; p_gram p1; int ln; p_gram pe; @@ -1101,8 +1101,8 @@ LL_NOSCANDONE(C_IDENT); # line 553 "LLgen.g" { #ifdef NON_CORRECTING - register p_gram temp; - register p_start subp; + p_gram temp; + p_start subp; temp = search(NONTERM,lextoken.t_string,BOTH); subp = (p_start) alloc (sizeof(t_start)); @@ -1130,8 +1130,8 @@ LL_NOSCANDONE(C_IDENT); # line 569 "LLgen.g" { #ifdef NON_CORRECTING - register p_gram temp; - register p_start ff; + p_gram temp; + p_start ff; temp = search(NONTERM,lextoken.t_string,BOTH); @@ -1266,7 +1266,7 @@ LL4_firsts( void ) { # line 626 "LLgen.g" - register string p; + string p; LLtincr(23); LLtincr(2); LLtincr(24); @@ -1286,7 +1286,7 @@ LL_NOSCANDONE(';'); * to this input file */ p_gram temp; - register p_first ff; + p_first ff; temp = search(NONTERM,lextoken.t_string,BOTH); ff = (p_first) alloc(sizeof(t_first)); @@ -1300,13 +1300,13 @@ LL_NOSCANDONE(';'); # line 645 "LLgen.g" -STATIC p_gram copyrule(register p_gram p,int length) +static p_gram copyrule(p_gram p,int length) { /* * Returns a pointer to a grammar rule that was created in * p. The space pointed to by p can now be reused */ - register p_gram t; + p_gram t; p_gram rule; t = (p_gram) alloc(length * sizeof(t_gram)); diff --git a/util/LLgen/src/LLgen.g b/util/LLgen/src/LLgen.g index 09736302ca..63bde89021 100644 --- a/util/LLgen/src/LLgen.g +++ b/util/LLgen/src/LLgen.g @@ -43,14 +43,14 @@ static int max_rules; #define RULEINCR 32 /* Here are defined : */ -STATIC void newnorder(int index); -STATIC void newtorder(int index); -STATIC void mkalt(p_gram prod, int condition,int lc,register p_gram res); -STATIC void mkterm(p_gram prod, int flags,int lc,register p_gram result); -STATIC p_gram copyrule(register p_gram p,int length); +static void newnorder(int index); +static void newtorder(int index); +static void mkalt(p_gram prod, int condition,int lc,register p_gram res); +static void mkterm(p_gram prod, int flags,int lc,register p_gram result); +static p_gram copyrule(p_gram p,int length); /* and of course LLparse() */ -STATIC void newnorder(int index) { +static void newnorder(int index) { static int porder; if (norder != -1) { @@ -61,7 +61,7 @@ STATIC void newnorder(int index) { nonterms[porder].n_next = -1; } -STATIC void newtorder(int index) { +static void newtorder(int index) { static int porder; if (torder != -1) { @@ -298,7 +298,7 @@ productions(p_gram *p;) ; { -STATIC void mkalt(p_gram prod, int condition,int lc,register p_gram res) +static void mkalt(p_gram prod, int condition,int lc,register p_gram res) { /* * Create an alternation and initialise it. @@ -446,7 +446,7 @@ simpleproduction(p_gram *p; register int *conflres;) ; { -STATIC void mkterm(p_gram prod, int flags,int lc,register p_gram result) +static void mkterm(p_gram prod, int flags,int lc,register p_gram result) { /* * Create a term, initialise it and return @@ -470,7 +470,7 @@ STATIC void mkterm(p_gram prod, int flags,int lc,register p_gram result) } } -elem (register p_gram pres;) +elem (p_gram pres;) { register int t = 0; p_gram p1; int ln; @@ -639,7 +639,7 @@ firsts { register string p; } ; { -STATIC p_gram copyrule(register p_gram p,int length) +static p_gram copyrule(p_gram p,int length) { /* * Returns a pointer to a grammar rule that was created in diff --git a/util/LLgen/src/Lpars.c b/util/LLgen/src/Lpars.c index 23d0014ce3..609ae0c04b 100644 --- a/util/LLgen/src/Lpars.c +++ b/util/LLgen/src/Lpars.c @@ -460,7 +460,7 @@ void LLread(void) { void LLerror(int t) { - register int i; + int i; if (t == EOFILE && LLsymb <= 0) return; #ifdef LL_NEWMESS @@ -564,7 +564,7 @@ void LLsafeerror(int t) #ifndef LLNOFIRSTS int LLfirst(int x, int d) { - register int i; + int i; return (i = LLindex[x]) >= 0 && (LLsets[d + (i >> 3)] & (1 << (i & 07))); @@ -609,18 +609,18 @@ static int LLuserhook(int e, int *list) return LLsymb != old; } -static void LLmklist(register int *list) +static void LLmklist(int *list) { char Xset[LL_SSIZE]; - register char *p; - register int i; + char *p; + int i; for (p = &Xset[0]; p < &Xset[LL_SSIZE]; ) *p++ = 0; for (i = 0; i < LL_NTERMINALS; i++) { if (LLtcnt[i] != 0) Xset[i >> 3] |= (1 << (i & 07)); } for (i = LL_NSETS - 1; i >= 0; i--) if (LLscnt[i] != 0) { - register char *q = &LLsets[LL_SSIZE * i]; + char *q = &LLsets[LL_SSIZE * i]; p = &Xset[0]; while (p < &Xset[LL_SSIZE]) *p++ |= *q++; @@ -638,7 +638,7 @@ static int LLdoskip(int e) int LLx; int list[LL_NTERMINALS+1]; #endif /* LL_USERHOOK */ - register int i; + int i; int retval; int LLi, LLb; @@ -693,7 +693,7 @@ static int LLdoskip(int e) } void LLnewlevel(unsigned int *LLsinfo) { - register int i; + int i; if (LLlevel++) { LLsinfo[LL_NSETS+LL_NTERMINALS] = (unsigned) LLsymb; @@ -711,7 +711,7 @@ void LLnewlevel(unsigned int *LLsinfo) { } void LLoldlevel(unsigned int *LLsinfo) { - register int i; + int i; LLtdecr(0); #ifdef LL_DEBUG diff --git a/util/LLgen/src/alloc.c b/util/LLgen/src/alloc.c index 7cd71c2665..2bbe4510dc 100644 --- a/util/LLgen/src/alloc.c +++ b/util/LLgen/src/alloc.c @@ -47,7 +47,7 @@ p_mem ralloc(p_mem p,size_t size) return p; } -p_mem new_mem(register p_info p) +p_mem new_mem(p_info p) { /* This routine implements arrays that can grow. diff --git a/util/LLgen/src/check.c b/util/LLgen/src/check.c index 5c7d8abd99..b358b86b1b 100644 --- a/util/LLgen/src/check.c +++ b/util/LLgen/src/check.c @@ -36,15 +36,15 @@ static int level; /* In this file are defined : */ void conflchecks(void); -STATIC void prline(char*); -STATIC void printset(register p_set, string); -STATIC int check(register p_gram); -STATIC void moreverbose(register p_set); -STATIC void prrule(p_gram); -STATIC void cfcheck(p_set, p_set, int); -STATIC void resolve(p_gram); -STATIC void propagate(p_set, register p_gram); -STATIC void spaces(void); +static void prline(char*); +static void printset(p_set, string); +static int check(p_gram); +static void moreverbose(p_set); +static void prrule(p_gram); +static void cfcheck(p_set, p_set, int); +static void resolve(p_gram); +static void propagate(p_set, p_gram); +static void spaces(void); /* * Check for conflicts, that is, @@ -55,8 +55,8 @@ STATIC void spaces(void); */ void conflchecks(void) { - register p_nont p; - register int s; + p_nont p; + int s; p_file x = files; f_input = x->f_name; @@ -120,20 +120,20 @@ void conflchecks(void) fclose(fout); } -STATIC void prline(char* s) +static void prline(char* s) { fputs(s, fout); spaces(); } -STATIC void printset(register p_set p, string s) +static void printset(p_set p, string s) { /* * Print the elements of a set */ - register int i; - register int j; - register p_token pt; + int i; + int j; + p_token pt; string name; int k; int hulp; @@ -188,13 +188,13 @@ STATIC void printset(register p_set p, string s) prline("}\n"); } -STATIC int check(register p_gram p) +static int check(p_gram p) { /* * Search for conflicts in a grammar rule. */ - register p_set temp; - register int retval; + p_set temp; + int retval; retval = 0; for (;;) @@ -205,7 +205,7 @@ STATIC int check(register p_gram p) return retval; case NONTERM: { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; if (g_getnpar(p) != getntparams(n)) @@ -216,7 +216,7 @@ STATIC int check(register p_gram p) } case TERM: { - register p_term q; + p_term q; q = g_getterm(p); retval |= check(q->t_rule); @@ -264,7 +264,7 @@ STATIC int check(register p_gram p) } case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); temp = setalloc(); @@ -301,15 +301,15 @@ STATIC int check(register p_gram p) } } -STATIC void moreverbose(register p_set t) +static void moreverbose(p_set t) { /* * t points to a set containing conflicting symbols and pssibly * also containing nonterminals. * Take care that a printout will be prepared for these nonterminals */ - register int i; - register p_nont p; + int i; + p_nont p; if (verbose == 2) for (i = 0, p = nonterms; i < nnonterms; i++, p++) @@ -319,12 +319,12 @@ STATIC void moreverbose(register p_set t) } } -STATIC void prrule(p_gram p) +static void prrule(p_gram p) { /* * Create a verbose printout of grammar rule p */ - register FILE* f; + FILE* f; int present = 0; int firstalt = 1; @@ -338,8 +338,8 @@ STATIC void prrule(p_gram p) return; case TERM: { - register p_term q; - register int c; + p_term q; + int c; q = g_getterm(p); if (present) @@ -395,7 +395,7 @@ STATIC void prrule(p_gram p) break; case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); if (firstalt) @@ -437,7 +437,7 @@ STATIC void prrule(p_gram p) case LITERAL: case TERMINAL: { - register p_token pt = &tokens[g_getcont(p)]; + p_token pt = &tokens[g_getcont(p)]; fprintf(f, pt->t_tokno < 0400 ? "'%s' " : "%s ", pt->t_string); break; @@ -451,7 +451,7 @@ STATIC void prrule(p_gram p) } } -STATIC void cfcheck(p_set s1, p_set s2, int flag) +static void cfcheck(p_set s1, p_set s2, int flag) { /* * Check if s1 and s2 have elements in common. @@ -459,7 +459,7 @@ STATIC void cfcheck(p_set s1, p_set s2, int flag) * conflict resolver, otherwise, flag must be zero, indicating * that there is not. */ - register p_set temp; + p_set temp; temp = setalloc(); setunion(temp, s1); @@ -481,7 +481,7 @@ STATIC void cfcheck(p_set s1, p_set s2, int flag) free((p_mem)temp); } -STATIC void resolve(p_gram p) +static void resolve(p_gram p) { /* * resolve conflicts, as specified by the user @@ -497,7 +497,7 @@ STATIC void resolve(p_gram p) break; case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); if (l->l_flag & AVOIDING) @@ -523,7 +523,7 @@ STATIC void resolve(p_gram p) } } -STATIC void propagate(p_set set, register p_gram p) +static void propagate(p_set set, p_gram p) { /* * Propagate the fact that on the elements of set the grammar rule @@ -536,7 +536,7 @@ STATIC void propagate(p_set set, register p_gram p) } } -STATIC void spaces(void) +static void spaces(void) { if (level > 0) fprintf(fout, "%*c", level, ' '); diff --git a/util/LLgen/src/compute.c b/util/LLgen/src/compute.c index 5e664ef035..f2affc20c4 100644 --- a/util/LLgen/src/compute.c +++ b/util/LLgen/src/compute.c @@ -42,36 +42,36 @@ typedef struct lngth /* Defined in this file : */ void do_compute(void); -STATIC void createsets(void); -STATIC void walk(p_set u, register p_gram p); -STATIC void co_trans(int (*fc)(p_nont p)); -STATIC int nempty(register p_nont p); -int empty(register p_gram p); -STATIC int nfirst(register p_nont p); +static void createsets(void); +static void walk(p_set u, p_gram p); +static void co_trans(int (*fc)(p_nont p)); +static int nempty(p_nont p); +int empty(p_gram p); +static int nfirst(p_nont p); #ifdef NON_CORRECTING -STATIC int nc_nfirst(register p_nont p); +static int nc_nfirst(p_nont p); #endif -STATIC int first(p_set setp, register p_gram p, int flag); +static int first(p_set setp, p_gram p, int flag); #ifdef NON_CORRECTING -STATIC int nc_first(p_set setp,register p_gram p,int flag); +static int nc_first(p_set setp, p_gram p,int flag); #endif -STATIC int nfollow(register p_nont p); -STATIC int follow(p_set setp, register p_gram p); +static int nfollow(p_nont p); +static int follow(p_set setp, p_gram p); #ifdef NON_CORRECTING -STATIC int nc_nfollow(register p_nont p); +static int nc_nfollow(p_nont p); #endif -STATIC void co_dirsymb(p_set setp, register p_gram p); -STATIC void co_others(p_gram p); -STATIC int ncomplength(p_nont p); -STATIC void do_lengthcomp(void); -STATIC void complength(register p_gram p, p_length le); -STATIC void add(register p_length a, int c, int v); -STATIC int compare(p_length a, p_length b); -STATIC void setdefaults(register p_gram p); -STATIC void do_contains(register p_nont n); -STATIC void contains(register p_gram p, register p_set set); -STATIC int nsafes(register p_nont p); -STATIC int do_safes(register p_gram p, int safe, register int *ch); +static void co_dirsymb(p_set setp, p_gram p); +static void co_others(p_gram p); +static int ncomplength(p_nont p); +static void do_lengthcomp(void); +static void complength(p_gram p, p_length le); +static void add(p_length a, int c, int v); +static int compare(p_length a, p_length b); +static void setdefaults(p_gram p); +static void do_contains(p_nont n); +static void contains(p_gram p, p_set set); +static int nsafes(p_nont p); +static int do_safes(p_gram p, int safe, int *ch); int t_safety(int rep, int count, int persistent, int safety); int t_after(int rep, int count, int outsafety); @@ -80,8 +80,8 @@ int t_after(int rep, int count, int outsafety); */ void do_compute(void) { - register p_nont p; - register p_start st; + p_nont p; + p_start st; createsets(); co_trans(nempty); /* Which nonterminals produce empty? */ @@ -184,17 +184,17 @@ void do_compute(void) * Allocate space for the sets. Also determine which files use * which nonterminals, and determine which nonterminals can be * made static. - */STATIC void createsets(void) + */static void createsets(void) { - register p_nont p; - register p_file f; - register p_start st; - register int i; + p_nont p; + p_file f; + p_start st; + int i; int n = NINTS(NBYTES(nnonterms)); for (f = files; f < maxfiles; f++) { - register p_set s; + p_set s; f->f_used = s = (p_set) alloc(n * sizeof(*(f->f_used))); for (i = n; i; i--) *s++ = 0; @@ -215,7 +215,7 @@ void do_compute(void) { for (i = f->f_nonterminals; i != -1; i = p->n_next) { - register p_file f2; + p_file f2; p = &nonterms[i]; for (f2 = files; f2 < maxfiles; f2++) @@ -236,7 +236,7 @@ void do_compute(void) /* * Walk through the grammar rule p, allocating sets */ -STATIC void walk(p_set u, register p_gram p) +static void walk(p_set u, p_gram p) { for (;;) { @@ -244,7 +244,7 @@ STATIC void walk(p_set u, register p_gram p) { case TERM: { - register p_term q; + p_term q; q = g_getterm(p); q->t_first = get_set(); @@ -258,7 +258,7 @@ STATIC void walk(p_set u, register p_gram p) } case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); l->l_symbs = get_set(); @@ -271,7 +271,7 @@ STATIC void walk(p_set u, register p_gram p) } case NONTERM: { - register int i = g_getcont(p); + int i = g_getcont(p); PUTIN(u, i); break; @@ -283,10 +283,10 @@ STATIC void walk(p_set u, register p_gram p) } } -STATIC void co_trans(int (*fc)(p_nont p)) +static void co_trans(int (*fc)(p_nont p)) { - register p_nont p; - register int change; + p_nont p; + int change; do { @@ -299,7 +299,7 @@ STATIC void co_trans(int (*fc)(p_nont p)) } while (change); } -STATIC int nempty(register p_nont p) +static int nempty(p_nont p) { if (!(p->n_flags & EMPTY) && empty(p->n_rule)) { @@ -312,7 +312,7 @@ STATIC int nempty(register p_nont p) /* * Does the rule pointed to by p produce empty ? */ -int empty(register p_gram p) +int empty(p_gram p) { for (;;) @@ -323,7 +323,7 @@ int empty(register p_gram p) return 1; case TERM: { - register p_term q; + p_term q; q = g_getterm(p); if (r_getkind(q) == STAR || r_getkind(q) == OPT || empty(q->t_rule)) @@ -352,13 +352,13 @@ int empty(register p_gram p) } } -STATIC int nfirst(register p_nont p) +static int nfirst(p_nont p) { return first(p->n_first, p->n_rule, 0); } #ifdef NON_CORRECTING -STATIC int nc_nfirst(register p_nont p) +static int nc_nfirst(p_nont p) { return nc_first(p->n_nc_first, p->n_rule, 0); } @@ -371,9 +371,9 @@ STATIC int nc_nfirst(register p_nont p) * The FIRST set is put in setp. * return 1 if the set refered to by "setp" changed */ -STATIC int first(p_set setp, register p_gram p, int flag) +static int first(p_set setp, p_gram p, int flag) { - register int s; /* Will gather return value */ + int s; /* Will gather return value */ int noenter;/* when set, unables entering of elements into * setp. This is necessary to walk through the * rest of rule p. @@ -389,7 +389,7 @@ STATIC int first(p_set setp, register p_gram p, int flag) return s; case TERM: { - register p_term q; + p_term q; q = g_getterm(p); if (flag == 0) @@ -406,7 +406,7 @@ STATIC int first(p_set setp, register p_gram p, int flag) } case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); if (flag == 0) @@ -436,7 +436,7 @@ STATIC int first(p_set setp, register p_gram p, int flag) break; case NONTERM: { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; if (noenter == 0) @@ -471,10 +471,10 @@ STATIC int first(p_set setp, register p_gram p, int flag) * start symbols is used whenever an action occurs. Else, only the * first-sets of startsynbols in the %substart are used */ -STATIC int nc_first(p_set setp,register p_gram p,int flag) +static int nc_first(p_set setp, p_gram p,int flag) { - register int s; /* Will gather return value */ + int s; /* Will gather return value */ int noenter;/* when set, unables entering of elements into * setp. This is necessary to walk through the * rest of rule p. @@ -490,7 +490,7 @@ STATIC int nc_first(p_set setp,register p_gram p,int flag) return s; case TERM : { - register p_term q; + p_term q; q = g_getterm(p); if (flag == 0) @@ -503,7 +503,7 @@ STATIC int nc_first(p_set setp,register p_gram p,int flag) break;} case ALTERNATION : { - register p_link l; + p_link l; l = g_getlink(p); if (flag == 0) @@ -518,7 +518,7 @@ STATIC int nc_first(p_set setp,register p_gram p,int flag) continue; case ACTION : { - register p_start subp; + p_start subp; if (!noenter) { @@ -551,7 +551,7 @@ STATIC int nc_first(p_set setp,register p_gram p,int flag) break; case NONTERM : { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; if (noenter == 0) @@ -573,7 +573,7 @@ STATIC int nc_first(p_set setp,register p_gram p,int flag) } #endif -STATIC int nfollow(register p_nont p) +static int nfollow(p_nont p) { return follow(p->n_follow, p->n_rule); } @@ -583,9 +583,9 @@ STATIC int nfollow(register p_nont p) * Compute the follow sets in the rule p from this set. * Return 1 if a follow set of a nonterminal changed. */ -STATIC int follow(p_set setp, register p_gram p) +static int follow(p_set setp, p_gram p) { - register int s; /* Will gather return value */ + int s; /* Will gather return value */ s = 0; for (;;) @@ -596,7 +596,7 @@ STATIC int follow(p_set setp, register p_gram p) return s; case TERM: { - register p_term q; + p_term q; q = g_getterm(p); if (empty(p + 1)) @@ -637,7 +637,7 @@ STATIC int follow(p_set setp, register p_gram p) break; case NONTERM: { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; s |= first(n->n_follow, p + 1, 1); @@ -660,19 +660,19 @@ STATIC int follow(p_set setp, register p_gram p) #ifdef NON_CORRECTING -STATIC int nc_nfollow(register p_nont p) +static int nc_nfollow(p_nont p) { return follow(p->n_nc_follow, p->n_rule); } -STATIC int nc_follow(p_set setp, register p_gram p) +static int nc_follow(p_set setp, p_gram p) { /* * setp is the follow set for the rule p. * Compute the follow sets in the rule p from this set. * Return 1 if a follow set of a nonterminal changed. */ - register int s; /* Will gather return value */ + int s; /* Will gather return value */ s = 0; for (;;) @@ -683,7 +683,7 @@ STATIC int nc_follow(p_set setp, register p_gram p) return s; case TERM : { - register p_term q; + p_term q; q = g_getterm(p); if (empty(p+1)) @@ -725,7 +725,7 @@ STATIC int nc_follow(p_set setp, register p_gram p) break; case NONTERM : { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; s |= nc_first(n->n_nc_follow,p+1,1); @@ -747,12 +747,12 @@ STATIC int nc_follow(p_set setp, register p_gram p) #endif -STATIC void co_dirsymb(p_set setp, register p_gram p) +static void co_dirsymb(p_set setp, p_gram p) { /* * Walk the rule p, doing the work for alternations */ - register p_gram s = 0; + p_gram s = 0; for (;;) { @@ -762,7 +762,7 @@ STATIC void co_dirsymb(p_set setp, register p_gram p) return; case TERM: { - register p_term q; + p_term q; q = g_getterm(p); co_dirsymb(q->t_follow, q->t_rule); @@ -770,7 +770,7 @@ STATIC void co_dirsymb(p_set setp, register p_gram p) } case ALTERNATION: { - register p_link l; + p_link l; /* * Save first alternative */ @@ -804,13 +804,13 @@ STATIC void co_dirsymb(p_set setp, register p_gram p) } } -STATIC void co_others(p_gram p) +static void co_others(p_gram p) { /* * compute the l_others-sets for the list of alternatives * indicated by p */ - register p_link l1, l2; + p_link l1, l2; l1 = g_getlink(p); p++; @@ -832,9 +832,9 @@ STATIC void co_others(p_gram p) static p_length length; # define INFINITY 32767 -STATIC int ncomplength(p_nont p) +static int ncomplength(p_nont p) { - register p_length pl = &length[p - nonterms]; + p_length pl = &length[p - nonterms]; int x = pl->cnt; pl->cnt = -1; @@ -851,10 +851,10 @@ STATIC int ncomplength(p_nont p) * - a crude measure of the number of terms and nonterminals in the * production of this shortest string. */ -STATIC void do_lengthcomp(void) +static void do_lengthcomp(void) { - register p_length pl; - register p_nont p; + p_length pl; + p_nont p; length = (p_length) alloc(nnonterms * sizeof(*length)); for (pl = &length[nnonterms - 1]; pl >= length; pl--) @@ -876,13 +876,13 @@ STATIC void do_lengthcomp(void) free((p_mem) length); } -STATIC void complength(register p_gram p, p_length le) +static void complength(p_gram p, p_length le) { /* * Walk grammar rule p, computing minimum lengths */ - register p_link l; - register p_term q; + p_link l; + p_term q; t_length i; t_length X; int cnt = 0; @@ -932,7 +932,7 @@ STATIC void complength(register p_gram p, p_length le) return; case TERM: { - register int rep; + int rep; q = g_getterm(p); rep = r_getkind(q); @@ -954,7 +954,7 @@ STATIC void complength(register p_gram p, p_length le) case NONTERM: { int nn = g_getcont(p); - register p_length pl = &length[nn]; + p_length pl = &length[nn]; int x = pl->cnt; if (x == INFINITY) @@ -973,7 +973,7 @@ STATIC void complength(register p_gram p, p_length le) } } -STATIC void add(register p_length a, int c, int v) +static void add(p_length a, int c, int v) { if (a->cnt == INFINITY || c == INFINITY) @@ -985,14 +985,14 @@ STATIC void add(register p_length a, int c, int v) a->cnt += c; } -STATIC int compare(p_length a, p_length b) +static int compare(p_length a, p_length b) { if (a->cnt != b->cnt) return a->cnt - b->cnt; return a->val - b->val; } -STATIC void setdefaults(register p_gram p) +static void setdefaults(p_gram p) { for (;;) { @@ -1005,7 +1005,7 @@ STATIC void setdefaults(register p_gram p) break; case ALTERNATION: { - register p_link l, l1; + p_link l, l1; int temp = 0, temp1, cnt = 0; t_length count, i; @@ -1041,7 +1041,7 @@ STATIC void setdefaults(register p_gram p) } } -STATIC void do_contains(register p_nont n) +static void do_contains(p_nont n) { /* * Compute the total set of symbols that nonterminal n can @@ -1071,7 +1071,7 @@ STATIC void do_contains(register p_nont n) } } -STATIC void contains(register p_gram p, register p_set set) +static void contains(p_gram p, p_set set) { /* * Does the real computation of the contains-sets @@ -1085,7 +1085,7 @@ STATIC void contains(register p_gram p, register p_set set) return; case TERM: { - register p_term q; + p_term q; int rep; q = g_getterm(p); @@ -1120,7 +1120,7 @@ STATIC void contains(register p_gram p, register p_set set) } case NONTERM: { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; do_contains(n); @@ -1134,7 +1134,7 @@ STATIC void contains(register p_gram p, register p_set set) } case ALTERNATION: { - register p_link l; + p_link l; l = g_getlink(p); contains(l->l_rule, (l->l_flag & DEF) ? set : (p_set) 0); @@ -1143,7 +1143,7 @@ STATIC void contains(register p_gram p, register p_set set) case LITERAL: case TERMINAL: { - register int hulp; + int hulp; if (set) { @@ -1157,10 +1157,10 @@ STATIC void contains(register p_gram p, register p_set set) } } -STATIC int nsafes(register p_nont p) +static int nsafes(p_nont p) { int ch; - register int i; + int i; ch = 0; i = getntsafe(p); @@ -1181,7 +1181,7 @@ STATIC int nsafes(register p_nont p) return ch; } -STATIC int do_safes(register p_gram p, int safe, register int *ch) +static int do_safes(p_gram p, int safe, int *ch) { /* * Walk the grammar rule, doing the computation described in the @@ -1202,7 +1202,7 @@ STATIC int do_safes(register p_gram p, int safe, register int *ch) break; case TERM: { - register p_term q; + p_term q; int i, rep; q = g_getterm(p); @@ -1216,8 +1216,8 @@ STATIC int do_safes(register p_gram p, int safe, register int *ch) } case ALTERNATION: { - register p_link l; - register int i; + p_link l; + int i; retval = -1; while (g_gettype(p) == ALTERNATION) @@ -1246,8 +1246,8 @@ STATIC int do_safes(register p_gram p, int safe, register int *ch) } case NONTERM: { - register p_nont n; - register int nsafe, osafe; + p_nont n; + int nsafe, osafe; n = &nonterms[g_getcont(p)]; nsafe = getntsafe(n); diff --git a/util/LLgen/src/gencode.c b/util/LLgen/src/gencode.c index 814c48ded9..988cfae1d5 100644 --- a/util/LLgen/src/gencode.c +++ b/util/LLgen/src/gencode.c @@ -50,39 +50,39 @@ static int firsts; /* are there any? */ static int listcount; /* In this file the following routines are defined: */ -STATIC void doclose(FILE *); -STATIC int *mk_tokenlist(void); -STATIC void genhdr(void); -STATIC void opentemp(string); -STATIC void geninclude(void); -STATIC void genrecovery(void); +static void doclose(FILE *); +static int *mk_tokenlist(void); +static void genhdr(void); +static void opentemp(string); +static void geninclude(void); +static void genrecovery(void); #ifdef NON_CORRECTING -STATIC void genncrecovery(void); +static void genncrecovery(void); #endif -STATIC void generate(p_file); -STATIC void prset(p_set); -STATIC void macro(string, p_nont); -STATIC void controlline(void); -STATIC void getparams(void); -STATIC void genprototypes(register p_file); -STATIC void getansiparams(int); -STATIC int gettok(void); -STATIC void rulecode(register p_gram, int, int, int); -STATIC void alternation(p_gram, int, int, int, int); -STATIC int *dopush(register p_gram, int, int, int **); -STATIC void getaction(int); -STATIC int codeforterm(register p_term, int, int); -STATIC void genswhead(register p_term, int, int, int, int); -STATIC void gencases(int *, int, int); -STATIC string genname(string); -STATIC void genpush(int); -STATIC void genincrdecr(string, int); -STATIC void genpop(int); -STATIC int analyze_switch(int *); -STATIC void add_cases(p_set, int *, int); -STATIC void out_list(int *, int, int); -STATIC void genextname(int, char *, FILE *); -STATIC void correct_prefix(void); +static void generate(p_file); +static void prset(p_set); +static void macro(string, p_nont); +static void controlline(void); +static void getparams(void); +static void genprototypes(p_file); +static void getansiparams(int); +static int gettok(void); +static void rulecode(p_gram, int, int, int); +static void alternation(p_gram, int, int, int, int); +static int *dopush(p_gram, int, int, int **); +static void getaction(int); +static int codeforterm(p_term, int, int); +static void genswhead(p_term, int, int, int, int); +static void gencases(int *, int, int); +static string genname(string); +static void genpush(int); +static void genincrdecr(string, int); +static void genpop(int); +static int analyze_switch(int *); +static void add_cases(p_set, int *, int); +static void out_list(int *, int, int); +static void genextname(int, char *, FILE *); +static void correct_prefix(void); extern void save_grammar(FILE *f); @@ -90,7 +90,7 @@ extern void save_grammar(FILE *f); # define NOPOP -20000 -STATIC void doclose(FILE *f) +static void doclose(FILE *f) { if (ferror(f) != 0) { @@ -99,10 +99,10 @@ STATIC void doclose(FILE *f) fclose(f); } -STATIC int *mk_tokenlist(void) +static int *mk_tokenlist(void) { - register int i = ntokens; - register int *p = (int *) alloc(i * sizeof(int)) + i; + int i = ntokens; + int *p = (int *) alloc(i * sizeof(int)) + i; while (i--) *--p = -1; @@ -110,7 +110,7 @@ STATIC int *mk_tokenlist(void) return p; } -STATIC void genhdr(void) +static void genhdr(void) { if (!firsts) fputs("#define LLNOFIRSTS\n", fpars); @@ -123,7 +123,7 @@ STATIC void genhdr(void) void gencode(int argc) { - register p_file p = files; + p_file p = files; /* Set up for code generation */ if ((fact = fopen(f_temp, "r")) == NULL ) @@ -162,7 +162,7 @@ void gencode(int argc) fclose(fact); } -STATIC void opentemp(string str) +static void opentemp(string str) { if ((fpars = fopen(f_pars, "w")) == NULL ) @@ -174,9 +174,9 @@ STATIC void opentemp(string str) fprintf(fpars, LLgenid, str); } -STATIC void geninclude(void) +static void geninclude(void) { - register p_token p; + p_token p; int maxno = 0; opentemp((string) 0); @@ -200,16 +200,16 @@ STATIC void geninclude(void) install(f_include, "."); } -STATIC void genrecovery(void) +static void genrecovery(void) { - register FILE *f; - register p_token t; - register int *q; - register p_nont p; - register p_set *psetl; + FILE *f; + p_token t; + int *q; + p_nont p; + p_set *psetl; int *index; int i; - register p_start st; + p_start st; opentemp((string) 0); f = fpars; @@ -325,11 +325,11 @@ STATIC void genrecovery(void) } #ifdef NON_CORRECTING -STATIC void genncrecovery(void) +static void genncrecovery(void) { - register FILE *f; - register p_token t; - register int *q; + FILE *f; + p_token t; + int *q; int *index; /* Generate the non-correcting error recovery file */ @@ -366,15 +366,15 @@ STATIC void genncrecovery(void) } #endif -STATIC void generate(p_file f) +static void generate(p_file f) { /* * Generates a parsing routine for every nonterminal */ - register int s; - register p_nont p; + int s; + p_nont p; int i; - register p_first ff; + p_first ff; int mustpop; int is_first = 1; @@ -439,10 +439,10 @@ STATIC void generate(p_file f) } } -STATIC void prset(p_set p) +static void prset(p_set p) { - register int k; - register unsigned i; + int k; + unsigned i; int j; j = nbytes; @@ -463,7 +463,7 @@ STATIC void prset(p_set p) UNREACHABLE_CODE; } -STATIC void macro(string s, p_nont n) +static void macro(string s, p_nont n) { int i; @@ -478,11 +478,11 @@ STATIC void macro(string s, p_nont n) fprintf(fpars, "#define %s(x) LLfirst((x), %d)\n", s, i); } -STATIC void controlline(void) +static void controlline(void) { /* Copy a compiler control line */ - register int l; - register FILE *f1, *f2; + int l; + FILE *f1, *f2; f1 = fact; f2 = fpars; @@ -497,13 +497,13 @@ STATIC void controlline(void) } while (l != '\n'); } -STATIC void getparams(void) +static void getparams(void) { /* getparams is called if a nonterminal has parameters. The names * of the parameters have to be found, and they should be declared */ long off; - register int l; + int l; char first; char add_semi = ' '; @@ -542,13 +542,13 @@ STATIC void getparams(void) fprintf(fpars, "%c\n", add_semi); } -STATIC void genprototypes(register p_file f) +static void genprototypes(p_file f) { /* * Generate prototypes for all nonterminals */ - register int i; - register p_nont p; + int i; + p_nont p; long off = ftell(fact); for (i = 0; i < nnonterms; i++) @@ -580,9 +580,9 @@ STATIC void genprototypes(register p_file f) /* getansiparams is called if a nonterminal has parameters * and an ANSI C function definition/declaration has to be produced. * If a definition has to be produced, "mkdef" is set to 1. - */STATIC void getansiparams(int mkdef) + */static void getansiparams(int mkdef) { - register int l; + int l; int delayed = 0; ltext[0] = '\0'; @@ -613,12 +613,12 @@ STATIC void genprototypes(register p_file f) fprintf(fpars, ") %c\n", mkdef ? ' ' : ';'); } -STATIC int gettok(void) +static int gettok(void) { /* Read from the action file. */ - register int ch; - register string c; - register FILE *f; + int ch; + string c; + FILE *f; f = fact; ch = getc(f); @@ -658,15 +658,15 @@ STATIC int gettok(void) } } -STATIC void rulecode(register p_gram p, int safety, int mustscan, int mustpop) +static void rulecode(p_gram p, int safety, int mustscan, int mustpop) { /* * Code for a production rule. */ - register int toplevel = 1; - register FILE *f; - register int *ppu; + int toplevel = 1; + FILE *f; + int *ppu; int *pushlist; int *ppushlist; @@ -706,7 +706,7 @@ STATIC void rulecode(register p_gram p, int safety, int mustscan, int mustpop) case LITERAL: case TERMINAL: { - register p_token t; + p_token t; string s; t = &tokens[g_getcont(p)]; @@ -747,7 +747,7 @@ STATIC void rulecode(register p_gram p, int safety, int mustscan, int mustpop) } case NONTERM: { - register p_nont n = &nonterms[g_getcont(p)]; + p_nont n = &nonterms[g_getcont(p)]; if (safety == NOSCANDONE && getntsafe(n) < NOSCANDONE) { @@ -789,12 +789,12 @@ STATIC void rulecode(register p_gram p, int safety, int mustscan, int mustpop) } } -STATIC void alternation(p_gram pp, int safety, int mustscan, int mustpop, +static void alternation(p_gram pp, int safety, int mustscan, int mustpop, int lb) { - register p_gram p = pp; - register FILE *f = fpars; - register p_link l; + p_gram p = pp; + FILE *f = fpars; + p_link l; int hulp, hulp1, hulp2; int haddefault = 0; int nsafe; @@ -981,13 +981,13 @@ STATIC void alternation(p_gram pp, int safety, int mustscan, int mustpop, free((p_mem) tokenlist); } -STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) +static int *dopush(p_gram p, int safety, int toplevel, int **pp) { /* * The safety only matters if toplevel != 0 */ size_t i = 100; - register int *ip = (int *) alloc(100 * sizeof(int)); + int *ip = (int *) alloc(100 * sizeof(int)); *pp = ip; @@ -1006,7 +1006,7 @@ STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) return ip; case TERM: { - register p_term q; + p_term q; int rep_kind, rep_count; q = g_getterm(p); @@ -1033,7 +1033,7 @@ STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) break; case NONTERM: { - register p_nont n; + p_nont n; n = &nonterms[g_getcont(p)]; if (toplevel == 0 @@ -1059,10 +1059,10 @@ STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) /* Read an action from the action file. * flag = 1 if it is an action, * 0 when reading parameters - */STATIC void getaction(int flag) + */static void getaction(int flag) { - register int ch; - register FILE *f; + int ch; + FILE *f; int mark = 0; if (flag == 1) @@ -1100,11 +1100,11 @@ STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) /* * Generate code for a term - */STATIC int codeforterm(register p_term q, int safety, int toplevel) + */static int codeforterm(p_term q, int safety, int toplevel) { - register FILE *f = fpars; - register int rep_count = r_getnum(q); - register int rep_kind = r_getkind(q); + FILE *f = fpars; + int rep_count = r_getnum(q); + int rep_kind = r_getkind(q); int term_is_persistent = (q->t_flags & PERSISTENT); int ispushed = NOPOP; @@ -1203,13 +1203,13 @@ STATIC int *dopush(register p_gram p, int safety, int toplevel, int **pp) return t_after(rep_kind, rep_count, gettout(q)); } -STATIC void genswhead(register p_term q, int rep_kind, int rep_count, +static void genswhead(p_term q, int rep_kind, int rep_count, int safety, int ispushed) { /* * Generate switch statement for term q */ - register FILE *f = fpars; + FILE *f = fpars; p_set p1; int hulp1 = 0, hulp2; int safeterm; @@ -1327,7 +1327,7 @@ STATIC void genswhead(register p_term q, int rep_kind, int rep_count, free((p_mem) tokenlist); } -STATIC void gencases(int *tokenlist, int caseno, int compacted) +static void gencases(int *tokenlist, int caseno, int compacted) { /* * setp points to a bitset indicating which cases must @@ -1344,8 +1344,8 @@ STATIC void gencases(int *tokenlist, int caseno, int compacted) * labeledstatement : labels statement ; * labels : labels label | ; */ - register p_token p; - register int i; + p_token p; + int i; if (compacted) fprintf(fpars, "case %d :\n", caseno); @@ -1368,9 +1368,9 @@ STATIC void gencases(int *tokenlist, int caseno, int compacted) * Generate a target file name from the * source file name s. */ -STATIC string genname(string s) +static string genname(string s) { - register string namebuf, c, d; + string namebuf, c, d; namebuf = alloc(strlen(s) + 3); c = namebuf; @@ -1398,12 +1398,12 @@ STATIC string genname(string s) return ralloc(namebuf, d - namebuf); } -STATIC void genpush(int d) +static void genpush(int d) { genincrdecr("incr", d); } -STATIC void genincrdecr(string s, int d) +static void genincrdecr(string s, int d) { if (d == NOPOP) return; @@ -1415,14 +1415,14 @@ STATIC void genincrdecr(string s, int d) fprintf(fpars, "LLt%s(%d);\n", s, -(d + 1)); } -STATIC void genpop(int d) +static void genpop(int d) { genincrdecr("decr", d); } -STATIC int analyze_switch(int *tokenlist) +static int analyze_switch(int *tokenlist) { - register int i; + int i; int ncases = 0; int percentage; int maxcase = 0, mincase = 0; @@ -1447,9 +1447,9 @@ STATIC int analyze_switch(int *tokenlist) return percentage >= low_percentage && percentage <= high_percentage; } -STATIC void add_cases(p_set s, int *tokenlist, int caseno) +static void add_cases(p_set s, int *tokenlist, int caseno) { - register int i; + int i; for (i = 0; i < ntokens; i++) { @@ -1460,10 +1460,10 @@ STATIC void add_cases(p_set s, int *tokenlist, int caseno) } } -STATIC void out_list(int *tokenlist, int listno, int casecnt) +static void out_list(int *tokenlist, int listno, int casecnt) { - register int i; - register FILE *f = fpars; + int i; + FILE *f = fpars; fprintf(f, "static %s LL%d_tklist[] = {", casecnt <= 127 ? "char" : "short", listno); @@ -1476,15 +1476,15 @@ STATIC void out_list(int *tokenlist, int listno, int casecnt) fprintf(f, "switch(LL%d_tklist[LLcsymb]) {\n", listno); } -STATIC void genextname(int d, char *s, FILE *f) +static void genextname(int d, char *s, FILE *f) { fprintf(f, "%s%d_%s", prefix ? prefix : "LL", d, s); } -STATIC void correct_prefix(void) +static void correct_prefix(void) { - register FILE *f = fpars; - register char *s = prefix; + FILE *f = fpars; + char *s = prefix; if (s) { diff --git a/util/LLgen/src/machdep.c b/util/LLgen/src/machdep.c index 3526326dec..8f190c9277 100644 --- a/util/LLgen/src/machdep.c +++ b/util/LLgen/src/machdep.c @@ -36,8 +36,8 @@ static string rcsid5 = "$Id$"; string libpath(string s) { /* Must deliver a full pathname to the library file "s" */ - register string p; - register size_t length; + string p; + size_t length; char* libdir = getenv("LLGEN_LIB_DIR"); if (!libdir) diff --git a/util/LLgen/src/main.c b/util/LLgen/src/main.c index c62610911c..30235dc55c 100644 --- a/util/LLgen/src/main.c +++ b/util/LLgen/src/main.c @@ -29,13 +29,13 @@ static string rcsid6 = "$Id$"; # endif /* In this file the following routines are defined: */ -STATIC void readgrammar(int, char *[]); -STATIC void doparse(register p_file); -STATIC void comfatal(void); +static void readgrammar(int, char *[]); +static void doparse(p_file); +static void comfatal(void); -int main(int argc, register string argv[]) +int main(int argc, string argv[]) { - register string arg; + string arg; f_dir = "."; f_temp = maketempfile(); @@ -221,12 +221,12 @@ int main(int argc, register string argv[]) exit(EXIT_SUCCESS); } -STATIC void readgrammar(int argc, char *argv[]) +static void readgrammar(int argc, char *argv[]) { /* * Do just what the name suggests : read the grammar */ - register p_file p; + p_file p; linecount = 0; f_input = "no filename"; @@ -267,7 +267,7 @@ STATIC void readgrammar(int argc, char *argv[]) comfatal(); } -STATIC void doparse(register p_file p) +static void doparse(p_file p) { linecount = 0; p->f_name = f_input; @@ -318,7 +318,7 @@ void fatal(int lineno, string s, string t) comfatal(); } -STATIC void comfatal(void) +static void comfatal(void) { /* * Some common code for exit on errors @@ -339,8 +339,8 @@ void copyfile(string file) /* * Copies a file indicated by the parameter to filedescriptor fpars. */ - register int c; - register FILE *f; + int c; + FILE *f; if ((f = fopen(file, "r")) == NULL) { @@ -389,8 +389,8 @@ void install(string target, string source) * if allowed (which means that the target must be generated * by LLgen from the source, or that the target is not present */ - register int c1, c2; - register FILE *f1, *f2; + int c1, c2; + FILE *f1, *f2; int cnt; string realtarget = !isabspath(target) ? aprintf("%s/%s", f_dir, target) : target; diff --git a/util/LLgen/src/name.c b/util/LLgen/src/name.c index da7eaab065..63c6073134 100644 --- a/util/LLgen/src/name.c +++ b/util/LLgen/src/name.c @@ -38,8 +38,8 @@ static p_entry entries, maxentries; static t_info token_info, nont_info; /* Defined in this file are: */ -STATIC int hash(string str); -STATIC p_entry newentry(string str, p_entry next); +static int hash(string str); +static p_entry newentry(string str, p_entry next); @@ -55,9 +55,9 @@ void name_init(void) #endif } -STATIC p_entry newentry(string str, p_entry next) +static p_entry newentry(string str, p_entry next) { - register p_entry p; + p_entry p; if ((p = entries) == maxentries) { @@ -79,7 +79,7 @@ STATIC p_entry newentry(string str, p_entry next) */ string store(string s) { - register string s1, t, u; + string s1, t, u; u = name; t = s; @@ -102,10 +102,10 @@ string store(string s) /* * Compute the hash for string str */ -STATIC int hash(string str) +static int hash(string str) { - register int i; - register string l; + int i; + string l; l = str; i = 0; @@ -120,11 +120,11 @@ STATIC int hash(string str) * It has type UNKNOWN, LITERAL, TERMINAL or NONTERM. * option can be ENTERING or BOTH (also looking). */ -p_gram search(int type, register string str, int option) +p_gram search(int type, string str, int option) { - register int val = 0; - register p_entry p; - register int i; + int val = 0; + p_entry p; + int i; int type1; i = hash(str); @@ -165,7 +165,7 @@ p_gram search(int type, register string str, int option) h_root[i] = p; if (type == TERMINAL || type == LITERAL) { - register p_token pt; + p_token pt; pt = (p_token) new_mem(&token_info); tokens = (p_token) token_info.i_ptr; @@ -248,7 +248,7 @@ p_gram search(int type, register string str, int option) * UNKNOWN and not yet declared means : NONTERM */ { - register p_nont q; + p_nont q; q = (p_nont) new_mem(&nont_info); nonterms = (p_nont) nont_info.i_ptr; diff --git a/util/LLgen/src/reach.c b/util/LLgen/src/reach.c index 9b458165dd..cc8564ea85 100644 --- a/util/LLgen/src/reach.c +++ b/util/LLgen/src/reach.c @@ -32,8 +32,8 @@ static string rcsid8 = "$Id$"; /* In this file the following routines are defined: */ void co_reach(void); -STATIC void reachable(register p_nont p); -STATIC void reachwalk(p_gram p); +static void reachable(p_nont p); +static void reachwalk(p_gram p); @@ -42,11 +42,11 @@ void co_reach(void) /* * Check for undefined or unreachable nonterminals. */ - register p_nont p; - register p_token t; - register p_start st; - register p_file x; - register int s; + p_nont p; + p_token t; + p_start st; + p_file x; + int s; /* Check for undefined nonterminals */ for (p = nonterms; p < maxnt; p++) { @@ -87,7 +87,7 @@ void co_reach(void) } } -STATIC void reachable(register p_nont p) +static void reachable(p_nont p) { /* * Enter the fact that p is reachable, and look for implications @@ -101,7 +101,7 @@ STATIC void reachable(register p_nont p) } } -STATIC void reachwalk(p_gram p) +static void reachwalk(p_gram p) { /* * Walk through rule p, looking for nonterminals. @@ -117,12 +117,12 @@ STATIC void reachwalk(p_gram p) reachwalk(g_getterm(p)->t_rule); break; case NONTERM : { - register p_nont n = &nonterms[g_getcont(p)]; + p_nont n = &nonterms[g_getcont(p)]; reachable(n); if (n->n_rule && g_gettype(n->n_rule) == EORULE && ! g_getnpar(p) && (getntparams(n) == 0)) { - register p_gram np = p; + p_gram np = p; do { *np = *(np + 1); np++; diff --git a/util/LLgen/src/savegram.c b/util/LLgen/src/savegram.c index f2047ecb15..949ef1239c 100644 --- a/util/LLgen/src/savegram.c +++ b/util/LLgen/src/savegram.c @@ -38,8 +38,8 @@ static int nt_highest; extern int nbytes; extern p_set start_firsts; -STATIC void save_rule(register p_gram p, int tail); -STATIC void save_set(p_set p); +static void save_rule(p_gram p, int tail); +static void save_set(p_set p); /* t_list will contain terms to be `flattened' */ static struct t_list @@ -73,9 +73,9 @@ void save_grammar(FILE* f) /* * Save the grammar */ - register p_nont p; - register p_start st; - register int nt_nr; + p_nont p; + p_start st; + int nt_nr; fgram = f; @@ -269,7 +269,7 @@ void save_grammar(FILE* f) fprintf(fgram, "#define LLNNONTERMINALS %d\n", nt_highest - assval + 1); } -STATIC void save_rule(register p_gram p, int tail) +static void save_rule(p_gram p, int tail) { /* Walk through rule p, saving it. The non-terminal tail is @@ -368,10 +368,10 @@ STATIC void save_rule(register p_gram p, int tail) } } -STATIC void save_set(p_set p) +static void save_set(p_set p) { - register int k; - register unsigned i; + int k; + unsigned i; int j; j = nbytes; diff --git a/util/LLgen/src/sets.c b/util/LLgen/src/sets.c index 6014839d2d..05521b3569 100644 --- a/util/LLgen/src/sets.c +++ b/util/LLgen/src/sets.c @@ -39,7 +39,7 @@ static t_info set_info; */ void setinit(int nt_needed) { - register int bitset; + int bitset; nbytes = NBYTES(ntokens); bitset = ALIGN(nbytes); @@ -58,7 +58,7 @@ p_set get_set(void) /* * Allocate a set that cannot be freed */ - register p_set p, q; + p_set p, q; static p_set sets, maxsets; if ((p = sets) >= maxsets) { @@ -77,8 +77,8 @@ p_set setalloc(void) /* * Allocate a set which can later be freed. */ - register p_set p; - register int size = setsize; + p_set p; + int size = setsize; p = (p_set) alloc(size * sizeof(*p)) + size; do { @@ -87,15 +87,15 @@ p_set setalloc(void) return p; } -int setunion(register p_set a,register p_set b) +int setunion(p_set a, p_set b) { /* * a = a union b. * Return 1 if the set a changed */ - register int i; - register int j; - register int nsub = 0; + int i; + int j; + int nsub = 0; i = setsize; do { @@ -107,14 +107,14 @@ int setunion(register p_set a,register p_set b) return nsub; } -int setintersect(register p_set a,register p_set b) +int setintersect(p_set a, p_set b) { /* * a = a intersect b. * return 1 if the result is empty */ - register int i; - register int nempty; + int i; + int nempty; nempty = 1; i = setsize; @@ -124,12 +124,12 @@ int setintersect(register p_set a,register p_set b) return nempty; } -void setminus(register p_set a,register p_set b) +void setminus(p_set a, p_set b) { /* * a = a setminus b */ - register int i; + int i; i = setsize; do { @@ -137,12 +137,12 @@ void setminus(register p_set a,register p_set b) } while (--i); } -int setempty(register p_set p) +int setempty(p_set p) { /* * Return 1 if the set p is empty */ - register int i; + int i; i = tsetsize; do { @@ -159,10 +159,10 @@ int findindex(p_set set) * Here is room for improvement. At the moment, the list of * sets is examined with linear search. */ - register p_set *t; - register p_set a; - register p_set b; - register int i; + p_set *t; + p_set a; + p_set b; + int i; int saved; /* @@ -196,9 +196,9 @@ int findindex(p_set set) return nbytes * (maxptr++ - setptr); } -int setcount(register p_set set, int *saved) +int setcount(p_set set, int *saved) { - register int i, j; + int i, j; for (j = 0, i = 0; i < ntokens; i++) { if (IN(set,i)) { diff --git a/util/LLgen/src/sets.h b/util/LLgen/src/sets.h index 61d7dad00d..c9302b1aae 100644 --- a/util/LLgen/src/sets.h +++ b/util/LLgen/src/sets.h @@ -50,20 +50,20 @@ extern p_set setalloc(void); * a = a union b. * Return 1 if the set a changed */ -extern int setunion(register p_set a,register p_set b); +extern int setunion(p_set a, p_set b); /* * a = a intersect b. * return 1 if the result is empty */ -extern int setintersect(register p_set a,register p_set b); +extern int setintersect(p_set a, p_set b); /* * a = a setminus b */ -extern void setminus(register p_set a,register p_set b); +extern void setminus(p_set a, p_set b); /* * Return 1 if the set p is empty */ -extern int setempty(register p_set p); +extern int setempty(p_set p); /* * The set "set" will serve as a recovery set. * Search for it in the table. If not present, enter it. @@ -71,6 +71,6 @@ extern int setempty(register p_set p); * sets is examined with linear search. */ extern int findindex(p_set set); -extern int setcount(register p_set set, int *saved); +extern int setcount(p_set set, int *saved); #endif /* SETS_H_ */ diff --git a/util/LLgen/src/tokens.c b/util/LLgen/src/tokens.c index 18117f4c77..3def28426f 100644 --- a/util/LLgen/src/tokens.c +++ b/util/LLgen/src/tokens.c @@ -72,11 +72,11 @@ int input(void); void unput(int c); void skipcomment(int flag); # ifdef LINE_DIRECTIVE -STATIC void linedirective(void); +static void linedirective(void); # endif -STATIC string cpy(int s,register string p,int inserted); -STATIC string vallookup(int s); -STATIC void copyact(char ch1,char ch2,int flag,int level); +static string cpy(int s,string p,int inserted); +static string vallookup(int s); +static void copyact(char ch1,char ch2,int flag,int level); static int nparams; # line 76 "tokens.g" @@ -122,7 +122,7 @@ static t_token savedtok; /* to save lextoken in case of an insertion */ static int nostartline; /* = 0 if at the start of a line */ # endif -STATIC void copyact(char ch1,char ch2,int flag,int level) +static void copyact(char ch1,char ch2,int flag,int level) { /* * Copy an action to file f. Opening bracket is ch1, closing bracket @@ -239,8 +239,8 @@ int scanner(void) /* * Lexical analyser, what else */ - register int ch; /* Current char */ - register char *p = ltext; + int ch; /* Current char */ + char *p = ltext; int reserved = 0; /* reserved word? */ char *max = <ext[LTEXTSZ - 1]; static int nextexpr; @@ -305,7 +305,7 @@ int scanner(void) case ISSPA : continue; case ISDIG : { - register int i = 0; + int i = 0; do { i = 10 * i + (ch - '0'); ch= input(); @@ -333,7 +333,7 @@ int scanner(void) if (reserved) { /* * Now search for the keyword */ - register p_keyw w; + p_keyw w; w = resword; while (w->w_word) { @@ -365,7 +365,7 @@ int input(void) /* * Low level input routine, used by all other input routines */ - register int c; + int c; if ((c = backupc)) { /* Last char was "unput()". Deliver it again @@ -406,7 +406,7 @@ void skipcomment(int flag) * Skip comment. If flag != 0, the comment is inside a fragment * of C-code, so keep it. */ - register int ch; + int ch; int saved; /* line count on which comment starts */ saved = linecount; @@ -425,16 +425,16 @@ void skipcomment(int flag) } # ifdef LINE_DIRECTIVE -STATIC void linedirective(void) +static void linedirective(void) { /* * Read a line directive */ - register int ch; - register int i; + int ch; + int i; string s_error = "Illegal line directive"; string store(); - register string c; + string c; do { /* * Skip to next digit @@ -474,12 +474,12 @@ STATIC void linedirective(void) } # endif -STATIC string vallookup(int s) +static string vallookup(int s) { /* * Look up the keyword that has token number s */ - register p_keyw p = resword; + p_keyw p = resword; while (p->w_value) { if (p->w_value == s) return p->w_word; @@ -488,14 +488,14 @@ STATIC string vallookup(int s) return 0; } -STATIC string cpy(int s,register string p,int inserted) +static string cpy(int s,string p,int inserted) { /* * Create a piece of error message for token s and put it at p. * inserted = 0 if the token s was deleted (in which case we have * attributes), else it was inserted */ - register string t = 0; + string t = 0; switch(s) { case C_IDENT : @@ -567,7 +567,7 @@ void LLmessage(int d) * or non-zero, in which case it represents a token that is inserted * before the current token */ - register string s,t; + string s,t; char buf[128]; nerrors++; diff --git a/util/LLgen/src/tokens.g b/util/LLgen/src/tokens.g index 5b4cc3cd74..db3c59007a 100644 --- a/util/LLgen/src/tokens.g +++ b/util/LLgen/src/tokens.g @@ -36,11 +36,11 @@ int input(void); void unput(int c); void skipcomment(int flag); # ifdef LINE_DIRECTIVE -STATIC void linedirective(void); +static void linedirective(void); # endif -STATIC string cpy(int s,register string p,int inserted); -STATIC string vallookup(int s); -STATIC void copyact(char ch1,char ch2,int flag,int level); +static string cpy(int s,register string p,int inserted); +static string vallookup(int s); +static void copyact(char ch1,char ch2,int flag,int level); static int nparams; } @@ -115,7 +115,7 @@ static t_token savedtok; /* to save lextoken in case of an insertion */ static int nostartline; /* = 0 if at the start of a line */ # endif -STATIC void copyact(char ch1,char ch2,int flag,int level) +static void copyact(char ch1,char ch2,int flag,int level) { /* * Copy an action to file f. Opening bracket is ch1, closing bracket @@ -418,7 +418,7 @@ void skipcomment(int flag) } # ifdef LINE_DIRECTIVE -STATIC void linedirective(void) +static void linedirective(void) { /* * Read a line directive @@ -467,7 +467,7 @@ STATIC void linedirective(void) } # endif -STATIC string vallookup(int s) +static string vallookup(int s) { /* * Look up the keyword that has token number s @@ -481,7 +481,7 @@ STATIC string vallookup(int s) return 0; } -STATIC string cpy(int s,register string p,int inserted) +static string cpy(int s,register string p,int inserted) { /* * Create a piece of error message for token s and put it at p. diff --git a/util/LLgen/src/types.h b/util/LLgen/src/types.h index a20b8ab328..ff361753f9 100644 --- a/util/LLgen/src/types.h +++ b/util/LLgen/src/types.h @@ -274,10 +274,4 @@ p_mem alloc(size_t); p_mem ralloc(p_mem, size_t); p_mem new_mem(p_info); -# ifdef NDEBUG -# define STATIC static -# else /* not NDEBUG */ -# define STATIC extern -# endif /* not NDEBUG */ - #endif /* TYPES_H_ */ diff --git a/util/ack/dmach.h b/util/ack/dmach.h index f7d6badc71..f5808f8f2e 100644 --- a/util/ack/dmach.h +++ b/util/ack/dmach.h @@ -12,12 +12,12 @@ #define RCS_DMACH "$Id$" #endif +typedef struct +{ + char* ma_name; /* The name of the machine */ + int ma_index; +} dmach; -typedef struct { - char *ma_name ; /* The name of the machine */ - int ma_index ; -} dmach ; +extern dmach massoc[]; -extern dmach massoc[] ; - -extern char intable[] ; +extern char intable[]; diff --git a/util/ack/files.c b/util/ack/files.c index f72ff57ca1..06bfe08644 100644 --- a/util/ack/files.c +++ b/util/ack/files.c @@ -16,153 +16,196 @@ #include #ifndef NORCSID -static char rcs_id[] = "$Id$" ; +static char rcs_id[] = "$Id$"; #endif -static char *add_u(int part, char *ptr) { - if ( part>=26 ) { - ptr=add_u(part/26-1,ptr) ; +static char* add_u(int part, char* ptr) +{ + if (part >= 26) + { + ptr = add_u(part / 26 - 1, ptr); } - *ptr= part%26 + 'a' ; - return ptr+1 ; + *ptr = part % 26 + 'a'; + return ptr + 1; } -int setfiles(trf *phase) { +int setfiles(trf* phase) +{ /* Set the out structure according to the in structure, the transformation and some global data */ - growstring pathname ; - register list_elem *elem ; - static int out_used= 0 ; + growstring pathname; + list_elem* elem; + static int out_used = 0; - if ( !phase->t_next && !phase->t_isprep && outfile ) { - if ( out_used ) { - fuerror("only one output file allowed when using the -o flag") ; - } else { - if ( !phase->t_keep ) fatal("Removing result file") ; - phase->t_outfile=outfile ; - out_used++ ; + if (!phase->t_next && !phase->t_isprep && outfile) + { + if (out_used) + { + fuerror("only one output file allowed when using the -o flag"); } + else + { + if (!phase->t_keep) + fatal("Removing result file"); + phase->t_outfile = outfile; + out_used++; + } + } + if (phase->t_combine) + { + in.p_path = (char*)0; + in.p_keep = YES; + in.p_keeps = NO; } - if ( phase->t_combine ) { - in.p_path= (char *)0 ; - in.p_keep=YES ; - in.p_keeps=NO ; + if (phase->t_outfile && phase->t_keep) + { + out.p_path = phase->t_outfile; + out.p_keeps = NO; + out.p_keep = YES; } - if ( phase->t_outfile && phase->t_keep ) { - out.p_path=phase->t_outfile ; - out.p_keeps=NO ; - out.p_keep=YES ; - } else { - if ( !phase->t_keep && !t_flag ) { + else + { + if (!phase->t_keep && !t_flag) + { out.p_path = sys_maketempfile("ack", phase->t_out); - out.p_keep=NO ; - } else { - gr_init(&pathname) ; - if ( !p_basename ) { - gr_cat(&pathname,"Ack") ; - p_basename=keeps(gr_start(pathname)) ; - werror("Output written on %s%s", - p_basename,phase->t_out) ; - } else { - gr_cat(&pathname,p_basename) ; + out.p_keep = NO; + } + else + { + gr_init(&pathname); + if (!p_basename) + { + gr_cat(&pathname, "Ack"); + p_basename = keeps(gr_start(pathname)); + werror("Output written on %s%s", p_basename, phase->t_out); } - gr_cat(&pathname,phase->t_out) ; - out.p_path= gr_final(&pathname) ; - out.p_keep=YES ; + else + { + gr_cat(&pathname, p_basename); + } + gr_cat(&pathname, phase->t_out); + out.p_path = gr_final(&pathname); + out.p_keep = YES; } - out.p_keeps= YES ; + out.p_keeps = YES; } - scanlist( l_first(arguments), elem) { - if ( strcmp(l_content(*elem),out.p_path)==0 ) { - error("attempt to overwrite %s",out.p_path) ; - return 0 ; + scanlist(l_first(arguments), elem) + { + if (strcmp(l_content(*elem), out.p_path) == 0) + { + error("attempt to overwrite %s", out.p_path); + return 0; } } - return 1 ; + return 1; } -static void file_final(path *file) { - if ( file->p_path ) { - if ( !file->p_keep && t_flag<=1 ) { - if ( unlink(file->p_path)!=0 ) { - werror("couldn't unlink %s",file->p_path); +static void file_final(path* file) +{ + if (file->p_path) + { + if (!file->p_keep && t_flag <= 1) + { + if (unlink(file->p_path) != 0) + { + werror("couldn't unlink %s", file->p_path); } } - if ( file->p_keeps ) throws(file->p_path) ; + if (file->p_keeps) + throws(file->p_path); } - file->p_path= (char *)0 ; - file->p_keeps=NO ; - file->p_keep=NO ; + file->p_path = (char*)0; + file->p_keeps = NO; + file->p_keep = NO; } -void disc_files(trf *phase) { - path temp ; +void disc_files(trf* phase) +{ + path temp; - if ( !phase->t_combine ) { - file_final(&in) ; - } else { - disc_inputs(phase) ; + if (!phase->t_combine) + { + file_final(&in); + } + else + { + disc_inputs(phase); } - temp=in ; in=out ; out=temp ; + temp = in; + in = out; + out = temp; } -void disc_inputs(trf *phase) { +void disc_inputs(trf* phase) +{ /* Remove all the input files of this phase */ /* Only for combiners */ - register path *l_in ; - register list_elem *elem ; - scanlist( l_first(phase->t_inputs), elem) { - l_in= p_cont(*elem) ; - file_final(l_in) ; - freecore((char *)l_in) ; + path* l_in; + list_elem* elem; + scanlist(l_first(phase->t_inputs), elem) + { + l_in = p_cont(*elem); + file_final(l_in); + freecore((char*)l_in); } - l_clear(&phase->t_inputs) ; + l_clear(&phase->t_inputs); } -void rmfile(path *file) { +void rmfile(path* file) +{ /* Remove a file, do not complain when is does not exist */ - if ( file->p_path ) { - if ( t_flag<=1 ) unlink(file->p_path) ; - if ( file->p_keeps ) throws(file->p_path) ; - file->p_path= (char *)0 ; - file->p_keeps=NO ; - file->p_keep=NO ; + if (file->p_path) + { + if (t_flag <= 1) + unlink(file->p_path); + if (file->p_keeps) + throws(file->p_path); + file->p_path = (char*)0; + file->p_keeps = NO; + file->p_keep = NO; } } -void rmtemps(void) { +void rmtemps(void) +{ /* Called in case of disaster, always remove the current output file! - */ - register list_elem *elem ; + */ + list_elem* elem; - if ( t_flag>1 ) return ; - rmfile(&out) ; - file_final(&in) ; - scanlist(l_first(tr_list),elem) { - if ( t_cont(*elem)->t_combine && t_cont(*elem)->t_do ) { - disc_inputs(t_cont(*elem)) ; + if (t_flag > 1) + return; + rmfile(&out); + file_final(&in); + scanlist(l_first(tr_list), elem) + { + if (t_cont(*elem)->t_combine && t_cont(*elem)->t_do) + { + disc_inputs(t_cont(*elem)); } } } -void add_input(path *file, trf *phase) { - register path *store ; +void add_input(path* file, trf* phase) +{ + path* store; #ifdef DEBUG - if ( debug ) { - vprint("Adding %s to inputs of %s\n", - file->p_path,phase->t_name) ; + if (debug) + { + vprint("Adding %s to inputs of %s\n", file->p_path, phase->t_name); } #endif - phase->t_do=YES ; - if ( !phase->t_origname && orig.p_path[0]!='-' ) { + phase->t_do = YES; + if (!phase->t_origname && orig.p_path[0] != '-') + { /* This entry decides the name of the result */ - phase->t_origname= orig.p_path ; + phase->t_origname = orig.p_path; } - store= (path *) getcore(sizeof (path)) ; - *store = *file ; - l_add(&phase->t_inputs,(char *)store) ; + store = (path*)getcore(sizeof(path)); + *store = *file; + l_add(&phase->t_inputs, (char*)store); /* The task of getting rid of the string is passed to 'phase', as is the task to get rid of the file itself. */ - file->p_keeps=NO ; file->p_keep=YES ; + file->p_keeps = NO; + file->p_keep = YES; } diff --git a/util/ack/grows.c b/util/ack/grows.c index 069aa2a3ca..f6c4d26927 100644 --- a/util/ack/grows.c +++ b/util/ack/grows.c @@ -15,61 +15,75 @@ #include "grows.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; -static char rcs_grows[] = RCS_GROWS ; +static char rcs_id[] = "$Id$"; +static char rcs_grows[] = RCS_GROWS; #endif -void gr_add(growstring *id, int c) { - if ( id->gr_size==id->gr_max) { - if ( id->gr_size==0 ) { /* The first time */ - id->gr_max= 2*GR_MORE ; - id->gr_string= getcore(id->gr_max) ; - } else { - id->gr_max += GR_MORE ; - id->gr_string= changecore(id->gr_string,id->gr_max ) ; +void gr_add(growstring* id, int c) +{ + if (id->gr_size == id->gr_max) + { + if (id->gr_size == 0) + { /* The first time */ + id->gr_max = 2 * GR_MORE; + id->gr_string = getcore(id->gr_max); + } + else + { + id->gr_max += GR_MORE; + id->gr_string = changecore(id->gr_string, id->gr_max); } } - *(id->gr_string+id->gr_size++)= c ; + *(id->gr_string + id->gr_size++) = c; } -void gr_cat(growstring *id, const char *string) { - const char *ptr ; +void gr_cat(growstring* id, const char* string) +{ + const char* ptr; #ifdef DEBUG - if ( id->gr_size && *(id->gr_string+id->gr_size-1) ) { - vprint("Non-zero terminated %*s\n", - id->gr_size, id->gr_string ) ; + if (id->gr_size && *(id->gr_string + id->gr_size - 1)) + { + vprint("Non-zero terminated %*s\n", id->gr_size, id->gr_string); } #endif - if ( id->gr_size ) id->gr_size-- ; - ptr=string ; - for (;;) { - gr_add(id,*ptr) ; - if ( *ptr++ ) continue ; - break ; + if (id->gr_size) + id->gr_size--; + ptr = string; + for (;;) + { + gr_add(id, *ptr); + if (*ptr++) + continue; + break; } } -void gr_throw(growstring *id) { +void gr_throw(growstring* id) +{ /* Throw the string away */ - if ( id->gr_max==0 ) return ; - freecore(id->gr_string) ; - id->gr_string = 0 ; - id->gr_max=0 ; - id->gr_size=0 ; + if (id->gr_max == 0) + return; + freecore(id->gr_string); + id->gr_string = 0; + id->gr_max = 0; + id->gr_size = 0; } -void gr_init(growstring *id) { - id->gr_size=0 ; id->gr_max=0 ; +void gr_init(growstring* id) +{ + id->gr_size = 0; + id->gr_max = 0; } -char *gr_final(growstring *id) { +char* gr_final(growstring* id) +{ /* Throw away the bookkeeping, adjust the string to its final length and return a pointer to a string to be get rid of with throws */ - register char *retval ; - retval= keeps(gr_start(*id)) ; - gr_throw(id) ; - return retval ; + char* retval; + retval = keeps(gr_start(*id)); + gr_throw(id); + return retval; } diff --git a/util/ack/grows.h b/util/ack/grows.h index 48fa4d4b42..9557f85d7e 100644 --- a/util/ack/grows.h +++ b/util/ack/grows.h @@ -8,20 +8,21 @@ /* struct used to identify and do bookkeeping for growing strings */ -typedef struct { - char *gr_string ; /* Points to start of string */ - unsigned gr_size ; /* Current string size */ - unsigned gr_max ; /* Maximum string size */ -} growstring ; +typedef struct +{ + char* gr_string; /* Points to start of string */ + unsigned gr_size; /* Current string size */ + unsigned gr_max; /* Maximum string size */ +} growstring; -#define GR_MORE 50 /* Steps to grow */ +#define GR_MORE 50 /* Steps to grow */ -#define gr_start(id) (id).gr_string /* The start of the string */ +#define gr_start(id) (id).gr_string /* The start of the string */ /* Routines used */ -void gr_throw(growstring *) ; /* To free the core */ -void gr_add(growstring *, int) ; /* To add one character */ -void gr_cat(growstring *, const char *) ; /* To append a string */ -void gr_init(growstring *) ; /* Initialize the bookkeeping */ -char *gr_final(growstring *) ; /* Move to a stable storage string */ +void gr_throw(growstring*); /* To free the core */ +void gr_add(growstring*, int); /* To add one character */ +void gr_cat(growstring*, const char*); /* To append a string */ +void gr_init(growstring*); /* Initialize the bookkeeping */ +char* gr_final(growstring*); /* Move to a stable storage string */ diff --git a/util/ack/list.c b/util/ack/list.c index 5370e96cb2..a24823f9ae 100644 --- a/util/ack/list.c +++ b/util/ack/list.c @@ -9,63 +9,70 @@ #include "list.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; -static char rcs_list[] = RCS_LIST ; +static char rcs_id[] = "$Id$"; +static char rcs_list[] = RCS_LIST; #endif /* List handling, operations allowed: - adding strings to the list, - throwing away whole lists, - linearize a list. + adding strings to the list, + throwing away whole lists, + linearize a list. Routines: - l_add(header,string) Add an element to a list. - header List header, list_head * - string String pointer, char * - the string is NOT copied + l_add(header,string) Add an element to a list. + header List header, list_head * + string String pointer, char * + the string is NOT copied - l_clear(header) Delete an whole list. - header List header, list_head * - - l_throw(header) Delete a list of strings. - header List header, list_head * + l_clear(header) Delete an whole list. + header List header, list_head * -*/ + l_throw(header) Delete a list of strings. + header List header, list_head * +*/ -void l_add(list_head *header, char *string) { - register list_elem *new; +void l_add(list_head* header, char* string) +{ + list_elem* new; /* NOSTRICT */ - new= (list_elem *)getcore(sizeof *new); - l_content(*new)= string ; + new = (list_elem*)getcore(sizeof *new); + l_content(*new) = string; /* NOSTRICT */ - l_next(*new)= (list_elem *)0 ; - if ( !header->ca_first ) { - header->ca_first= new ; - } else { - header->ca_last->ca_next= new ; + l_next(*new) = (list_elem*)0; + if (!header->ca_first) + { + header->ca_first = new; + } + else + { + header->ca_last->ca_next = new; } - header->ca_last= new ; + header->ca_last = new; } -void l_clear(list_head *header) { - register list_elem *old, *next; - for ( old=header->ca_first ; old ; old= next ) { - next= old->ca_next ; - freecore((char *)old) ; +void l_clear(list_head* header) +{ + list_elem *old, *next; + for (old = header->ca_first; old; old = next) + { + next = old->ca_next; + freecore((char*)old); } - header->ca_first= (list_elem *) 0 ; - header->ca_last = (list_elem *) 0 ; + header->ca_first = (list_elem*)0; + header->ca_last = (list_elem*)0; } -void l_throw(list_head *header) { - register list_elem *old, *next; - for ( old=header->ca_first ; old ; old= next ) { - throws(l_content(*old)) ; - next= old->ca_next ; - freecore((char *)old) ; +void l_throw(list_head* header) +{ + list_elem *old, *next; + for (old = header->ca_first; old; old = next) + { + throws(l_content(*old)); + next = old->ca_next; + freecore((char*)old); } - header->ca_first= (list_elem *) 0 ; - header->ca_last = (list_elem *) 0 ; + header->ca_first = (list_elem*)0; + header->ca_last = (list_elem*)0; } diff --git a/util/ack/list.h b/util/ack/list.h index f96d8ce157..a56ba5c452 100644 --- a/util/ack/list.h +++ b/util/ack/list.h @@ -6,30 +6,31 @@ #define RCS_LIST "$Id$" #endif -struct ca_elem { - struct ca_elem *ca_next; /* The link */ - char *ca_cont; /* The contents */ -} ; +struct ca_elem +{ + struct ca_elem* ca_next; /* The link */ + char* ca_cont; /* The contents */ +}; -struct ca_list { - struct ca_elem *ca_first; /* The head */ - struct ca_elem *ca_last; /* The tail */ -} ; +struct ca_list +{ + struct ca_elem* ca_first; /* The head */ + struct ca_elem* ca_last; /* The tail */ +}; -typedef struct ca_list list_head ; /* The decl. for headers */ -typedef struct ca_elem list_elem ; /* The decl. for elements */ +typedef struct ca_list list_head; /* The decl. for headers */ +typedef struct ca_elem list_elem; /* The decl. for elements */ /* Some operations */ /* Access */ -#define l_first(header) (header).ca_first -#define l_next(elem) (elem).ca_next -#define l_content(elem) (elem).ca_cont +#define l_first(header) (header).ca_first +#define l_next(elem) (elem).ca_next +#define l_content(elem) (elem).ca_cont /* To be used for scanning lists, ptr is the running variable */ -#define scanlist(elem,ptr) \ - for ( ptr= elem ; ptr; ptr= l_next(*ptr) ) +#define scanlist(elem, ptr) for (ptr = elem; ptr; ptr = l_next(*ptr)) -void l_add(list_head *, char *); -void l_clear(list_head *); -void l_throw(list_head *); +void l_add(list_head*, char*); +void l_clear(list_head*); +void l_throw(list_head*); diff --git a/util/ack/main.c b/util/ack/main.c index b466d6025a..41a0611d6a 100644 --- a/util/ack/main.c +++ b/util/ack/main.c @@ -38,10 +38,10 @@ static void noodstop(int); int main(int argc, char** argv) { - register list_elem* elem; - register char* frontend; - register int* n_sig; - register trf* phase; + list_elem* elem; + char* frontend; + int* n_sig; + trf* phase; progname = argv[0]; varinit(); @@ -154,7 +154,7 @@ static char* getsuffix(void) static void varinit(void) { /* initialize the string variables */ - register char* envstr; + char* envstr; extern char* em_dir; if ((envstr = getenv("ACKDIR")) != NULL) @@ -170,9 +170,9 @@ static void varinit(void) void vieuwargs(int argc, char** argv) { - register char* argp; - register int nextarg; - register int eaten; + char* argp; + int nextarg; + int eaten; int hide; firstarg(argv[0]); @@ -301,7 +301,7 @@ void vieuwargs(int argc, char** argv) } if (!hide) { - register char* tokeep; + char* tokeep; tokeep = keeps(argp); if (argp[1] == 'R') { @@ -323,7 +323,7 @@ void vieuwargs(int argc, char** argv) static void firstarg(char* argp) { - register char* name; + char* name; name = strrchr(argp, '/'); if (!name) @@ -345,7 +345,7 @@ static int process(char* arg) { /* Process files & library arguments */ trf* phase; - register trf* tmp; + trf* tmp; #ifdef DEBUG if (debug) @@ -414,7 +414,7 @@ static int process(char* arg) static int startrf(trf* first) { /* Start the transformations at the indicated phase */ - register trf* phase; + trf* phase; phase = first; for (;;) @@ -506,7 +506,7 @@ static void block(trf* first) /* One of the input files of this phase could not be produced, block all combiners taking their input from this one. */ - register trf* phase; + trf* phase; for (phase = first; phase; phase = phase->t_next) { if (phase->t_combine) @@ -529,7 +529,7 @@ static int mayprep(void) static void scanneeds(void) { - register list_elem* elem; + list_elem* elem; scanlist(l_first(head_list), elem) { setneeds(l_content(*elem), 0); diff --git a/util/ack/mktables.c b/util/ack/mktables.c index b510a21bb8..fcba7b1917 100644 --- a/util/ack/mktables.c +++ b/util/ack/mktables.c @@ -10,119 +10,161 @@ #include #ifndef NORCSID -static char rcs_id[] = "$Id$" ; +static char rcs_id[] = "$Id$"; #endif -char *fname = 0 ; -char dname[200] ; -char *tail ; +char* fname = 0; +char dname[200]; +char* tail; -FILE *intab ; -FILE *dmach ; +FILE* intab; +FILE* dmach; -int offset ; +int offset; -void start(const char *) ; -void stop(int) ; -void readm(void) ; +void start(const char*); +void stop(int); +void readm(void); -int main(int argc, char **argv) { - int i ; +int main(int argc, char** argv) +{ + int i; - start(argv[1]) ; - for ( i=2 ; i2) ; - return 0 ; + stop(argc > 2); + return 0; } -void start(const char *dir) { - tail= dname ; - while ( *dir ) { - *tail++ = *dir ++ ; +void start(const char* dir) +{ + tail = dname; + while (*dir) + { + *tail++ = *dir++; } - if ( tail!=dname ) *tail++= '/' ; - offset=0 ; - intab= fopen("intable.c","w"); - dmach= fopen("dmach.c","w"); - if ( intab==NULL || dmach==NULL ) { - fprintf(stderr,"Couln't create output file(s)\n"); - exit ( 1) ; + if (tail != dname) + *tail++ = '/'; + offset = 0; + intab = fopen("intable.c", "w"); + dmach = fopen("dmach.c", "w"); + if (intab == NULL || dmach == NULL) + { + fprintf(stderr, "Couln't create output file(s)\n"); + exit(1); } - fprintf(dmach,"#include \"dmach.h\"\n\ndmach\tmassoc[] = {\n") ; - fprintf(intab,"char intable[] = {\n") ; + fprintf(dmach, "#include \"dmach.h\"\n\ndmach\tmassoc[] = {\n"); + fprintf(intab, "char intable[] = {\n"); } -void stop(int filled) { - fprintf(dmach,"\t{\"\",\t-1\t}\n} ;\n") ; - if ( !filled ) fprintf(intab,"\t0\n") ; - fprintf(intab,"\n} ;\n") ; - fclose(dmach); fclose(intab) ; +void stop(int filled) +{ + fprintf(dmach, "\t{\"\",\t-1\t}\n} ;\n"); + if (!filled) + fprintf(intab, "\t0\n"); + fprintf(intab, "\n} ;\n"); + fclose(dmach); + fclose(intab); } -FILE *do_open(const char *file) { - FILE *fd; +FILE* do_open(const char* file) +{ + FILE* fd; - strcpy(tail,file) ; - strcat(tail,"/"); - strcat(tail,"descr"); - if ((fd = fopen(dname,"r")) != NULL) return fd; - strcpy(tail,"descr/"); - strcat(tail,file); - return fopen(dname,"r"); + strcpy(tail, file); + strcat(tail, "/"); + strcat(tail, "descr"); + if ((fd = fopen(dname, "r")) != NULL) + return fd; + strcpy(tail, "descr/"); + strcat(tail, file); + return fopen(dname, "r"); } -void -readm(void) { - register int i ; - register int token ; - register FILE *in ; +void readm(void) +{ + int i; + int token; + FILE* in; - in=do_open(fname) ; - if ( in==NULL ) { - fprintf(stderr,"Cannot open %s\n",fname) ; - return ; + in = do_open(fname); + if (in == NULL) + { + fprintf(stderr, "Cannot open %s\n", fname); + return; } - i=0 ; - fprintf(dmach,"\t{\"%s\",\t%d\t},\n",fname,offset) ; - fprintf(intab,"\n/* %s */\n\t",fname) ; - for (;;) { - token=getc(in) ; - offset++ ; - if ( ++i == 10 ) { - fprintf(intab,"\n\t") ; - i=0 ; - } else { - fprintf(intab," ") ; + i = 0; + fprintf(dmach, "\t{\"%s\",\t%d\t},\n", fname, offset); + fprintf(intab, "\n/* %s */\n\t", fname); + for (;;) + { + token = getc(in); + offset++; + if (++i == 10) + { + fprintf(intab, "\n\t"); + i = 0; } - if ( !isascii(token) || !(isprint(token) || isspace(token)) ){ - if ( token!=EOF ) { - fprintf(stderr,"warning: non-ascii in %s\n",fname) ; - fprintf(intab,"%4d,",token) ; - } else { - fprintf(intab," 0,") ; - break ; + else + { + fprintf(intab, " "); + } + if (!isascii(token) || !(isprint(token) || isspace(token))) + { + if (token != EOF) + { + fprintf(stderr, "warning: non-ascii in %s\n", fname); + fprintf(intab, "%4d,", token); + } + else + { + fprintf(intab, " 0,"); + break; } - } else if ( isprint(token) ) { - switch ( token ) { - case '\'': fprintf(intab,"'\\''") ; break ; - case '\\': fprintf(intab,"'\\\\'") ; break ; - default: fprintf(intab," '%c'",token) ; break ; + } + else if (isprint(token)) + { + switch (token) + { + case '\'': + fprintf(intab, "'\\''"); + break; + case '\\': + fprintf(intab, "'\\\\'"); + break; + default: + fprintf(intab, " '%c'", token); + break; } - } else switch ( token ) { - case '\n' : fprintf(intab,"'\\n'") ; break ; - case '\t' : fprintf(intab,"'\\t'") ; break ; - case '\r' : fprintf(intab,"'\\r'") ; break ; - case '\f' : fprintf(intab,"'\\f'") ; break ; - case ' ' : fprintf(intab," ' '") ; break ; - default : fprintf(stderr,"warning: unrec. %d\n", - token) ; - fprintf(intab,"%4d",token) ; - break ; } - fprintf(intab,",") ; + else + switch (token) + { + case '\n': + fprintf(intab, "'\\n'"); + break; + case '\t': + fprintf(intab, "'\\t'"); + break; + case '\r': + fprintf(intab, "'\\r'"); + break; + case '\f': + fprintf(intab, "'\\f'"); + break; + case ' ': + fprintf(intab, " ' '"); + break; + default: + fprintf(stderr, "warning: unrec. %d\n", token); + fprintf(intab, "%4d", token); + break; + } + fprintf(intab, ","); } - fclose(in) ; + fclose(in); } diff --git a/util/ack/rmach.c b/util/ack/rmach.c index 1a4cd03a1b..4aecd87ad4 100644 --- a/util/ack/rmach.c +++ b/util/ack/rmach.c @@ -16,8 +16,8 @@ #include "data.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; -static char rcs_dmach[] = RCS_DMACH ; +static char rcs_id[] = "$Id$"; +static char rcs_dmach[] = RCS_DMACH; #endif /************************************************************************/ @@ -28,350 +28,454 @@ static char rcs_dmach[] = RCS_DMACH ; #define COMMENT '#' -#define VAR "var" -#define PASS "name" -#define IN "from" -#define OUT "to" -#define RES "outfile" -#define PROG "program" -#define MAPF "mapflag" -#define ARGS "args" -#define STD_IN "stdin" -#define STD_OUT "stdout" -#define PREP "prep" -#define OPT "optimizer" -#define LINKER "linker" +#define VAR "var" +#define PASS "name" +#define IN "from" +#define OUT "to" +#define RES "outfile" +#define PROG "program" +#define MAPF "mapflag" +#define ARGS "args" +#define STD_IN "stdin" +#define STD_OUT "stdout" +#define PREP "prep" +#define OPT "optimizer" +#define LINKER "linker" #define COMBINER "combiner" -#define PRIO "priority" -#define RUNT "rts" -#define NEEDT "need" -#define CALL "callname" -#define END "end" +#define PRIO "priority" +#define RUNT "rts" +#define NEEDT "need" +#define CALL "callname" +#define END "end" -static void intrf(void) ; -static void open_in(char *) ; -static void close_in(void) ; -static int getinchar(void) ; -static int getln(void) ; +static void intrf(void); +static void open_in(char*); +static void close_in(void); +static int getinchar(void); +static int getln(void); -static char *ty_name ; -static char *bol ; -static char *inname ; +static char* ty_name; +static char* bol; +static char* inname; -void setlist(char *name) { +void setlist(char* name) +{ /* Name is sought in the internal tables, if not present, the a file of that name is sought in first the current and then the EM Lib directory */ - inname=name ; - open_in(name) ; - while ( getln() ) { - if ( strcmp(VAR,ty_name)==0 ) { - doassign(bol,(char *)0,0) ; - } else - if ( strcmp(CALL,ty_name)==0 ) { - if ( callname && strcmp(bol,callname)==0 ) { - callname= (char *)0 ; + inname = name; + open_in(name); + while (getln()) + { + if (strcmp(VAR, ty_name) == 0) + { + doassign(bol, (char*)0, 0); + } + else if (strcmp(CALL, ty_name) == 0) + { + if (callname && strcmp(bol, callname) == 0) + { + callname = (char*)0; #ifdef DEBUG - if ( debug>=3 ) { + if (debug >= 3) + { vprint("found call name\n"); } #endif } - } else - if ( strcmp(PASS,ty_name)==0 ) { - intrf() ; - } else - error("unknown keyword %s",ty_name) ; + } + else if (strcmp(PASS, ty_name) == 0) + { + intrf(); + } + else + error("unknown keyword %s", ty_name); } close_in(); #ifdef DEBUG - if ( debug>=3 ) vprint("End %s\n",name) ; + if (debug >= 3) + vprint("End %s\n", name); #endif } -static int inoptlist(char *nm) { - register char *p=Optlist ; +static int inoptlist(char* nm) +{ + char* p = Optlist; - while ( p && *p ) { - register char *q=nm ; + while (p && *p) + { + char* q = nm; - while ( *q!='\0' && *q++==*p ) p++ ; - if ( *q=='\0' && ( *p=='\0' || *p==',' ) ) return 1 ; - while ( *p!='\0' && *p++!=',' ) /* nothing */ ; + while (*q != '\0' && *q++ == *p) + p++; + if (*q == '\0' && (*p == '\0' || *p == ',')) + return 1; + while (*p != '\0' && *p++ != ',') /* nothing */ + ; } return 0; } -static void intrf(void) { +static void intrf(void) +{ /* Read in trf (transformation) */ - register trf *new ; - int twice ; - int name_seen=0 ; + trf* new; + int twice; + int name_seen = 0; - new= (trf *)getcore(sizeof *new) ; - new->t_name= keeps(bol) ; - for (;;) { - if ( !getln() ) { - fuerror("unexpected EOF on %s",inname) ; + new = (trf*)getcore(sizeof *new); + new->t_name = keeps(bol); + for (;;) + { + if (!getln()) + { + fuerror("unexpected EOF on %s", inname); + } + twice = NO; + if (strcmp(ty_name, IN) == 0) + { + if (new->t_in) + twice = YES; + new->t_in = keeps(bol); + } + else if (strcmp(ty_name, OUT) == 0) + { + if (new->t_out) + twice = YES; + new->t_out = keeps(bol); + } + else if (strcmp(ty_name, PROG) == 0) + { + if (new->t_prog) + twice = YES; + new->t_prog = keeps(bol); + } + else if (strcmp(ty_name, MAPF) == 0) + { + l_add(&new->t_mapf, keeps(bol)); + } + else if (strcmp(ty_name, ARGS) == 0) + { + if (new->t_argd) + twice = YES; + new->t_argd = keeps(bol); } - twice= NO ; - if ( strcmp(ty_name,IN)==0 ) { - if ( new->t_in ) twice=YES ; - new->t_in= keeps(bol); - } else - if ( strcmp(ty_name,OUT)==0 ) { - if ( new->t_out ) twice=YES ; - new->t_out= keeps(bol); - } else - if ( strcmp(ty_name,PROG)==0 ) { - if ( new->t_prog ) twice=YES ; - new->t_prog= keeps(bol); - } else - if ( strcmp(ty_name,MAPF)==0 ) { - l_add(&new->t_mapf,keeps(bol)) ; - } else - if ( strcmp(ty_name,ARGS)==0 ) { - if ( new->t_argd ) twice=YES ; - new->t_argd= keeps(bol) ; - } else - if ( strcmp(ty_name,STD_IN)==0 ) { - if ( new->t_stdin ) twice=YES ; - new->t_stdin= YES ; - } else - if ( strcmp(ty_name,STD_OUT)==0 ) { - if ( new->t_stdout ) twice=YES ; - new->t_stdout= YES ; - } else - if ( strcmp(ty_name,PREP)==0 ) { - if ( strcmp(bol,"always")==0 ) { - if ( new->t_prep ) twice=YES ; - new->t_prep=YES ; - } else - if ( strcmp(bol,"cond")==0 ) { - if ( new->t_prep ) twice=YES ; - new->t_prep=MAYBE ; - } else - if ( strcmp(bol,"is")==0 ) { - if ( new->t_isprep ) twice=YES ; - new->t_isprep= YES ; - } else + else if (strcmp(ty_name, STD_IN) == 0) + { + if (new->t_stdin) + twice = YES; + new->t_stdin = YES; + } + else if (strcmp(ty_name, STD_OUT) == 0) + { + if (new->t_stdout) + twice = YES; + new->t_stdout = YES; + } + else if (strcmp(ty_name, PREP) == 0) + { + if (strcmp(bol, "always") == 0) + { + if (new->t_prep) + twice = YES; + new->t_prep = YES; + } + else if (strcmp(bol, "cond") == 0) + { + if (new->t_prep) + twice = YES; + new->t_prep = MAYBE; + } + else if (strcmp(bol, "is") == 0) + { + if (new->t_isprep) + twice = YES; + new->t_isprep = YES; + } + else { - fuerror("illegal preprocessor spec in %s: %s", - inname,bol) ; + fuerror("illegal preprocessor spec in %s: %s", inname, bol); } - } else - if ( strcmp(ty_name,OPT)==0 ) { - if ( new->t_optim ) twice=YES ; - new->t_optim= atoi(bol) ; - if (new->t_optim <= 0) new->t_optim = 1; - } else - if ( strcmp(ty_name,LINKER)==0 ) { - if ( new->t_linker ) twice=YES ; - new->t_linker= YES ; - new->t_combine= YES ; - } else - if ( strcmp(ty_name,COMBINER)==0 ) { - if ( new->t_combine ) twice=YES ; - new->t_combine= YES ; - } else - if ( strcmp(ty_name,PRIO)==0 ) { - new->t_priority= atoi(bol) ; - } else - if ( strcmp(ty_name,RUNT)==0 ) { - if ( new->t_rts ) twice=YES ; - new->t_rts= keeps(bol) ; - } else - if ( strcmp(ty_name,NEEDT)==0 ) { - if ( new->t_needed ) twice=YES ; - new->t_needed= keeps(bol) ; - } else - if ( strcmp(ty_name,RES)==0 ) { - if ( new->t_outfile ) twice=YES ; - new->t_outfile= keeps(bol) ; - } else - if ( strcmp(ty_name,CALL)==0 ) { - if ( callname && strcmp(bol,callname)==0 ) { - name_seen=1 ; - callname= (char *)0 ; + } + else if (strcmp(ty_name, OPT) == 0) + { + if (new->t_optim) + twice = YES; + new->t_optim = atoi(bol); + if (new->t_optim <= 0) + new->t_optim = 1; + } + else if (strcmp(ty_name, LINKER) == 0) + { + if (new->t_linker) + twice = YES; + new->t_linker = YES; + new->t_combine = YES; + } + else if (strcmp(ty_name, COMBINER) == 0) + { + if (new->t_combine) + twice = YES; + new->t_combine = YES; + } + else if (strcmp(ty_name, PRIO) == 0) + { + new->t_priority = atoi(bol); + } + else if (strcmp(ty_name, RUNT) == 0) + { + if (new->t_rts) + twice = YES; + new->t_rts = keeps(bol); + } + else if (strcmp(ty_name, NEEDT) == 0) + { + if (new->t_needed) + twice = YES; + new->t_needed = keeps(bol); + } + else if (strcmp(ty_name, RES) == 0) + { + if (new->t_outfile) + twice = YES; + new->t_outfile = keeps(bol); + } + else if (strcmp(ty_name, CALL) == 0) + { + if (callname && strcmp(bol, callname) == 0) + { + name_seen = 1; + callname = (char*)0; #ifdef DEBUG - if ( debug>=3 ) { - vprint("found call name in %s\n", - new->t_name) ; + if (debug >= 3) + { + vprint("found call name in %s\n", new->t_name); } #endif } - } else - if ( strcmp(ty_name,END)==0 ) { - break ; - } else { - fuerror("illegal keyword %s %s",ty_name,bol); } - if ( twice ) { - werror("%s: specified twice for %s", - ty_name, new->t_name) ; + else if (strcmp(ty_name, END) == 0) + { + break; + } + else + { + fuerror("illegal keyword %s %s", ty_name, bol); + } + if (twice) + { + werror("%s: specified twice for %s", ty_name, new->t_name); } } - if ( ! ( new->t_name && new->t_out && new->t_prog ) ) { - fuerror("insufficient specification for %s in %s", - new->t_name,inname) ; + if (!(new->t_name&& new->t_out&& new->t_prog)) + { + fuerror("insufficient specification for %s in %s", new->t_name, inname); } - if ( ! new->t_argd ) new->t_argd="" ; + if (!new->t_argd) + new->t_argd = ""; /* Warning, side effect */ - if ( name_seen && new->t_rts ) { - if ( rts && strcmp(rts,new->t_rts)!=0 ) { - error("Attempt to use two run-time systems, %s and %s", - rts, new->t_rts) ; + if (name_seen && new->t_rts) + { + if (rts && strcmp(rts, new->t_rts) != 0) + { + error("Attempt to use two run-time systems, %s and %s", rts, new->t_rts); } - rts= new->t_rts ; - l_add(&head_list, rts) ; - l_add(&tail_list, rts) ; + rts = new->t_rts; + l_add(&head_list, rts); + l_add(&tail_list, rts); } #ifdef DEBUG - if ( debug>=3 ) { - register list_elem *elem ; - vprint("%s: from %s to %s '%s'\n", - new->t_name,new->t_in ? new->t_in : "(null)",new->t_out,new->t_prog) ; - vprint("\targs: %s",new->t_argd) ; - scanlist( l_first(new->t_mapf), elem ) { - vprint("\t%s\n",l_content(*elem)) ; + if (debug >= 3) + { + list_elem* elem; + vprint( + "%s: from %s to %s '%s'\n", new->t_name, new->t_in ? new->t_in : "(null)", new->t_out, + new->t_prog); + vprint("\targs: %s", new->t_argd); + scanlist(l_first(new->t_mapf), elem) + { + vprint("\t%s\n", l_content(*elem)); } - if ( new->t_rts ) vprint("\trts: %s\n",new->t_rts) ; - if ( new->t_needed ) vprint("\tneeded: %s\n",new->t_needed) ; + if (new->t_rts) + vprint("\trts: %s\n", new->t_rts); + if (new->t_needed) + vprint("\tneeded: %s\n", new->t_needed); } #endif - if ( new->t_optim && - ( new->t_optim <= Optlevel || inoptlist(new->t_name) ) ) { + if (new->t_optim && (new->t_optim <= Optlevel || inoptlist(new->t_name))) + { new->t_optim = Optlevel; } - l_add(&tr_list,(char *)new) ; + l_add(&tr_list, (char*)new); } /************************** IO from core or file *******************/ -static int incore ; -static growstring rline ; -static FILE *infile ; -static char *inptr ; -char *em_dir = EM_DIR; +static int incore; +static growstring rline; +static FILE* infile; +static char* inptr; +char* em_dir = EM_DIR; -static void open_in(char *name) { - register dmach *cmac ; +static void open_in(char* name) +{ + dmach* cmac; - gr_init(&rline) ; - for ( cmac= massoc ; cmac->ma_index!= -1 ; cmac++ ) { - if ( strcmp(name,cmac->ma_name)==0 ) { - incore=YES ; - inptr= &intable[cmac->ma_index] ; - return ; + gr_init(&rline); + for (cmac = massoc; cmac->ma_index != -1; cmac++) + { + if (strcmp(name, cmac->ma_name) == 0) + { + incore = YES; + inptr = &intable[cmac->ma_index]; + return; } } /* Not in core */ - incore= NO ; + incore = NO; /* Try to read EM_DIR/lib/MACH/descr */ - gr_cat(&rline,em_dir) ; - gr_cat(&rline,"/lib/") ; gr_cat(&rline,name) ; - gr_cat(&rline,"/descr") ; - infile= fopen(gr_start(rline),"r") ; - if ( !infile ) { - gr_throw(&rline) ; - gr_cat(&rline,em_dir) ; gr_cat(&rline,"/") ; - gr_cat(&rline,ACK_PATH); gr_cat(&rline,"/") ; - gr_cat(&rline,name) ; - infile= fopen(gr_start(rline),"r") ; + gr_cat(&rline, em_dir); + gr_cat(&rline, "/lib/"); + gr_cat(&rline, name); + gr_cat(&rline, "/descr"); + infile = fopen(gr_start(rline), "r"); + if (!infile) + { + gr_throw(&rline); + gr_cat(&rline, em_dir); + gr_cat(&rline, "/"); + gr_cat(&rline, ACK_PATH); + gr_cat(&rline, "/"); + gr_cat(&rline, name); + infile = fopen(gr_start(rline), "r"); } - if ( !infile ) { - infile= fopen(name,"r") ; + if (!infile) + { + infile = fopen(name, "r"); } - if ( infile==NULL ) { - fuerror("Cannot find description for %s",name) ; + if (infile == NULL) + { + fuerror("Cannot find description for %s", name); } } -static void close_in(void) { - if ( !incore ) fclose(infile) ; - gr_throw(&rline) ; +static void close_in(void) +{ + if (!incore) + fclose(infile); + gr_throw(&rline); } -static char *readline(void) { +static char* readline(void) +{ /* Get a line from the input, return 0 if at end, The line is stored in a volatile buffer, a pointer to the line is returned. */ - register int nchar ; - enum { BOL, ESCAPE, SKIPPING, MOL } state = BOL ; + int nchar; + enum + { + BOL, + ESCAPE, + SKIPPING, + MOL + } state + = BOL; - gr_throw(&rline) ; - for (;;) { - nchar= getinchar() ; - if ( nchar==EOF ) { - if ( state!=BOL ) { - werror("incomplete line in %s", inname) ; + gr_throw(&rline); + for (;;) + { + nchar = getinchar(); + if (nchar == EOF) + { + if (state != BOL) + { + werror("incomplete line in %s", inname); } - return 0 ; + return 0; } - if ( state==SKIPPING ) { - if ( nchar=='\n' ) { - state= MOL ; - } else { - continue ; + if (state == SKIPPING) + { + if (nchar == '\n') + { + state = MOL; + } + else + { + continue; } } - if ( state==ESCAPE ) { - switch( nchar ) { - case '\n' : - break ; - default : - gr_add(&rline,BSLASH) ; - case COMMENT : - case BSLASH : - gr_add(&rline,nchar) ; - break ; + if (state == ESCAPE) + { + switch (nchar) + { + case '\n': + break; + default: + gr_add(&rline, BSLASH); + case COMMENT: + case BSLASH: + gr_add(&rline, nchar); + break; } - state= MOL ; - continue ; + state = MOL; + continue; } - switch ( nchar ) { - case '\n' : gr_add(&rline,0) ; - return gr_start(rline) ; - case COMMENT : state= SKIPPING ; - break ; - case BSLASH : state= ESCAPE ; - break ; - default : gr_add(&rline,nchar) ; - state= MOL ; + switch (nchar) + { + case '\n': + gr_add(&rline, 0); + return gr_start(rline); + case COMMENT: + state = SKIPPING; + break; + case BSLASH: + state = ESCAPE; + break; + default: + gr_add(&rline, nchar); + state = MOL; } } } -static int getinchar(void) { - register int token ; +static int getinchar(void) +{ + int token; - if ( incore ) { - if ( *inptr==0 ) return EOF ; - return *inptr++ ; + if (incore) + { + if (*inptr == 0) + return EOF; + return *inptr++; } - token= getc(infile) ; - if ( (token>=0177 || token <=0 ) && token !=EOF ) { - fuerror("Non-ascii character in description file %s",inname); + token = getc(infile); + if ((token >= 0177 || token <= 0) && token != EOF) + { + fuerror("Non-ascii character in description file %s", inname); } - return token ; + return token; } -static int getln(void) { - register char *c_ptr ; +static int getln(void) +{ + char* c_ptr; - do { - if ( (c_ptr=readline())==(char *)0 ) return 0 ; - ty_name= skipblank(c_ptr) ; - } while ( *ty_name==0 ) ; - c_ptr= firstblank(ty_name) ; - if ( *c_ptr ) { - *c_ptr++ =0 ; - c_ptr= skipblank(c_ptr) ; + do + { + if ((c_ptr = readline()) == (char*)0) + return 0; + ty_name = skipblank(c_ptr); + } while (*ty_name == 0); + c_ptr = firstblank(ty_name); + if (*c_ptr) + { + *c_ptr++ = 0; + c_ptr = skipblank(c_ptr); } - bol= c_ptr ; - return 1 ; + bol = c_ptr; + return 1; } diff --git a/util/ack/run.c b/util/ack/run.c index 2ed761bbcc..c9e4cbb2ca 100644 --- a/util/ack/run.c +++ b/util/ack/run.c @@ -36,7 +36,7 @@ static unsigned argmax; /* The maximum number of arguments so far */ int runphase(trf* phase) { - register list_elem* elem; + list_elem* elem; char* prog; int result; @@ -105,7 +105,7 @@ static int run_exec(trf* phase) oldstdin = dup(0); close(0); - if (open(in.p_path, O_RDONLY|O_BINARY) != 0) + if (open(in.p_path, O_RDONLY | O_BINARY) != 0) { error("cannot open %s", in.p_path); exit(1); @@ -119,7 +119,7 @@ static int run_exec(trf* phase) oldstdout = dup(1); close(1); - if (open(out.p_path, O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666) != 1) + if (open(out.p_path, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666) != 1) { close(1); dup(2); @@ -128,7 +128,7 @@ static int run_exec(trf* phase) } } - status = sys_system(phase->t_prog, (const char* const*) arglist); + status = sys_system(phase->t_prog, (const char* const*)arglist); if (oldstdin != -1) { diff --git a/util/ack/scan.c b/util/ack/scan.c index 0e6cfb6c26..97f0fad3c2 100644 --- a/util/ack/scan.c +++ b/util/ack/scan.c @@ -12,65 +12,70 @@ #include "data.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; +static char rcs_id[] = "$Id$"; #endif static void start_scan(void); -static void try(list_elem *, const char *); +static void try(list_elem*, const char*); static void scan_found(void); -static int satisfy(trf *, const char *); -static enum f_path scan_end(trf **); +static int satisfy(trf*, const char*); +static enum f_path scan_end(trf**); static void find_cpp(void); -enum f_path getpath(trf **first) { +enum f_path getpath(trf** first) +{ /* Try to find a transformation path */ start_scan(); /* - The end result is the chaining of - the consequtive phases with the t_next field. - The list is scanned for possible transformations - stopping at stopsuffix or the last transformation in the list. - The scan flags are set by this process. - When a transformation is found, it is compared with - the last transformation found. + The end result is the chaining of + the consequtive phases with the t_next field. + The list is scanned for possible transformations + stopping at stopsuffix or the last transformation in the list. + The scan flags are set by this process. + When a transformation is found, it is compared with + the last transformation found. */ - try(l_first(tr_list),p_suffix); + try(l_first(tr_list), p_suffix); return scan_end(first); } /******************** data used only while scanning *******************/ -static int last_pcount; /* The added priority of - the best path so far */ +static int last_pcount; /* The added priority of + the best path so far */ -static int last_ncount; /* The # of non-optimizing transformations - in the best path sofar */ +static int last_ncount; /* The # of non-optimizing transformations + in the best path sofar */ -static int last_ocount; /* The # of optimizing transformations in the - best path sofar */ +static int last_ocount; /* The # of optimizing transformations in the + best path sofar */ -static int suf_found; /* Was the suffix at least recognized ? */ +static int suf_found; /* Was the suffix at least recognized ? */ /******************** The hard work ********************/ -static void start_scan(void) { - register list_elem *scan ; +static void start_scan(void) +{ + list_elem* scan; - scanlist(l_first(tr_list),scan) { - t_cont(*scan)->t_scan=NO ; + scanlist(l_first(tr_list), scan) + { + t_cont(*scan)->t_scan = NO; } - suf_found= 0 ; + suf_found = 0; #ifdef DEBUG - if ( debug>=3 ) vprint("Scan_start\n"); + if (debug >= 3) + vprint("Scan_start\n"); #endif - last_ncount= -1 ; - last_ocount= 0 ; + last_ncount = -1; + last_ocount = 0; } -static void try(list_elem *f_scan, const char *suffix) { - register list_elem *scan ; - register trf *trafo ; +static void try(list_elem* f_scan, const char* suffix) +{ + list_elem* scan; + trf* trafo; /* Try to find a transformation path starting at f_scan for a file with the indicated suffix. If the suffix is already reached or a combiner is found @@ -78,187 +83,241 @@ static void try(list_elem *f_scan, const char *suffix) { If a transformation is found it calls itself recursively with as starting point the next transformation in the list. */ - if ( stopsuffix && *stopsuffix && strcmp(stopsuffix,suffix)==0 ) { + if (stopsuffix && *stopsuffix && strcmp(stopsuffix, suffix) == 0) + { scan_found(); - return ; + return; } - if (! f_scan) return; - scanlist(f_scan, scan) { - trafo= t_cont(*scan) ; - if ( satisfy(trafo,suffix) ) { + if (!f_scan) + return; + scanlist(f_scan, scan) + { + trafo = t_cont(*scan); + if (satisfy(trafo, suffix)) + { /* Found a transformation */ - suf_found= 1; + suf_found = 1; #ifdef DEBUG - if ( debug>=4 ) { - vprint("Found %s for %s: result %s\n", - trafo->t_name,suffix,trafo->t_out); + if (debug >= 4) + { + vprint("Found %s for %s: result %s\n", trafo->t_name, suffix, trafo->t_out); } #endif - trafo->t_scan=YES ; - if ( trafo->t_prep ) { - if ( !cpp_trafo ) { - find_cpp() ; + trafo->t_scan = YES; + if (trafo->t_prep) + { + if (!cpp_trafo) + { + find_cpp(); } - if ( stopsuffix && - strcmp(stopsuffix, - cpp_trafo->t_out)==0 ) + if (stopsuffix && strcmp(stopsuffix, cpp_trafo->t_out) == 0) { - scan_found() ; - return ; + scan_found(); + return; } } - if ( trafo->t_next ) { + if (trafo->t_next) + { /* We know what happens from this phase on, so take a shortcut. */ - register trf *sneak ; - sneak= trafo ; - while( (sneak=sneak->t_next) ) { - sneak->t_scan=YES ; + trf* sneak; + sneak = trafo; + while ((sneak = sneak->t_next)) + { + sneak->t_scan = YES; } - scan_found() ; - sneak= trafo ; - while( (sneak=sneak->t_next) ) { - sneak->t_scan=NO ; + scan_found(); + sneak = trafo; + while ((sneak = sneak->t_next)) + { + sneak->t_scan = NO; } - return ; + return; } - if ( trafo->t_linker && stopsuffix && !*stopsuffix ) { - trafo->t_scan=NO ; - scan_found() ; - return ; + if (trafo->t_linker && stopsuffix && !*stopsuffix) + { + trafo->t_scan = NO; + scan_found(); + return; } - if (! l_next(*scan) && !stopsuffix) { - scan_found() ; - } else { - try(l_next(*scan),trafo->t_out); + if (!l_next(*scan) && !stopsuffix) + { + scan_found(); } - trafo->t_scan= NO ; + else + { + try(l_next(*scan), trafo->t_out); + } + trafo->t_scan = NO; } } } -static void scan_found(void) { - register list_elem *scan; - int ncount, ocount, pcount ; +static void scan_found(void) +{ + list_elem* scan; + int ncount, ocount, pcount; - suf_found= 1; + suf_found = 1; #ifdef DEBUG - if ( debug>=3 ) vprint("Scan found\n") ; + if (debug >= 3) + vprint("Scan found\n"); #endif /* Gather data used in comparison */ - ncount=0; ocount=0; pcount=0; - scanlist(l_first(tr_list),scan) { - if (t_cont(*scan)->t_scan) { + ncount = 0; + ocount = 0; + pcount = 0; + scanlist(l_first(tr_list), scan) + { + if (t_cont(*scan)->t_scan) + { #ifdef DEBUG - if ( debug>=4 ) vprint("%s-",t_cont(*scan)->t_name) ; + if (debug >= 4) + vprint("%s-", t_cont(*scan)->t_name); #endif - if( t_cont(*scan)->t_optim ) ocount++ ;else ncount++ ; - if( t_cont(*scan)->t_optim>Optlevel ) pcount-- ; - pcount += t_cont(*scan)->t_priority ; + if (t_cont(*scan)->t_optim) + ocount++; + else + ncount++; + if (t_cont(*scan)->t_optim > Optlevel) + pcount--; + pcount += t_cont(*scan)->t_priority; } } #ifdef DEBUG - if ( debug>=4 ) vprint("\n"); + if (debug >= 4) + vprint("\n"); #endif - /* Is this transformation better then any found yet ? */ + /* Is this transformation better then any found yet ? */ #ifdef DEBUG - if ( debug>=3 ) { - vprint("old n:%d, o:%d, p:%d - new n:%d, o:%d, p:%d\n", - last_ncount,last_ocount,last_pcount, - ncount,ocount,pcount) ; + if (debug >= 3) + { + vprint( + "old n:%d, o:%d, p:%d - new n:%d, o:%d, p:%d\n", last_ncount, last_ocount, last_pcount, + ncount, ocount, pcount); } #endif - if ( last_ncount== -1 || /* None found yet */ - last_pcountncount || /* Shorter nec. path */ - (last_ncount==ncount && /* Same nec. path, optimize?*/ - (Optlevel? last_ocountocount ))))) { + if (last_ncount == -1 || /* None found yet */ + last_pcount < pcount || /* Better priority */ + (last_pcount == pcount && /* Same prio, and */ + (last_ncount > ncount || /* Shorter nec. path */ + (last_ncount == ncount && /* Same nec. path, optimize?*/ + (Optlevel ? last_ocount < ocount : last_ocount > ocount))))) + { /* Yes it is */ #ifdef DEBUG - if ( debug>=3 ) vprint("Better\n"); + if (debug >= 3) + vprint("Better\n"); #endif - scanlist(l_first(tr_list),scan) { - t_cont(*scan)->t_bscan=t_cont(*scan)->t_scan; + scanlist(l_first(tr_list), scan) + { + t_cont(*scan)->t_bscan = t_cont(*scan)->t_scan; } - last_ncount=ncount; last_ocount=ocount; last_pcount=pcount; + last_ncount = ncount; + last_ocount = ocount; + last_pcount = pcount; } } -static int satisfy(trf *trafo, const char *suffix) { - register char *f_char, *l_char ; +static int satisfy(trf* trafo, const char* suffix) +{ + char *f_char, *l_char; /* Check whether this transformation is present for the current machine and the parameter suffix is among the input suffices. If so, return 1. 0 otherwise */ - if ( trafo->t_isprep ) return 0 ; - l_char=trafo->t_in ; - while ( l_char ) { - f_char= l_char ; - if ( *f_char!=SUFCHAR || ! *(f_char+1) ) { - fuerror("Illegal input suffix entry for %s", - trafo->t_name) ; + if (trafo->t_isprep) + return 0; + l_char = trafo->t_in; + while (l_char) + { + f_char = l_char; + if (*f_char != SUFCHAR || !*(f_char + 1)) + { + fuerror("Illegal input suffix entry for %s", trafo->t_name); } - l_char=strchr(f_char+1,SUFCHAR); - if ( l_char ) *l_char = 0; - if ( strcmp(f_char,suffix)==0 ) { - if ( l_char ) *l_char = SUFCHAR; + l_char = strchr(f_char + 1, SUFCHAR); + if (l_char) + *l_char = 0; + if (strcmp(f_char, suffix) == 0) + { + if (l_char) + *l_char = SUFCHAR; return 1; } - if ( l_char ) *l_char = SUFCHAR; + if (l_char) + *l_char = SUFCHAR; } - return 0 ; + return 0; } -static enum f_path scan_end(trf **first) { /* Finalization */ +static enum f_path scan_end(trf** first) +{ /* Finalization */ /* Return value indicating whether a transformation was found */ /* Set the flags for the transformation up to, but not including, the combiner */ - register trf *prev, *curr ; - register list_elem *scan; + trf *prev, *curr; + list_elem* scan; #ifdef DEBUG - if ( debug>=3 ) vprint("End_scan\n"); + if (debug >= 3) + vprint("End_scan\n"); #endif - if ( last_ncount== -1 ) return suf_found ? F_NOPATH : F_NOMATCH ; + if (last_ncount == -1) + return suf_found ? F_NOPATH : F_NOMATCH; #ifdef DEBUG - if ( debug>=2 ) vprint("Transformation found\n"); + if (debug >= 2) + vprint("Transformation found\n"); #endif - prev= (trf *)0 ; *first= prev ; - scanlist(l_first(tr_list),scan) { - curr= t_cont(*scan) ; - if ( curr->t_bscan ) { - if ( prev ) { - prev->t_next= curr ; - if ( curr->t_linker ) prev->t_keep=YES ; - } else { - *first= curr ; + prev = (trf*)0; + *first = prev; + scanlist(l_first(tr_list), scan) + { + curr = t_cont(*scan); + if (curr->t_bscan) + { + if (prev) + { + prev->t_next = curr; + if (curr->t_linker) + prev->t_keep = YES; + } + else + { + *first = curr; } - if ( curr->t_next ) { - return F_TRANSFORM ; + if (curr->t_next) + { + return F_TRANSFORM; } - prev=curr ; + prev = curr; } } - if ( cpp_trafo && stopsuffix && - strcmp(stopsuffix,cpp_trafo->t_out)==0 ) { - cpp_trafo->t_keep=YES ; + if (cpp_trafo && stopsuffix && strcmp(stopsuffix, cpp_trafo->t_out) == 0) + { + cpp_trafo->t_keep = YES; } - if ( prev ) { - prev->t_keep=YES ; + if (prev) + { + prev->t_keep = YES; } - return F_TRANSFORM ; + return F_TRANSFORM; } -static void find_cpp(void) { - register list_elem *elem ; - scanlist( l_first(tr_list), elem ) { - if ( t_cont(*elem)->t_isprep ) { - if ( cpp_trafo ) fuerror("Multiple cpp's present") ; - cpp_trafo= t_cont(*elem) ; +static void find_cpp(void) +{ + list_elem* elem; + scanlist(l_first(tr_list), elem) + { + if (t_cont(*elem)->t_isprep) + { + if (cpp_trafo) + fuerror("Multiple cpp's present"); + cpp_trafo = t_cont(*elem); } } - if ( !cpp_trafo ) fuerror("No cpp present") ; + if (!cpp_trafo) + fuerror("No cpp present"); } diff --git a/util/ack/svars.c b/util/ack/svars.c index 5475932b85..f00063079c 100644 --- a/util/ack/svars.c +++ b/util/ack/svars.c @@ -8,109 +8,127 @@ #include "ack.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; +static char rcs_id[] = "$Id$"; #endif /* The processing of string valued variables, - this is an almost self contained module. + this is an almost self contained module. - Five externally visible routines: + Five externally visible routines: - setsvar(name,result) - Associate the name with the result. + setsvar(name,result) + Associate the name with the result. - name a string pointer - result a string pointer + name a string pointer + result a string pointer - setpvar(name,routine) - Associate the name with the routine. + setpvar(name,routine) + Associate the name with the routine. - name a string pointer - routine a routine id + name a string pointer + routine a routine id - The parameters name and result are supposed to be pointing to - non-volatile string storage used only for this call. + The parameters name and result are supposed to be pointing to + non-volatile string storage used only for this call. - char *getvar(name) - returns the pointer to a string associated with name, - the pointer is produced by returning result or the - value returned by calling the routine. + char *getvar(name) + returns the pointer to a string associated with name, + the pointer is produced by returning result or the + value returned by calling the routine. - name a string pointer + name a string pointer - Other routines called + Other routines called - fatal(args*) When something goes wrong - getcore(size) Core allocation + fatal(args*) When something goes wrong + getcore(size) Core allocation */ -struct vars { - char *v_name; - enum { routine, string } v_type; - - union { - char *v_string; - char *(*v_routine)(void); - } v_value ; - struct vars *v_next ; +struct vars +{ + char* v_name; + enum + { + routine, + string + } v_type; + + union + { + char* v_string; + char* (*v_routine)(void); + } v_value; + struct vars* v_next; }; -static struct vars *v_first ; +static struct vars* v_first; -static struct vars *newvar(char *name) { - register struct vars *new ; +static struct vars* newvar(char* name) +{ + struct vars* new; - for ( new=v_first ; new ; new= new->v_next ) { - if ( strcmp(name,new->v_name)==0 ) { - throws(name) ; - if ( new->v_type== string ) { - throws(new->v_value.v_string) ; + for (new = v_first; new; new = new->v_next) + { + if (strcmp(name, new->v_name) == 0) + { + throws(name); + if (new->v_type == string) + { + throws(new->v_value.v_string); } - return new ; + return new; } } - new= (struct vars *)getcore(sizeof (struct vars)); - new->v_name= name ; - new->v_next= v_first ; - v_first= new ; - return new ; + new = (struct vars*)getcore(sizeof(struct vars)); + new->v_name = name; + new->v_next = v_first; + v_first = new; + return new; } -void setsvar(char *name, char *str) { - register struct vars *new ; +void setsvar(char* name, char* str) +{ + struct vars* new; - new= newvar(name); + new = newvar(name); #ifdef DEBUG - if ( debug>=2 ) vprint("%s=%s\n", new->v_name, str) ; + if (debug >= 2) + vprint("%s=%s\n", new->v_name, str); #endif - new->v_type= string; - new->v_value.v_string= str; + new->v_type = string; + new->v_value.v_string = str; } -void setpvar(char *name, char *(*rout)(void)) { - register struct vars *new ; +void setpvar(char* name, char* (*rout)(void)) +{ + struct vars* new; - new= newvar(name); + new = newvar(name); #ifdef DEBUG - if ( debug>=2 ) vprint("%s= (*%o)()\n", new->v_name, rout) ; + if (debug >= 2) + vprint("%s= (*%o)()\n", new->v_name, rout); #endif - new->v_type= routine; - new->v_value.v_routine= rout; + new->v_type = routine; + new->v_value.v_routine = rout; } -char *getvar(const char *name) { - register struct vars *scan ; - - for ( scan=v_first ; scan ; scan= scan->v_next ) { - if ( strcmp(name,scan->v_name)==0 ) { - switch ( scan->v_type ) { - case string: - return scan->v_value.v_string ; - case routine: - return (*scan->v_value.v_routine)() ; +char* getvar(const char* name) +{ + struct vars* scan; + + for (scan = v_first; scan; scan = scan->v_next) + { + if (strcmp(name, scan->v_name) == 0) + { + switch (scan->v_type) + { + case string: + return scan->v_value.v_string; + case routine: + return (*scan->v_value.v_routine)(); } } } - return (char *)0 ; + return (char*)0; } diff --git a/util/ack/trans.c b/util/ack/trans.c index 451b74c31d..d25133f916 100644 --- a/util/ack/trans.c +++ b/util/ack/trans.c @@ -61,10 +61,10 @@ int transform(trf* phase) void getmapflags(trf* phase) { - register path* l_in; - register list_elem* elem; + path* l_in; + list_elem* elem; int scanned; - register char* ptr; + char* ptr; scanlist(l_first(flags), elem) { @@ -162,8 +162,8 @@ void add_tail(const char* str) void transini(void) { - register list_elem* elem; - register trf* phase; + list_elem* elem; + trf* phase; scanlist(l_first(tr_list), elem) { @@ -182,9 +182,9 @@ void transini(void) static void set_Rflag(char* argp) { - register char* eos; - register list_elem* prog; - register int length; + char* eos; + list_elem* prog; + int length; char *eq, *colon; eos = strchr(&argp[2], '-'); @@ -517,8 +517,8 @@ static growstring scanexpr(const char* line) static void condit(growstring* line, list_head* fsuff, list_head* lsuff, char* tailval) { - register list_elem* first; - register list_elem* last; + list_elem* first; + list_elem* last; #ifdef DEBUG if (debug >= 4) @@ -560,7 +560,7 @@ static int mapflag(list_head* maplist, const char* cflag) when not, (char *)0. The replacement sits in stable storage. */ - register list_elem* elem; + list_elem* elem; scanlist(l_first(*maplist), elem) { diff --git a/util/ack/trans.h b/util/ack/trans.h index 01d203ac57..58be3c956a 100644 --- a/util/ack/trans.h +++ b/util/ack/trans.h @@ -12,57 +12,63 @@ typedef struct transform trf; -struct transform { - char *t_in ; /* Suffices in '.o.k' */ - char *t_out ; /* Result '.suffix' */ - char *t_outfile ; /* Resulting output file */ - char *t_name ; /* The name of this transformation */ - list_head t_mapf ; /* Mapflags argument, uses varrep */ - char *t_argd ; /* Argument descriptor, uses varrep */ - char *t_needed ; /* Suffix indicating the libraries needed */ - char *t_rts ; /* Suffix indicating the major language used*/ - int t_stdin:1 ; /* The input is taken on stdin */ - int t_stdout:1 ; /* The output comes on stdout */ - int t_combine:1 ; /* Transform several files to one result */ - int t_visited:1 ; /* NO before setup, YES after */ - int t_prep:2 ; /* Needs preprocessor YES/NO/MAYBE */ - int t_isprep:1 ; /* Is preprocessor */ - int t_keep:1 ; /* Keep the output file */ - int t_scan:1 ; /* Used while finding path's */ - int t_bscan:1 ; /* Best scan so far, while finding path's */ - int t_linker:1 ; /* The linker usurps all unrecognized flags */ - int t_do:1 ; /* Is in a path to execute */ - int t_blocked:1 ; /* An input file could not be produced */ - short t_optim ; /* Is optimizer, + optimizer level */ - short t_priority ; /* Importance of including phase in scan */ - list_head t_inputs ; /* The input 'path's of a combiner */ - char *t_origname ; /* The basename of the output file */ - trf *t_next ; /* The transformation to be executed next */ - char *t_prog ; /* Pathname for load file */ - list_head t_flags ; /* List of flags */ - list_head t_args ; /* List of arguments */ -} ; +struct transform +{ + char* t_in; /* Suffices in '.o.k' */ + char* t_out; /* Result '.suffix' */ + char* t_outfile; /* Resulting output file */ + char* t_name; /* The name of this transformation */ + list_head t_mapf; /* Mapflags argument, uses varrep */ + char* t_argd; /* Argument descriptor, uses varrep */ + char* t_needed; /* Suffix indicating the libraries needed */ + char* t_rts; /* Suffix indicating the major language used*/ + int t_stdin : 1; /* The input is taken on stdin */ + int t_stdout : 1; /* The output comes on stdout */ + int t_combine : 1; /* Transform several files to one result */ + int t_visited : 1; /* NO before setup, YES after */ + int t_prep : 2; /* Needs preprocessor YES/NO/MAYBE */ + int t_isprep : 1; /* Is preprocessor */ + int t_keep : 1; /* Keep the output file */ + int t_scan : 1; /* Used while finding path's */ + int t_bscan : 1; /* Best scan so far, while finding path's */ + int t_linker : 1; /* The linker usurps all unrecognized flags */ + int t_do : 1; /* Is in a path to execute */ + int t_blocked : 1; /* An input file could not be produced */ + short t_optim; /* Is optimizer, + optimizer level */ + short t_priority; /* Importance of including phase in scan */ + list_head t_inputs; /* The input 'path's of a combiner */ + char* t_origname; /* The basename of the output file */ + trf* t_next; /* The transformation to be executed next */ + char* t_prog; /* Pathname for load file */ + list_head t_flags; /* List of flags */ + list_head t_args; /* List of arguments */ +}; -#define t_cont(elem) ((trf *)l_content(elem)) +#define t_cont(elem) ((trf*)l_content(elem)) /* files.c */ -int setfiles(trf *); -void disc_files(trf *); -void disc_inputs(trf *); -void rmfile(path *); -void add_input(path *, trf *); +int setfiles(trf*); +void disc_files(trf*); +void disc_inputs(trf*); +void rmfile(path*); +void add_input(path*, trf*); /* run.c */ -int runphase(trf *); +int runphase(trf*); /* scan.c */ -enum f_path { F_TRANSFORM, F_NOMATCH, F_NOPATH } ; -enum f_path getpath(trf **); +enum f_path +{ + F_TRANSFORM, + F_NOMATCH, + F_NOPATH +}; +enum f_path getpath(trf**); /* trans.c */ -int transform(trf *); -void getmapflags(trf *); -void add_head(const char *); -void add_tail(const char *); +int transform(trf*); +void getmapflags(trf*); +void add_head(const char*); +void add_tail(const char*); void transini(void); -void doassign(const char *, const char *, int); +void doassign(const char*, const char*, int); diff --git a/util/ack/util.c b/util/ack/util.c index b3754f28e5..a281d341e0 100644 --- a/util/ack/util.c +++ b/util/ack/util.c @@ -19,57 +19,70 @@ #include "ack.h" #ifndef NORCSID -static char rcs_id[] = "$Id$" ; +static char rcs_id[] = "$Id$"; #endif -extern char *progname ; -extern int w_flag ; -extern int n_error; +extern char* progname; +extern int w_flag; +extern int n_error; #ifdef DEBUG -# define STDOUT stdout +#define STDOUT stdout #else -# define STDOUT stderr +#define STDOUT stderr #endif -char *ack_basename(const char *string) { - static char retval[256] ; - const char *last_dot, *last_start, *fetch ; - char *store ; - int ctoken ; - - last_dot= (char *)0 ; - last_start= string ; - for ( fetch=string ; ; fetch++ ) { - switch ( ctoken= *fetch&0377 ) { - case SUFCHAR : last_dot=fetch ; break ; - case '/' : last_start=fetch+1 ; break ; - case 0 : goto out ; +char* ack_basename(const char* string) +{ + static char retval[256]; + const char *last_dot, *last_start, *fetch; + char* store; + int ctoken; + + last_dot = (char*)0; + last_start = string; + for (fetch = string;; fetch++) + { + switch (ctoken = *fetch & 0377) + { + case SUFCHAR: + last_dot = fetch; + break; + case '/': + last_start = fetch + 1; + break; + case 0: + goto out; } } out: - if ( ! *last_start ) fuerror("empty filename \"%s\"",string) ; - for ( fetch= last_start, store=retval ; - *fetch && fetch!=last_dot && store< &retval[sizeof retval-1] ; - fetch++, store++ ) { - *store= *fetch ; + if (!*last_start) + fuerror("empty filename \"%s\"", string); + for (fetch = last_start, store = retval; + *fetch && fetch != last_dot && store < &retval[sizeof retval - 1]; fetch++, store++) + { + *store = *fetch; } - *store= 0 ; - return retval ; + *store = 0; + return retval; } -char *skipblank(char *str) { - register char *ptr ; +char* skipblank(char* str) +{ + char* ptr; - for ( ptr=str ; *ptr==SPACE || *ptr==TAB ; ptr++ ) ; - return ptr ; + for (ptr = str; *ptr == SPACE || *ptr == TAB; ptr++) + ; + return ptr; } -char *firstblank(char *str) { - register char *ptr ; +char* firstblank(char* str) +{ + char* ptr; - for ( ptr=str ; *ptr && *ptr!=SPACE && *ptr!=TAB ; ptr++ ) ; - return ptr ; + for (ptr = str; *ptr && *ptr != SPACE && *ptr != TAB; ptr++) + ; + return ptr; } /* VARARGS1 */ @@ -78,13 +91,12 @@ void fatal(const char* fmt, ...) /* Fatal internal error */ va_list ap; va_start(ap, fmt); - fprintf(STDOUT,"%s: fatal internal error, ",progname) ; + fprintf(STDOUT, "%s: fatal internal error, ", progname); vfprintf(STDOUT, fmt, ap); - fprintf(STDOUT,"\n") ; - quit(-2) ; + fprintf(STDOUT, "\n"); + quit(-2); } - /* VARARGS1 */ void vprint(const char* fmt, ...) { @@ -96,72 +108,83 @@ void vprint(const char* fmt, ...) } /* VARARGS1 */ -void fuerror(const char *fmt, ...) { +void fuerror(const char* fmt, ...) +{ /* Fatal user error */ va_list ap; va_start(ap, fmt); - fprintf(STDOUT,"%s: ",progname) ; + fprintf(STDOUT, "%s: ", progname); vfprintf(STDOUT, fmt, ap); - fprintf(STDOUT,"\n") ; - quit(-1) ; + fprintf(STDOUT, "\n"); + quit(-1); } /* VARARGS1 */ -void werror(const char *fmt, ...) { +void werror(const char* fmt, ...) +{ /* Warning user error, w_flag */ va_list ap; - if ( w_flag ) return ; + if (w_flag) + return; va_start(ap, fmt); - fprintf(STDOUT,"%s: warning, ",progname) ; + fprintf(STDOUT, "%s: warning, ", progname); vfprintf(STDOUT, fmt, ap); - fprintf(STDOUT,"\n") ; + fprintf(STDOUT, "\n"); va_end(ap); } /* VARARGS1 */ -void error(const char *fmt, ...) { +void error(const char* fmt, ...) +{ /* User error, it is the callers responsibility to quit */ va_list ap; va_start(ap, fmt); - fprintf(STDOUT,"%s: ",progname) ; + fprintf(STDOUT, "%s: ", progname); vfprintf(STDOUT, fmt, ap); - fprintf(STDOUT,"\n") ; - n_error++ ; + fprintf(STDOUT, "\n"); + n_error++; va_end(ap); } -void quit(int code) { +void quit(int code) +{ rmtemps(); exit(code); } /****** - char *keeps(string) - Keep the string in stable storage. - throws(string) - Remove the string stored by keep from stable storage. - throws() is now a macro in ack.h. + char *keeps(string) + Keep the string in stable storage. + throws(string) + Remove the string stored by keep from stable storage. + throws() is now a macro in ack.h. ***********/ -char *keeps(const char *str) { - register char *result ; - result= getcore( (unsigned)(strlen(str)+1) ) ; - if ( !result ) fatal("Out of core") ; - return strcpy(result,str) ; +char* keeps(const char* str) +{ + char* result; + result = getcore((unsigned)(strlen(str) + 1)); + if (!result) + fatal("Out of core"); + return strcpy(result, str); } -void *getcore(size_t size) { - void *retptr ; +void* getcore(size_t size) +{ + void* retptr; - retptr= calloc(1,size) ; - if ( !retptr ) fatal("Out of memory") ; - return retptr ; + retptr = calloc(1, size); + if (!retptr) + fatal("Out of memory"); + return retptr; } -void *changecore(void *ptr, size_t size) { - void *retptr ; +void* changecore(void* ptr, size_t size) +{ + void* retptr; - retptr= realloc(ptr,size) ; - if ( !retptr ) fatal("Out of memory") ; - return retptr ; + retptr = realloc(ptr, size); + if (!retptr) + fatal("Out of memory"); + return retptr; } diff --git a/util/amisc/abmodules.c b/util/amisc/abmodules.c index 5e8c4044f1..c3807484b4 100644 --- a/util/amisc/abmodules.c +++ b/util/amisc/abmodules.c @@ -17,33 +17,32 @@ #include "warnings.h" #include "stringlist.h" -int numsort_flg; -int sectsort_flg; -int undef_flg; -int revsort_flg = 1; -int globl_flg; -int nosort_flg; -int arch_flg; -int prep_flg; -int read_error; -struct outsect sbuf; -long off; -long s_base[S_MAX]; /* for specially encoded bases */ -char *filename; -int narg; - +int numsort_flg; +int sectsort_flg; +int undef_flg; +int revsort_flg = 1; +int globl_flg; +int nosort_flg; +int arch_flg; +int prep_flg; +int read_error; +struct outsect sbuf; +long off; +long s_base[S_MAX]; /* for specially encoded bases */ +char* filename; +int narg; static const char prefix[] = "_bmodule_"; static struct stringlist modules; -static void do_file(FILE *fd) +static void do_file(FILE* fd) { struct outhead hbuf; - char *cbufp; - long fi_to_co; - long n; - unsigned readcount; + char* cbufp; + long fi_to_co; + long n; + unsigned readcount; read_error = 0; rd_fdopen(fd); @@ -67,7 +66,7 @@ static void do_file(FILE *fd) if (read_error) goto corrupt; - fi_to_co = (long) (cbufp - OFF_CHAR(hbuf)); + fi_to_co = (long)(cbufp - OFF_CHAR(hbuf)); while (--n >= 0) { struct outname nbuf; @@ -84,11 +83,11 @@ static void do_file(FILE *fd) if (nbuf.on_foff == 0) nbuf.on_mptr = 0; else - nbuf.on_mptr = (char *) (nbuf.on_foff + fi_to_co); + nbuf.on_mptr = (char*)(nbuf.on_foff + fi_to_co); if (strlen(nbuf.on_mptr) <= sizeof(prefix)) continue; - if (memcmp(nbuf.on_mptr, prefix, sizeof(prefix)-1) != 0) + if (memcmp(nbuf.on_mptr, prefix, sizeof(prefix) - 1) != 0) continue; stringlist_add(&modules, strdup(nbuf.on_mptr + sizeof(prefix) - 1)); @@ -105,7 +104,8 @@ static void do_file(FILE *fd) static void process(FILE* fd) { uint16_t magic = rd_unsigned2(fd); - switch(magic) { + switch (magic) + { case O_MAGIC: fseek(fd, 0L, SEEK_SET); do_file(fd); @@ -115,7 +115,7 @@ static void process(FILE* fd) case AALMAG: { struct ar_hdr archive_header; - static char buf[sizeof(archive_header.ar_name)+1]; + static char buf[sizeof(archive_header.ar_name) + 1]; while (rd_arhdr(fd, &archive_header)) { @@ -131,7 +131,7 @@ static void process(FILE* fd) } break; } - + default: fatal("file %s is of unknown format", filename); } @@ -163,7 +163,7 @@ int main(int argc, char* const argv[]) for (;;) { - FILE *fd; + FILE* fd; filename = argv[optind++]; if (!filename) diff --git a/util/amisc/aelflod.c b/util/amisc/aelflod.c index 083fdf2f5d..3062c3f059 100644 --- a/util/amisc/aelflod.c +++ b/util/amisc/aelflod.c @@ -2,18 +2,18 @@ * Simple tool to produce an utterly basic ELF executable * from an absolute ack.out file. Suitable for operating * systems like Linux. - * + * * This tool produces an executable with a program header * only and no section header. - * + * * Mostly pinched from the ARM cv (and then rewritten in * ANSI C). Which, according to the comment, was pinched * from m68k2; therefore I am merely continuing a time- * honoured tradition. - * + * * (I was 10 when the original for this was checked into * CVS...) - * + * * dtrg, 2006-10-17 */ @@ -28,14 +28,19 @@ #include #include "out.h" -#define ASSERT(x) switch (2) { case 0: case (x): ; } +#define ASSERT(x) \ + switch (2) \ + { \ + case 0: \ + case (x):; \ + } /* Global settings. */ int bigendian = 0; -int elfabi = 3; /* abi = Linux */ -int elfmachine = 3; /* machine = EM_386 */ -uint32_t elfflags = 0; /* elf processor flags */ +int elfabi = 3; /* abi = Linux */ +int elfmachine = 3; /* machine = EM_386 */ +uint32_t elfflags = 0; /* elf processor flags */ /* Header and section table of an ack object file. */ @@ -44,18 +49,18 @@ struct outsect outsect[S_MAX]; struct outname* outname = NULL; char* stringarea; uint32_t ack_off_char; -int nstab = 0; /* S_STB symbol count */ -int nsym = 0; /* other symbol count */ -int nlocal = 0; /* local symbols */ +int nstab = 0; /* S_STB symbol count */ +int nsym = 0; /* other symbol count */ +int nlocal = 0; /* local symbols */ -char* outputfile = NULL; /* Name of output file, or NULL */ -char* program; /* Name of current program: argv[0] */ +char* outputfile = NULL; /* Name of output file, or NULL */ +char* program; /* Name of current program: argv[0] */ -FILE* input; /* Input stream */ -FILE* output; /* Output stream */ +FILE* input; /* Input stream */ +FILE* output; /* Output stream */ -#define readf(a, b, c) fread((a), (b), (int)(c), input) -#define writef(a, b, c) fwrite((a), (b), (int)(c), output) +#define readf(a, b, c) fread((a), (b), (int)(c), input) +#define writef(a, b, c) fwrite((a), (b), (int)(c), output) /* Contents of an ELF object file. */ @@ -66,26 +71,25 @@ FILE* output; /* Output stream */ #define STAB_SYMBOL_SIZE 12 #define ELF_SYMBOL_SIZE 16 -uint32_t code_offset; /* ELF segment */ -uint32_t stab_offset; /* Debugger symbol table */ -uint32_t symtab_offset; /* ELF symbol table */ -uint32_t strtab_offset; /* String table */ -uint32_t shstrtab_offset; /* Section header string table */ -uint32_t sh_offset; /* ELF section headers */ +uint32_t code_offset; /* ELF segment */ +uint32_t stab_offset; /* Debugger symbol table */ +uint32_t symtab_offset; /* ELF symbol table */ +uint32_t strtab_offset; /* String table */ +uint32_t shstrtab_offset; /* Section header string table */ +uint32_t sh_offset; /* ELF section headers */ -int sh_count = 0; /* Number of ELF sections */ -int shstrtab_nr = 0; /* Section number of .shstrtab */ +int sh_count = 0; /* Number of ELF sections */ +int shstrtab_nr = 0; /* Section number of .shstrtab */ int shstrtab_size; -const char elf_le_ident_string[] = { - 0x7F, 'E', 'L', 'F' -}; +const char elf_le_ident_string[] = { 0x7F, 'E', 'L', 'F' }; bool verbose = false; /* Segment numbers understood by aelflod. */ -enum { +enum +{ TEXT = 0, ROM, DATA, @@ -98,7 +102,8 @@ enum { * section headers. If we have no debugger symbols, we will skip * .stab and .stabstr, then subtract 2 from all later numbers. */ -enum { +enum +{ N_UNDEF = 0, N_TEXT, N_RODATA, @@ -111,14 +116,12 @@ enum { N_SHSTRTAB, NUM_ELF_SECTIONS, }; -const char shstrtab[] = - "\0.text\0.rodata\0.data\0.bss\0.stab\0.stabstr\0" - ".symtab\0.strtab\0.shstrtab"; - /* Compiler appends one more "\0". */ +const char shstrtab[] = "\0.text\0.rodata\0.data\0.bss\0.stab\0.stabstr\0" + ".symtab\0.strtab\0.shstrtab"; +/* Compiler appends one more "\0". */ const int sh_name[] = { /* Index of each name in shstrtab: */ - 0, 1, 7, 15, 21, 26, 32, - 41, 49, 57, + 0, 1, 7, 15, 21, 26, 32, 41, 49, 57, }; /* Produce an error message and exit. */ @@ -126,15 +129,15 @@ const int sh_name[] = { void fatal(const char* s, ...) { va_list ap; - - fprintf(stderr, "%s: ",program) ; - + + fprintf(stderr, "%s: ", program); + va_start(ap, s); vfprintf(stderr, s, ap); va_end(ap); - + fprintf(stderr, "\n"); - + if (outputfile) unlink(outputfile); exit(1); @@ -146,27 +149,29 @@ void fatal(const char* s, ...) long align(long a, long b) { a += b - 1; - return a & ~(b-1); + return a & ~(b - 1); } - + int follows(struct outsect* pa, struct outsect* pb) { /* return 1 if pa follows pb */ - - return (pa->os_base >= align(pb->os_base+pb->os_size, pa->os_lign)); + + return (pa->os_base >= align(pb->os_base + pb->os_size, pa->os_lign)); } /* Convert a symbol's name index from ack.out to ELF. */ uint32_t cvname(struct outname* n) { - if (n->on_foff) { + if (n->on_foff) + { /* ack.out: offset from beginning of file * ELF: index in string table * the + 1 because we prepend a '\0' */ return n->on_foff - ack_off_char + 1; - } else - return 0; /* no name */ + } + else + return 0; /* no name */ } /* Convert a symbol's type and binding from ack.out to ELF. */ @@ -175,36 +180,38 @@ int cvinfo(struct outname* n) { int bind, type; - switch (n->on_type & S_ETC) { + switch (n->on_type & S_ETC) + { case S_SCT: - type = 3; /* STT_SECTION */ + type = 3; /* STT_SECTION */ break; case S_FIL: case S_MOD: - type = 4; /* STT_FILE */ + type = 4; /* STT_FILE */ break; default: - switch (n->on_type & S_TYP) { + switch (n->on_type & S_TYP) + { case S_MIN + TEXT: - type = 2; /* STT_FUNC */ + type = 2; /* STT_FUNC */ break; case S_MIN + ROM: case S_MIN + DATA: case S_MIN + BSS: case S_MIN + NUM_SEGMENTS: - type = 1; /* STT_OBJECT */ + type = 1; /* STT_OBJECT */ break; default: - type = 0; /* STT_NOTYPE */ + type = 0; /* STT_NOTYPE */ break; } break; } if (n->on_type & S_EXT) - bind = 1; /* STB_GLOBAL */ + bind = 1; /* STB_GLOBAL */ else - bind = 0; /* STB_LOCAL */ + bind = 0; /* STB_LOCAL */ return (bind << 4) | type; } @@ -213,9 +220,10 @@ int cvinfo(struct outname* n) int cvsect(struct outname* n) { - switch (n->on_type & S_TYP) { + switch (n->on_type & S_TYP) + { case S_ABS: - return 0xfff1; /* SHN_ABS */ + return 0xfff1; /* SHN_ABS */ case S_MIN + TEXT: return N_TEXT; case S_MIN + ROM: @@ -242,7 +250,7 @@ void emit8(unsigned char value) void emit16(unsigned short value) { unsigned char buffer[2]; - + if (bigendian) { buffer[0] = (value >> 8) & 0xFF; @@ -253,35 +261,35 @@ void emit16(unsigned short value) buffer[1] = (value >> 8) & 0xFF; buffer[0] = (value >> 0) & 0xFF; } - + writef(buffer, 1, sizeof(buffer)); } void emit32(unsigned long value) { unsigned char buffer[4]; - + if (bigendian) { buffer[0] = (value >> 24) & 0xFF; buffer[1] = (value >> 16) & 0xFF; - buffer[2] = (value >> 8) & 0xFF; - buffer[3] = (value >> 0) & 0xFF; + buffer[2] = (value >> 8) & 0xFF; + buffer[3] = (value >> 0) & 0xFF; } else { buffer[3] = (value >> 24) & 0xFF; buffer[2] = (value >> 16) & 0xFF; - buffer[1] = (value >> 8) & 0xFF; - buffer[0] = (value >> 0) & 0xFF; + buffer[1] = (value >> 8) & 0xFF; + buffer[0] = (value >> 0) & 0xFF; } - + writef(buffer, 1, sizeof(buffer)); } - + /* Copies the contents of a section from the input stream * to the output stream. */ - + void emits(struct outsect* section) { char buffer[BUFSIZ]; @@ -295,7 +303,7 @@ void emits(struct outsect* section) } /* Zero fill any remaining space. */ - + if (section->os_flen != section->os_size) { long n = section->os_size - section->os_flen; @@ -312,20 +320,24 @@ void emits(struct outsect* section) /* Writes out an ELF program header. */ -void emitphdr(unsigned long address, unsigned long filesize, - unsigned int memsize, unsigned int alignment, int flags) +void emitphdr( + unsigned long address, + unsigned long filesize, + unsigned int memsize, + unsigned int alignment, + int flags) { static unsigned long fileoffset = 0; - - emit32(1); /* type = PT_LOAD */ - emit32(fileoffset); /* file offset */ - emit32(address); /* virtual address */ - emit32(0); /* physical address */ - emit32(filesize); /* file size */ - emit32(memsize); /* memory size */ - emit32(flags); /* executable, readable, writable */ - emit32(alignment); /* alignment */ - + + emit32(1); /* type = PT_LOAD */ + emit32(fileoffset); /* file offset */ + emit32(address); /* virtual address */ + emit32(0); /* physical address */ + emit32(filesize); /* file size */ + emit32(memsize); /* memory size */ + emit32(flags); /* executable, readable, writable */ + emit32(alignment); /* alignment */ + fileoffset += filesize; } @@ -336,14 +348,16 @@ void emit_stab(void) struct outname* n; int i; - for (i = 0; i < outhead.oh_nname; i++) { + for (i = 0; i < outhead.oh_nname; i++) + { n = &outname[i]; - if (n->on_type & S_STB) { - emit32(cvname(n)); /* name index */ - emit8(n->on_type >> 8); /* type */ - emit8(cvsect(n)); /* section */ - emit16(n->on_desc); /* desc */ - emit32(n->on_valu); /* value */ + if (n->on_type & S_STB) + { + emit32(cvname(n)); /* name index */ + emit8(n->on_type >> 8); /* type */ + emit8(cvsect(n)); /* section */ + emit16(n->on_desc); /* desc */ + emit32(n->on_valu); /* value */ } } } @@ -356,8 +370,10 @@ void emit_symtab(void) /* ELF .symtab must have local symbols before other symbols. * We emit locals in pass 0, globals in pass 1. */ - for (pass = 0; pass < 2; pass++) { - for (i = 0; i < outhead.oh_nname; i++) { + for (pass = 0; pass < 2; pass++) + { + for (i = 0; i < outhead.oh_nname; i++) + { n = &outname[i]; /* Don't emit .stab symbol in .symtab. */ @@ -365,14 +381,14 @@ void emit_symtab(void) continue; global = (n->on_type & S_EXT); - if ((pass == 0 && !global) || - (pass == 1 && global)) { - emit32(cvname(n)); /* name index */ - emit32(n->on_valu); /* value */ - emit32(0); /* size = unknown */ - emit8(cvinfo(n)); /* info */ - emit8(0); /* other */ - emit16(cvsect(n)); /* section */ + if ((pass == 0 && !global) || (pass == 1 && global)) + { + emit32(cvname(n)); /* name index */ + emit32(n->on_valu); /* value */ + emit32(0); /* size = unknown */ + emit8(cvinfo(n)); /* info */ + emit8(0); /* other */ + emit16(cvsect(n)); /* section */ } } } @@ -388,9 +404,12 @@ void emit_strtab(void) void emit_shstrtab(void) { - if (nstab) { + if (nstab) + { writef(shstrtab, sizeof(shstrtab), 1); - } else { + } + else + { /* Skip .stab and .stabstr */ int i = sh_name[N_SYMTAB]; writef(shstrtab, sh_name[N_STAB], 1); @@ -402,8 +421,7 @@ void emit_shstrtab(void) void emit_sh(int i) { - uint32_t name, type, flags, addr, offset, size, link, info, - addralign, entsize; + uint32_t name, type, flags, addr, offset, size, link, info, addralign, entsize; /* If no debugger symbols, skip .stab and .stabstr */ if (nstab == 0 && (i == N_STAB || i == N_STABSTR)) @@ -413,57 +431,58 @@ void emit_sh(int i) if (nstab == 0 && i >= N_STAB) name -= (sh_name[N_SYMTAB] - sh_name[N_STAB]); - switch (i) { + switch (i) + { case N_TEXT: case N_RODATA: case N_DATA: case N_STAB: - type = 1; /* SHT_PROGBITS */ + type = 1; /* SHT_PROGBITS */ break; case N_BSS: - type = 8; /* SHT_NOBITS */ + type = 8; /* SHT_NOBITS */ break; case N_SYMTAB: - type = 2; /* SHT_SYMTAB */ + type = 2; /* SHT_SYMTAB */ break; case N_STABSTR: case N_STRTAB: case N_SHSTRTAB: - type = 3; /* SHT_STRTAB */ + type = 3; /* SHT_STRTAB */ break; default: - type = 0; /* SHT_NULL */ + type = 0; /* SHT_NULL */ break; } - switch (i) { + switch (i) + { case N_TEXT: - flags = 4|2; /* SHF_EXECINSTR|SHF_ALLOC */ + flags = 4 | 2; /* SHF_EXECINSTR|SHF_ALLOC */ addr = outsect[TEXT].os_base; offset = code_offset; size = outsect[TEXT].os_size; addralign = outsect[TEXT].os_lign; break; case N_RODATA: - flags = 2; /* SHF_ALLOC */ + flags = 2; /* SHF_ALLOC */ addr = outsect[ROM].os_base; offset = code_offset + outsect[TEXT].os_size; size = outsect[ROM].os_size; addralign = outsect[ROM].os_lign; break; case N_DATA: - flags = 2|1; /* SHF_ALLOC|SHF_WRITE */ + flags = 2 | 1; /* SHF_ALLOC|SHF_WRITE */ addr = outsect[DATA].os_base; - offset = code_offset + outsect[TEXT].os_size + - outsect[ROM].os_size; + offset = code_offset + outsect[TEXT].os_size + outsect[ROM].os_size; size = outsect[DATA].os_size; addralign = outsect[DATA].os_lign; break; case N_BSS: - flags = 2|1; /* SHF_ALLOC|SHF_WRITE */ + flags = 2 | 1; /* SHF_ALLOC|SHF_WRITE */ addr = outsect[BSS].os_base; - offset = code_offset + outsect[TEXT].os_size + - outsect[ROM].os_size + outsect[DATA].os_size; + offset = code_offset + outsect[TEXT].os_size + outsect[ROM].os_size + + outsect[DATA].os_size; size = outsect[BSS].os_size; addralign = outsect[BSS].os_lign; break; @@ -473,7 +492,8 @@ void emit_sh(int i) } entsize = 0; - switch (i) { + switch (i) + { case N_STAB: offset = stab_offset; size = STAB_SYMBOL_SIZE * nstab; @@ -498,7 +518,8 @@ void emit_sh(int i) } /* Link .stab to .stabstr and .symtab to .strtab */ - switch (i) { + switch (i) + { case N_STAB: link = N_STABSTR; break; @@ -512,7 +533,8 @@ void emit_sh(int i) break; } - switch (i) { + switch (i) + { case N_SYMTAB: info = nlocal; break; @@ -534,47 +556,58 @@ void emit_sh(int i) } /* Macros from modules/src/object/obj.h */ -#define Xchar(ch) ((ch) & 0377) -#define uget2(c) (Xchar((c)[0]) | ((unsigned) Xchar((c)[1]) << 8)) -#define get4(c) (uget2(c) | ((long) uget2((c)+2) << 16)) +#define Xchar(ch) ((ch)&0377) +#define uget2(c) (Xchar((c)[0]) | ((unsigned)Xchar((c)[1]) << 8)) +#define get4(c) (uget2(c) | ((long)uget2((c) + 2) << 16)) /* Read the ack.out file header. */ int rhead(FILE* f, struct outhead* head) { char buf[SZ_HEAD], *c; - + if (fread(buf, sizeof(buf), 1, f) != 1) return 0; c = buf; - head->oh_magic = uget2(c); c += 2; - head->oh_stamp = uget2(c); c += 2; - head->oh_flags = uget2(c); c += 2; - head->oh_nsect = uget2(c); c += 2; - head->oh_nrelo = uget2(c); c += 2; - head->oh_nname = uget2(c); c += 2; - head->oh_nemit = get4(c); c += 4; + head->oh_magic = uget2(c); + c += 2; + head->oh_stamp = uget2(c); + c += 2; + head->oh_flags = uget2(c); + c += 2; + head->oh_nsect = uget2(c); + c += 2; + head->oh_nrelo = uget2(c); + c += 2; + head->oh_nname = uget2(c); + c += 2; + head->oh_nemit = get4(c); + c += 4; head->oh_nchar = get4(c); return 1; } /* Read an ack.out section header. */ - + int rsect(FILE* f, struct outsect* sect) { char buf[SZ_SECT], *c; - + if (fread(buf, sizeof(buf), 1, f) != 1) return 0; c = buf; - sect->os_base = get4(c); c += 4; - sect->os_size = get4(c); c += 4; - sect->os_foff = get4(c); c += 4; - sect->os_flen = get4(c); c += 4; + sect->os_base = get4(c); + c += 4; + sect->os_size = get4(c); + c += 4; + sect->os_foff = get4(c); + c += 4; + sect->os_flen = get4(c); + c += 4; sect->os_lign = get4(c); - return 1 ; + return 1; } /* @@ -594,7 +627,7 @@ int rnames(FILE* f) told = ftell(f); if (told == -1) return 0; - ack_off_char = OFF_CHAR(outhead); /* for cvname() */ + ack_off_char = OFF_CHAR(outhead); /* for cvname() */ if (fseek(f, OFF_NAME(outhead), SEEK_SET)) return 0; @@ -602,18 +635,25 @@ int rnames(FILE* f) outname = calloc(outhead.oh_nname, sizeof(outname[0])); if (outname == NULL) fatal("out of memory."); - for (i = 0; i < outhead.oh_nname; i++) { + for (i = 0; i < outhead.oh_nname; i++) + { char buf[SZ_NAME], *c; if (fread(buf, SZ_NAME, 1, f) != 1) return 0; c = buf; - outname[i].on_foff = get4(c); c += 4; - outname[i].on_type = uget2(c); c += 2; - outname[i].on_desc = uget2(c); c += 2; + outname[i].on_foff = get4(c); + c += 4; + outname[i].on_type = uget2(c); + c += 2; + outname[i].on_desc = uget2(c); + c += 2; outname[i].on_valu = get4(c); - if (outname[i].on_type & S_STB) { + if (outname[i].on_type & S_STB) + { nstab++; - } else { + } + else + { nsym++; if (!(outname[i].on_type & S_EXT)) nlocal++; @@ -634,13 +674,13 @@ int rnames(FILE* f) int main(int argc, char* argv[]) { /* General housecleaning and setup. */ - + input = stdin; output = stdout; program = argv[0]; - + /* Read in and process any flags. */ - + while ((argc > 1) && (argv[1][0] == '-')) { switch (argv[1][1]) @@ -654,8 +694,11 @@ int main(int argc, char* argv[]) break; case 'h': - fprintf(stderr, "%s: Syntax: aelflod [-a] [-b] [-h] [-l]\n\t[-m] [-v] \n", - program); + fprintf( + stderr, + "%s: Syntax: aelflod [-a] [-b] [-h] [-l]\n\t[-m] [-v] " + " \n", + program); exit(0); case 'l': @@ -678,53 +721,51 @@ int main(int argc, char* argv[]) syntaxerror: fatal("syntax error --- try -h for help"); } - + argv++; argc--; } /* Process the rest of the arguments. */ - + switch (argc) { case 1: /* No parameters --- read from stdin, write to stdout. */ break; - + case 3: /* Both input and output files specified. */ output = fopen(argv[2], "wb"); if (!output) fatal("unable to open output file."); outputfile = argv[2]; /* fall through */ - + case 2: /* Input file specified. */ input = fopen(argv[1], "rb"); if (!input) fatal("unable to open input file."); break; - + default: goto syntaxerror; } /* Read and check the ack.out file header. */ - - if (!rhead(input,&outhead)) + + if (!rhead(input, &outhead)) fatal("failed to read file header."); if (BADMAGIC(outhead)) fatal("this isn't an ack object file."); if (outhead.oh_nrelo > 0) fprintf(stderr, "Warning: relocation information present."); - if (!((outhead.oh_nsect == NUM_SEGMENTS) || - (outhead.oh_nsect == (NUM_SEGMENTS+1)))) - fatal("the input file must have %d sections, not %ld.", - NUM_SEGMENTS, outhead.oh_nsect); - + if (!((outhead.oh_nsect == NUM_SEGMENTS) || (outhead.oh_nsect == (NUM_SEGMENTS + 1)))) + fatal("the input file must have %d sections, not %ld.", NUM_SEGMENTS, outhead.oh_nsect); + /* Read in the section headers. */ - + { int i; - for (i=0; i -#include -#include -#include - -#include "object.h" -#include "out.h" -#include "arch.h" -#include "ranlib.h" - -int numsort_flg; -int sectsort_flg; -int undef_flg; -int revsort_flg = 1; -int globl_flg; -int nosort_flg; -int arch_flg; -int prep_flg; -int read_error; -struct outhead hbuf; -struct outsect sbuf; -long off; -long s_base[S_MAX]; /* for specially encoded bases */ -char *filename; -int narg; - -static void process(FILE *); -static void do_file(FILE *); -static int compare(const void *p1, const void *p2); - -int main(int argc, char **argv) +#include +#include +#include +#include + +#include "object.h" +#include "out.h" +#include "arch.h" +#include "ranlib.h" + +int numsort_flg; +int sectsort_flg; +int undef_flg; +int revsort_flg = 1; +int globl_flg; +int nosort_flg; +int arch_flg; +int prep_flg; +int read_error; +struct outhead hbuf; +struct outsect sbuf; +long off; +long s_base[S_MAX]; /* for specially encoded bases */ +char* filename; +int narg; + +static void process(FILE*); +static void do_file(FILE*); +static int compare(const void* p1, const void* p2); + +int main(int argc, char** argv) { - if (--argc>0 && argv[1][0]=='-' && argv[1][1]!=0) { + if (--argc > 0 && argv[1][0] == '-' && argv[1][1] != 0) + { argv++; - while (*++*argv) switch (**argv) { - case 'n': /* sort numerically */ - numsort_flg++; - continue; - - case 's': /* sort in section order */ - sectsort_flg++; - continue; - - case 'g': /* globl symbols only */ - globl_flg++; - continue; - - case 'u': /* undefined symbols only */ - undef_flg++; - continue; - - case 'r': /* sort in reverse order */ - revsort_flg = -1; - continue; - - case 'p': /* don't sort -- symbol table order */ - nosort_flg++; - continue; - - case 'o': /* prepend a name to each line */ - prep_flg++; - continue; - - default: /* oops */ - fprintf(stderr, "anm: invalid argument -%c\n", *argv[0]); - exit(1); - } + while (*++*argv) + switch (**argv) + { + case 'n': /* sort numerically */ + numsort_flg++; + continue; + + case 's': /* sort in section order */ + sectsort_flg++; + continue; + + case 'g': /* globl symbols only */ + globl_flg++; + continue; + + case 'u': /* undefined symbols only */ + undef_flg++; + continue; + + case 'r': /* sort in reverse order */ + revsort_flg = -1; + continue; + + case 'p': /* don't sort -- symbol table order */ + nosort_flg++; + continue; + + case 'o': /* prepend a name to each line */ + prep_flg++; + continue; + + default: /* oops */ + fprintf(stderr, "anm: invalid argument -%c\n", *argv[0]); + exit(1); + } argc--; } - if (argc == 0) { + if (argc == 0) + { argc = 1; argv[1] = "a.out"; } narg = argc; - while(argc--) { - FILE *fd; + while (argc--) + { + FILE* fd; filename = *++argv; - if ((fd = fopen(filename, "rb")) == NULL) { + if ((fd = fopen(filename, "rb")) == NULL) + { fprintf(stderr, "anm: cannot open %s\n", filename); continue; } @@ -100,239 +106,266 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); } - -static void process(FILE *fd) +static void process(FILE* fd) { - unsigned int magic; - long nextpos; - struct ar_hdr archive_header; - static char buf[sizeof(archive_header.ar_name)+1]; + unsigned int magic; + long nextpos; + struct ar_hdr archive_header; + static char buf[sizeof(archive_header.ar_name) + 1]; - if (narg > 1) printf("\n%s:\n", filename); + if (narg > 1) + printf("\n%s:\n", filename); magic = rd_unsigned2(fd); - switch(magic) { - case O_MAGIC: - fseek(fd, 0L, SEEK_SET); - do_file(fd); - break; - case ARMAG: - case AALMAG: - while (rd_arhdr(fd, &archive_header)) { - nextpos = ftell(fd) + archive_header.ar_size; - if (nextpos & 1) nextpos++; - strncpy(buf,archive_header.ar_name,sizeof(archive_header.ar_name)); - filename = buf; - if ( strcmp(filename, SYMDEF)) { - printf("\n%s:\n", filename); - do_file(fd); + switch (magic) + { + case O_MAGIC: + fseek(fd, 0L, SEEK_SET); + do_file(fd); + break; + case ARMAG: + case AALMAG: + while (rd_arhdr(fd, &archive_header)) + { + nextpos = ftell(fd) + archive_header.ar_size; + if (nextpos & 1) + nextpos++; + strncpy(buf, archive_header.ar_name, sizeof(archive_header.ar_name)); + filename = buf; + if (strcmp(filename, SYMDEF)) + { + printf("\n%s:\n", filename); + do_file(fd); + } + fseek(fd, nextpos, SEEK_SET); } - fseek(fd, nextpos, SEEK_SET); - } - break; - default: - fprintf(stderr, "anm: %s -- bad format\n", filename); - break; + break; + default: + fprintf(stderr, "anm: %s -- bad format\n", filename); + break; } } -static void do_file(FILE *fd) +static void do_file(FILE* fd) { - struct outname *nbufp = NULL; - struct outname nbuf; - char *cbufp; - long fi_to_co; - long n; - unsigned readcount; - int i,j; + struct outname* nbufp = NULL; + struct outname nbuf; + char* cbufp; + long fi_to_co; + long n; + unsigned readcount; + int i, j; read_error = 0; rd_fdopen(fd); rd_ohead(&hbuf); - if (read_error) { + if (read_error) + { return; } - if (BADMAGIC(hbuf)) { + if (BADMAGIC(hbuf)) + { return; } n = hbuf.oh_nname; - if (n == 0) { + if (n == 0) + { fprintf(stderr, "anm: %s -- no name list\n", filename); return; } - if (hbuf.oh_nchar == 0) { + if (hbuf.oh_nchar == 0) + { fprintf(stderr, "anm: %s -- no names\n", filename); return; } - if ((readcount = hbuf.oh_nchar) != hbuf.oh_nchar) { + if ((readcount = hbuf.oh_nchar) != hbuf.oh_nchar) + { fprintf(stderr, "anm: string area too big in %s\n", filename); exit(2); } /* store special section bases ??? */ - if (hbuf.oh_flags & HF_8086) { + if (hbuf.oh_flags & HF_8086) + { rd_sect(&sbuf, hbuf.oh_nsect); - if (read_error) { + if (read_error) + { return; } - for (i=0; i>12) & 03777760; + for (i = 0; i < hbuf.oh_nsect; i++) + { + s_base[i + S_MIN] = (sbuf.os_base >> 12) & 03777760; } } - if ((cbufp = (char *)malloc(readcount)) == NULL) { + if ((cbufp = (char*)malloc(readcount)) == NULL) + { fprintf(stderr, "anm: out of memory on %s\n", filename); exit(2); } rd_string(cbufp, hbuf.oh_nchar); - if (read_error) { + if (read_error) + { free(cbufp); return; } - fi_to_co = (long) (cbufp - OFF_CHAR(hbuf)); + fi_to_co = (long)(cbufp - OFF_CHAR(hbuf)); i = 0; - while (--n >= 0) { + while (--n >= 0) + { rd_name(&nbuf, 1); - if (read_error) { + if (read_error) + { break; } - if (globl_flg && (nbuf.on_type&S_EXT)==0) + if (globl_flg && (nbuf.on_type & S_EXT) == 0) continue; - if (undef_flg - && - ((nbuf.on_type&S_TYP)!=S_UND || (nbuf.on_type&S_ETC)!=0)) + if (undef_flg && ((nbuf.on_type & S_TYP) != S_UND || (nbuf.on_type & S_ETC) != 0)) continue; - if (nbuf.on_foff == 0) nbuf.on_mptr = 0; - else nbuf.on_mptr = (char *) (nbuf.on_foff + fi_to_co); + if (nbuf.on_foff == 0) + nbuf.on_mptr = 0; + else + nbuf.on_mptr = (char*)(nbuf.on_foff + fi_to_co); /* adjust value for specially encoded bases */ - if (hbuf.oh_flags & HF_8086) { - if (((nbuf.on_type&S_ETC) == 0) || - ((nbuf.on_type&S_ETC) == S_SCT)) { - j = nbuf.on_type&S_TYP; - if ((j>=S_MIN) && (j<=S_MAX)) - nbuf.on_valu += s_base[j]; - } + if (hbuf.oh_flags & HF_8086) + { + if (((nbuf.on_type & S_ETC) == 0) || ((nbuf.on_type & S_ETC) == S_SCT)) + { + j = nbuf.on_type & S_TYP; + if ((j >= S_MIN) && (j <= S_MAX)) + nbuf.on_valu += s_base[j]; + } } if (nbufp == NULL) - nbufp = (struct outname *)malloc(sizeof(struct outname)); + nbufp = (struct outname*)malloc(sizeof(struct outname)); else - nbufp = (struct outname *)realloc(nbufp, (i+1)*sizeof(struct outname)); - if (nbufp == NULL) { + nbufp = (struct outname*)realloc(nbufp, (i + 1) * sizeof(struct outname)); + if (nbufp == NULL) + { fprintf(stderr, "anm: out of memory on %s\n", filename); exit(2); } nbufp[i++] = nbuf; } - if (nbufp && nosort_flg==0) + if (nbufp && nosort_flg == 0) qsort(nbufp, i, sizeof(struct outname), compare); - for (n=0; non_type&S_TYP) > (p2->on_type&S_TYP)) - return(revsort_flg); - if ((p1->on_type&S_TYP) < (p2->on_type&S_TYP)) - return(-revsort_flg); + int i; + + if (sectsort_flg) + { + if ((p1->on_type & S_TYP) > (p2->on_type & S_TYP)) + return (revsort_flg); + if ((p1->on_type & S_TYP) < (p2->on_type & S_TYP)) + return (-revsort_flg); } - if (numsort_flg) { + if (numsort_flg) + { if (p1->on_valu > p2->on_valu) - return(revsort_flg); + return (revsort_flg); if (p1->on_valu < p2->on_valu) - return(-revsort_flg); + return (-revsort_flg); } - if (! p1->on_mptr) { - if (! p2->on_mptr) return 0; + if (!p1->on_mptr) + { + if (!p2->on_mptr) + return 0; return -revsort_flg; } - if (! p2->on_mptr) return revsort_flg; + if (!p2->on_mptr) + return revsort_flg; i = strcmp(p1->on_mptr, p2->on_mptr); if (i > 0) - return(revsort_flg); + return (revsort_flg); if (i < 0) - return(-revsort_flg); + return (-revsort_flg); - return(0); + return (0); } void rd_fatal(void) { - fprintf(stderr,"read error on %s\n", filename); + fprintf(stderr, "read error on %s\n", filename); read_error = 1; } diff --git a/util/amisc/ashow.c b/util/amisc/ashow.c index 015cd7bf7c..bb37571a80 100644 --- a/util/amisc/ashow.c +++ b/util/amisc/ashow.c @@ -1,4 +1,4 @@ -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id$"; /* * show - make the contents of an ACK object file human readable. */ @@ -9,35 +9,39 @@ static char rcsid[] = "$Id$"; #include "object.h" #include "out.h" -#define OK 0 /* Return value of gethead if Orl Korekt. */ -#define BMASK 0xFF /* To extract least significant 8 bits from an int. */ +#define OK 0 /* Return value of gethead if Orl Korekt. */ +#define BMASK 0xFF /* To extract least significant 8 bits from an int. */ /* Forward declarations */ -static void show(register struct outhead *); -static void showflags(unsigned int); +static void show(struct outhead*); +static void showflags(unsigned int); static void showsect(void); static void showrelo(void); -static void showname(struct outname *); -static char *myalloc(unsigned int); -static void error(char *, ...); - +static void showname(struct outname*); +static char* myalloc(unsigned int); +static void error(char*, ...); /* ARGSUSED */ -int main(int argc, char **argv) -# define prog argv[0] +int main(int argc, char** argv) +#define prog argv[0] { - register char **arg = argv; - struct outhead header; + char** arg = argv; + struct outhead header; - while (*++arg) { - if (! rd_open(*arg)) { + while (*++arg) + { + if (!rd_open(*arg)) + { error("%s: cannot read %s\n", prog, *arg); continue; } rd_ohead(&header); - if (BADMAGIC(header)) { + if (BADMAGIC(header)) + { error("%s: %s not an ACK object file\n", prog, *arg); - } else { + } + else + { printf("%s:\n", *arg); show(&header); } @@ -51,42 +55,48 @@ int main(int argc, char **argv) * NB. The header has already been read and is in the struct outhead `headp' * points to. */ -static void show(register struct outhead *headp) +static void show(struct outhead* headp) { - register int i; - register struct outname *np; - register struct outname *name; /* Dynamically allocated name-array. */ - register char *string;/* Base of string area. */ + int i; + struct outname* np; + struct outname* name; /* Dynamically allocated name-array. */ + char* string; /* Base of string area. */ printf("Version %d\n", headp->oh_stamp); - showflags((unsigned) headp->oh_flags); + showflags((unsigned)headp->oh_flags); /* * Show all sections. */ - for (i = 0; i < headp->oh_nsect; i++) { + for (i = 0; i < headp->oh_nsect; i++) + { printf("Section %d:\n", i); showsect(); } /* * Show relocation information. */ - for (i = 0; i < headp->oh_nrelo; i++) { + for (i = 0; i < headp->oh_nrelo; i++) + { printf("Relocation record %d:\n", i); showrelo(); } /* * We get all struct outname's and the strings in core first. */ - name = (struct outname *) myalloc(headp->oh_nname * sizeof(struct outname)); - string = myalloc((unsigned) headp->oh_nchar); + name = (struct outname*)myalloc(headp->oh_nname * sizeof(struct outname)); + string = myalloc((unsigned)headp->oh_nchar); rd_name(name, headp->oh_nname); - for (np = &name[0]; np < &name[headp->oh_nname]; np++) { - if (np->on_foff != 0) { + for (np = &name[0]; np < &name[headp->oh_nname]; np++) + { + if (np->on_foff != 0) + { np->on_foff -= OFF_CHAR(*headp); - if (np->on_foff >= headp->oh_nchar || np->on_foff < 0) { + if (np->on_foff >= headp->oh_nchar || np->on_foff < 0) + { np->on_mptr = "????"; } - else np->on_mptr = string + np->on_foff; + else + np->on_mptr = string + np->on_foff; } } /* @@ -109,9 +119,10 @@ static void show(register struct outhead *headp) /* * Show flags from header. */ -static void showflags(unsigned int flagword) +static void showflags(unsigned int flagword) { - if (flagword & HF_LINK) printf("unresolved references left\n"); + if (flagword & HF_LINK) + printf("unresolved references left\n"); } /* @@ -119,14 +130,14 @@ static void showflags(unsigned int flagword) */ static void showsect(void) { - struct outsect section; + struct outsect section; rd_sect(§ion, 1); - printf("\tstartaddress in machine\t0x%lX\n", section.os_base); - printf("\tsection size in machine\t0x%lX\n", section.os_size); - printf("\tstartaddress in file\t0x%lX\n", section.os_foff); - printf("\tsection size in file\t0x%lX\n", section.os_flen); - printf("\tsection alignment\t%ld\n", section.os_lign); + printf("\tstartaddress in machine\t0x%lX\n", section.os_base); + printf("\tsection size in machine\t0x%lX\n", section.os_size); + printf("\tstartaddress in file\t0x%lX\n", section.os_foff); + printf("\tsection size in file\t0x%lX\n", section.os_flen); + printf("\tsection alignment\t%ld\n", section.os_lign); } /* @@ -134,44 +145,48 @@ static void showsect(void) */ static void showrelo(void) { - struct outrelo relrec; + struct outrelo relrec; rd_relo(&relrec, 1); - switch (relrec.or_type & RELSZ) { - case RELO1: - printf("\t1 byte\n"); - break; - case RELO2: - printf("\t2 bytes\n"); - break; - case RELO2HI: - printf("\ttop 2 bytes of result\n"); - break; - case RELO2HISAD: - printf("\ttop 2 bytes of result, sign adjusted\n"); - break; - case RELO4: - printf("\t4 bytes\n"); - break; - case RELOPPC: - printf("\tPowerPC 26-bit address\n"); - break; - case RELOPPC_LIS: - printf("\tPowerPC lis instruction\n"); - break; - case RELOVC4: - printf("\tVideoCore IV address in 32-bit instruction\n"); - break; - case RELOMIPS: - printf("\tMIPS b or j instruction\n"); - break; - default: - printf("\tunknown relocation type %d\n", relrec.or_type & RELSZ); - break; + switch (relrec.or_type & RELSZ) + { + case RELO1: + printf("\t1 byte\n"); + break; + case RELO2: + printf("\t2 bytes\n"); + break; + case RELO2HI: + printf("\ttop 2 bytes of result\n"); + break; + case RELO2HISAD: + printf("\ttop 2 bytes of result, sign adjusted\n"); + break; + case RELO4: + printf("\t4 bytes\n"); + break; + case RELOPPC: + printf("\tPowerPC 26-bit address\n"); + break; + case RELOPPC_LIS: + printf("\tPowerPC lis instruction\n"); + break; + case RELOVC4: + printf("\tVideoCore IV address in 32-bit instruction\n"); + break; + case RELOMIPS: + printf("\tMIPS b or j instruction\n"); + break; + default: + printf("\tunknown relocation type %d\n", relrec.or_type & RELSZ); + break; } - if (relrec.or_type & RELPC) printf("\tpc relative\n"); - if (relrec.or_type & RELBR) printf("\tbytes reversed\n"); - if (relrec.or_type & RELWR) printf("\twords reversed\n"); + if (relrec.or_type & RELPC) + printf("\tpc relative\n"); + if (relrec.or_type & RELBR) + printf("\tbytes reversed\n"); + if (relrec.or_type & RELWR) + printf("\twords reversed\n"); printf("\treferencing section\t%d\n", (relrec.or_sect & BMASK) - S_MIN); printf("\treferenced symbol index\t%d\n", relrec.or_nami); printf("\treferencing address\t%ld\n", relrec.or_addr); @@ -180,66 +195,77 @@ static void showrelo(void) /* * Show the name in the struct `namep' points to. */ -static void showname(struct outname *namep) +static void showname(struct outname* namep) { if (namep->on_mptr) printf("\t%s\n", namep->on_mptr); else printf("\tno name\n"); - switch (namep->on_type & S_TYP) { - case S_UND: - printf("\tundefined\n"); - break; - case S_ABS: - printf("\tabsolute\n"); - break; - case S_CRS: - printf("\tcross reference\n"); - default: - printf("\tin section %d\n", (namep->on_type & S_TYP) - S_MIN); - break; - } - if (namep->on_type & S_EXT) printf("\texternal\n"); - if (namep->on_type & S_STB) { - printf("\tstab 0x%x\n", namep->on_type >> 8); - printf("\tdesc 0x%x\n", namep->on_desc); + switch (namep->on_type & S_TYP) + { + case S_UND: + printf("\tundefined\n"); + break; + case S_ABS: + printf("\tabsolute\n"); + break; + case S_CRS: + printf("\tcross reference\n"); + default: + printf("\tin section %d\n", (namep->on_type & S_TYP) - S_MIN); + break; } - else switch (namep->on_type & S_ETC) { - case S_SCT: - printf("\tsection name\n"); break; - case S_LIN: - printf("\thll source line item\n"); break; - case S_FIL: - printf("\thll source file item\n"); break; - case S_MOD: - printf("\tass src file item\n"); break; - case S_COM: - printf("\tcommon\n"); break; - case 0: - break; - default: + if (namep->on_type & S_EXT) + printf("\texternal\n"); + if (namep->on_type & S_STB) + { printf("\tstab 0x%x\n", namep->on_type >> 8); printf("\tdesc 0x%x\n", namep->on_desc); } + else + switch (namep->on_type & S_ETC) + { + case S_SCT: + printf("\tsection name\n"); + break; + case S_LIN: + printf("\thll source line item\n"); + break; + case S_FIL: + printf("\thll source file item\n"); + break; + case S_MOD: + printf("\tass src file item\n"); + break; + case S_COM: + printf("\tcommon\n"); + break; + case 0: + break; + default: + printf("\tstab 0x%x\n", namep->on_type >> 8); + printf("\tdesc 0x%x\n", namep->on_desc); + } printf("\tvalue 0x%lX\n", namep->on_valu); } /* * Core allocation via malloc() but fatal if no core. */ -static char *myalloc(unsigned int u) +static char* myalloc(unsigned int u) { - register char *rcp; + char* rcp; rcp = malloc(u); - if (rcp == (char *) NULL) { + if (rcp == (char*)NULL) + { error("Out of core\n"); exit(EXIT_FAILURE); } return rcp; } -static void error(char *fmt, ...) +static void error(char* fmt, ...) { fflush(stdout); /* Diagnostic print, no auto NL */ diff --git a/util/amisc/asize.c b/util/amisc/asize.c index 6ee79ba14f..bf10cb9fb7 100644 --- a/util/amisc/asize.c +++ b/util/amisc/asize.c @@ -4,43 +4,48 @@ */ /* $Id$ */ -#include -#include -#include "object.h" -#include "out.h" +#include +#include +#include "object.h" +#include "out.h" /* - asize -- determine object size + asize -- determine object size */ -int main(int argc, char **argv) +int main(int argc, char** argv) { - struct outhead buf; - struct outsect sbuf; - unsigned short nrsect; - long sum; - int gorp; + struct outhead buf; + struct outsect sbuf; + unsigned short nrsect; + long sum; + int gorp; - if (--argc == 0) { + if (--argc == 0) + { argc = 1; argv[1] = "a.out"; } gorp = argc; - while(argc--) { - if (! rd_open(*++argv)) { + while (argc--) + { + if (!rd_open(*++argv)) + { fprintf(stderr, "asize: cannot open %s\n", *argv); continue; } rd_ohead(&buf); - if(BADMAGIC(buf)) { + if (BADMAGIC(buf)) + { fprintf(stderr, "asize: %s-- bad format\n", *argv); rd_close(); continue; } nrsect = buf.oh_nsect; - if (nrsect == 0) { + if (nrsect == 0) + { fprintf(stderr, "asize: %s-- no sections\n", *argv); rd_close(); continue; @@ -49,7 +54,8 @@ int main(int argc, char **argv) printf("%s: ", *argv); sum = 0; - while (nrsect-- > 0) { + while (nrsect-- > 0) + { rd_sect(&sbuf, 1); printf("%ld", sbuf.os_size); sum += sbuf.os_size; diff --git a/util/amisc/aslod.c b/util/amisc/aslod.c index d5c3bee539..1024d123f2 100644 --- a/util/amisc/aslod.c +++ b/util/amisc/aslod.c @@ -4,15 +4,15 @@ * like DOS, CP/M, Arthur, etc. Also useful for RAM * images (but *not* ROM images, note) and, more * importantly, general test purposes. - * + * * Mostly pinched from the ARM cv (and then rewritten in * ANSI C). Which, according to the comment, was pinched * from m68k2; therefore I am merely continuing a time- * honoured tradition. - * + * * (I was 10 when the original for this was checked into * CVS...) - * + * * dtrg, 2006-10-17 */ @@ -26,31 +26,37 @@ #include #include "out.h" -#define ASSERT(x) switch (2) { case 0: case (x): ; } +#define ASSERT(x) \ + switch (2) \ + { \ + case 0: \ + case (x):; \ + } /* * Header and section table of ack object file. */ - + struct outhead outhead; struct outsect outsect[S_MAX]; char* stringarea; -char* outputfile = NULL; /* Name of output file, or NULL */ -char* prefixfile = NULL; /* Name of prefix file, or NULL */ -char* program; /* Name of current program: argv[0] */ +char* outputfile = NULL; /* Name of output file, or NULL */ +char* prefixfile = NULL; /* Name of prefix file, or NULL */ +char* program; /* Name of current program: argv[0] */ -FILE* input; /* Input stream */ -FILE* output; /* Output stream */ +FILE* input; /* Input stream */ +FILE* output; /* Output stream */ -#define readf(a, b, c) fread((a), (b), (int)(c), input) -#define writef(a, b, c) fwrite((a), (b), (int)(c), output) +#define readf(a, b, c) fread((a), (b), (int)(c), input) +#define writef(a, b, c) fwrite((a), (b), (int)(c), output) bool verbose = false; /* Segment numbers understood by aslod. */ -enum { +enum +{ TEXT = 0, ROM, DATA, @@ -63,15 +69,15 @@ enum { void fatal(const char* s, ...) { va_list ap; - - fprintf(stderr, "%s: ",program) ; - + + fprintf(stderr, "%s: ", program); + va_start(ap, s); vfprintf(stderr, s, ap); va_end(ap); - + fprintf(stderr, "\n"); - + if (outputfile) unlink(outputfile); exit(1); @@ -84,25 +90,25 @@ long align(long a, long b) a += b - 1; return a - a % b; } - + int follows(struct outsect* pa, struct outsect* pb) { /* return 1 if pa follows pb */ - - return (pa->os_base == align(pb->os_base+pb->os_size, pa->os_lign)); + + return (pa->os_base == align(pb->os_base + pb->os_size, pa->os_lign)); } /* Copies the contents of a section from the input stream * to the output stream, zero filling any uninitialised * space. */ - + void emits(struct outsect* section, struct outsect* nextsect) { char buffer[BUFSIZ]; uint32_t real_size; /* Copy the actual data. */ - + { long n = section->os_flen; while (n > 0) @@ -118,11 +124,10 @@ void emits(struct outsect* section, struct outsect* nextsect) * layout. Take into account the next section's alignment, if any. */ real_size = section->os_size; if (nextsect) - real_size = align(section->os_base + real_size, nextsect->os_lign) - - section->os_base; + real_size = align(section->os_base + real_size, nextsect->os_lign) - section->os_base; /* Zero fill any remaining space. */ - + if (section->os_flen != real_size) { uint32_t n = real_size - section->os_flen; @@ -152,68 +157,78 @@ void emitprefixfile(void) } /* Macros from modules/src/object/obj.h */ -#define Xchar(ch) ((ch) & 0377) -#define uget2(c) (Xchar((c)[0]) | ((unsigned) Xchar((c)[1]) << 8)) -#define get4(c) (uget2(c) | ((long) uget2((c)+2) << 16)) +#define Xchar(ch) ((ch)&0377) +#define uget2(c) (Xchar((c)[0]) | ((unsigned)Xchar((c)[1]) << 8)) +#define get4(c) (uget2(c) | ((long)uget2((c) + 2) << 16)) /* Read the ack.out file header. */ int rhead(FILE* f, struct outhead* head) { char buf[SZ_HEAD], *c; - + if (fread(buf, sizeof(buf), 1, f) != 1) return 0; c = buf; - head->oh_magic = uget2(c); c += 2; - head->oh_stamp = uget2(c); c += 2; - head->oh_flags = uget2(c); c += 2; - head->oh_nsect = uget2(c); c += 2; - head->oh_nrelo = uget2(c); c += 2; - head->oh_nname = uget2(c); c += 2; - head->oh_nemit = get4(c); c += 4; + head->oh_magic = uget2(c); + c += 2; + head->oh_stamp = uget2(c); + c += 2; + head->oh_flags = uget2(c); + c += 2; + head->oh_nsect = uget2(c); + c += 2; + head->oh_nrelo = uget2(c); + c += 2; + head->oh_nname = uget2(c); + c += 2; + head->oh_nemit = get4(c); + c += 4; head->oh_nchar = get4(c); return 1; } /* Read an ack.out section header. */ - + int rsect(FILE* f, struct outsect* sect) { char buf[SZ_SECT], *c; - + if (fread(buf, sizeof(buf), 1, f) != 1) return 0; c = buf; - sect->os_base = get4(c); c += 4; - sect->os_size = get4(c); c += 4; - sect->os_foff = get4(c); c += 4; - sect->os_flen = get4(c); c += 4; + sect->os_base = get4(c); + c += 4; + sect->os_size = get4(c); + c += 4; + sect->os_foff = get4(c); + c += 4; + sect->os_flen = get4(c); + c += 4; sect->os_lign = get4(c); - return 1 ; + return 1; } int main(int argc, char* argv[]) { /* General housecleaning and setup. */ - + input = stdin; output = stdout; program = argv[0]; - + /* Read in and process any flags. */ - + while ((argc > 1) && (argv[1][0] == '-')) { switch (argv[1][1]) { case 'h': - fprintf(stderr, "%s: Syntax: aslod [-h] \n", - program); + fprintf(stderr, "%s: Syntax: aslod [-h] \n", program); exit(0); - + case 'v': verbose = true; break; @@ -228,53 +243,51 @@ int main(int argc, char* argv[]) syntaxerror: fatal("syntax error --- try -h for help"); } - + argv++; argc--; } /* Process the rest of the arguments. */ - + switch (argc) { case 1: /* No parameters --- read from stdin, write to stdout. */ break; - + case 3: /* Both input and output files specified. */ output = fopen(argv[2], "wb"); if (!output) fatal("unable to open output file."); outputfile = argv[2]; /* fall through */ - + case 2: /* Input file specified. */ input = fopen(argv[1], "rb"); if (!input) fatal("unable to open input file."); break; - + default: goto syntaxerror; } /* Read and check the ack.out file header. */ - - if (!rhead(input,&outhead)) + + if (!rhead(input, &outhead)) fatal("failed to read file header."); if (BADMAGIC(outhead)) fatal("this isn't an ack object file."); if (outhead.oh_nrelo > 0) fprintf(stderr, "Warning: relocation information present."); - if (!((outhead.oh_nsect == NUM_SEGMENTS) || - (outhead.oh_nsect == (NUM_SEGMENTS+1)))) - fatal("the input file must have %d sections, not %ld.", - NUM_SEGMENTS, outhead.oh_nsect); - + if (!((outhead.oh_nsect == NUM_SEGMENTS) || (outhead.oh_nsect == (NUM_SEGMENTS + 1)))) + fatal("the input file must have %d sections, not %ld.", NUM_SEGMENTS, outhead.oh_nsect); + /* Read in the section headers. */ - + { int i; - for (i=0; i 1) break; } @@ -39,22 +39,24 @@ int main(int argc, char **argv) return status; } -int strip(char *name) +int strip(char* name) { long size; - FILE *fw; + FILE* fw; - if (! rd_open(name)) { + if (!rd_open(name)) + { fprintf(stderr, "astrip: cannot open %s\n", name); - return(1); + return (1); } readerror = 0; writeerror = 0; rd_ohead(&buf); - if(readerror || BADMAGIC(buf)) { + if (readerror || BADMAGIC(buf)) + { fprintf(stderr, "astrip: %s-- bad format\n", name); rd_close(); - return(1); + return (1); } size = OFF_RELO(buf) - SZ_HEAD; buf.oh_flags &= ~HF_LINK; @@ -62,78 +64,87 @@ int strip(char *name) buf.oh_nname = 0; buf.oh_nchar = 0; - - if (! wr_open(tname)) { + if (!wr_open(tname)) + { fprintf(stderr, "astrip: cannot create temp file %s\n", tname); rd_close(); - return(2); + return (2); } wr_ohead(&buf); wr_close(); - if (writeerror) { + if (writeerror) + { fprintf(stderr, "astrip: write error on temp file %s\n", tname); rd_close(); - return(1); + return (1); } fw = fopen(tname, "ab"); - if ((fw == NULL) || (fseek(fw, (long)SZ_HEAD, SEEK_SET)!=0)) { + if ((fw == NULL) || (fseek(fw, (long)SZ_HEAD, SEEK_SET) != 0)) + { fprintf(stderr, "astrip: cannot create temp file %s\n", tname); rd_close(); fclose(fw); - return(2); + return (2); } - if(copy(name, tname, size, rd_fd(), fw)) { + if (copy(name, tname, size, rd_fd(), fw)) + { rd_close(); fclose(fw); - return(1); + return (1); } rd_close(); fclose(fw); size += SZ_HEAD; - if (! rd_open(tname)) { + if (!rd_open(tname)) + { fprintf(stderr, "astrip: cannot read temp file %s\n", tname); - return(2); + return (2); } fw = fopen(name, "wb"); - if (fw == NULL) { + if (fw == NULL) + { fprintf(stderr, "astrip: cannot write %s\n", name); rd_close(); - return(1); + return (1); } - if(copy(tname, name, size, rd_fd(), fw)) { + if (copy(tname, name, size, rd_fd(), fw)) + { fclose(fw); rd_close(); - return(2); + return (2); } fclose(fw); rd_close(); /* Change the mode to everything. */ - chmod(name,S_IRWXU | S_IRWXG | S_IRWXO); - return(0); + chmod(name, S_IRWXU | S_IRWXG | S_IRWXO); + return (0); } -static int copy(char *fnam, char *tnam, long size, FILE *fr, FILE *fw) +static int copy(char* fnam, char* tnam, long size, FILE* fr, FILE* fw) { - register int s; + int s; char lbuf[512]; - while(size != (long)0) { + while (size != (long)0) + { s = 512; - if(size < 512) - s = (int) size; - rd_bytes(fr, lbuf, (long) s); - if (readerror) { + if (size < 512) + s = (int)size; + rd_bytes(fr, lbuf, (long)s); + if (readerror) + { fprintf(stderr, "astrip: unexpected eof on %s\n", fnam); - return(1); + return (1); } - wr_bytes(fw, lbuf, (long) s); - if (writeerror) { + wr_bytes(fw, lbuf, (long)s); + if (writeerror) + { fprintf(stderr, "astrip: write error on %s\n", tnam); - return(1); + return (1); } size -= (long)s; } - return(0); + return (0); } void rd_fatal(void) diff --git a/util/arch/archiver.c b/util/arch/archiver.c index 5cc791b5e4..44fd255c65 100644 --- a/util/arch/archiver.c +++ b/util/arch/archiver.c @@ -268,7 +268,7 @@ void catch (int param) int main(int argc, char* argv[]) { - register char* ptr; + char* ptr; int needs_arg = 0; progname = argv[0]; @@ -389,7 +389,7 @@ MEMBER* get_member(FILE* f) void get(int argc, char* argv[]) { - register MEMBER* member; + MEMBER* member; FILE* ar_f; int i = 0; char buffer[FILENAME_MAX]; @@ -454,7 +454,7 @@ void get(int argc, char* argv[]) else if (show_fl) { char buf[sizeof(member->ar_name) + 2]; - register char *p = buf, *q = member->ar_name; + char *p = buf, *q = member->ar_name; while (q <= &member->ar_name[sizeof(member->ar_name) - 1] && *q) { @@ -699,7 +699,7 @@ void copy_member(MEMBER* member, FILE* from, FILE* to, BOOL extracting) char* get_mode(int mode) { static char mode_buf[11]; - register int tmp = mode; + int tmp = mode; int i; mode_buf[9] = ' '; @@ -737,7 +737,7 @@ void show(char* s, char* name) { MEMBER x; char buf[sizeof(x.ar_name) + 1]; - register char *p = buf, *q = name; + char *p = buf, *q = name; while (q <= &name[sizeof(x.ar_name) - 1] && *q) *p++ = *q++; @@ -754,9 +754,9 @@ void show(char* s, char* name) */ void write_symdef(FILE* ar) { - register struct ranlib* ran; - register int i; - register long delta; + struct ranlib* ran; + int i; + long delta; time_t time_value; MEMBER arbuf; @@ -838,8 +838,8 @@ void do_object(FILE* f, long size) */ void do_names(struct outhead* headp) { - register char* strings = NULL; - register int nnames = headp->oh_nname; + char* strings = NULL; + int nnames = headp->oh_nname; #define NNAMES 100 struct outname namebuf[NNAMES]; long xxx = OFF_CHAR(*headp); @@ -853,7 +853,7 @@ void do_names(struct outhead* headp) while (nnames) { int i = nnames >= NNAMES ? NNAMES : nnames; - register struct outname* p = namebuf; + struct outname* p = namebuf; nnames -= i; rd_name(namebuf, i); @@ -884,7 +884,7 @@ void do_names(struct outhead* headp) void enter_name(struct outname* namep) { - register char* cp; + char* cp; if (tnum >= tabsz) { diff --git a/util/ass/ass00.c b/util/ass/ass00.c index a45f3d63b9..ba3ad42dc7 100644 --- a/util/ass/ass00.c +++ b/util/ass/ass00.c @@ -47,8 +47,8 @@ int main(int argc, char **argv) * debugging information. */ char workspace[6000]; - register char *cp; - register int argno; + char *cp; + int argno; progname = argv[0]; for (cp = argv[0]; *cp;) @@ -76,10 +76,10 @@ int main(int argc, char **argv) static void getcore(void) { - register siz_t *p; + siz_t *p; siz_t bytes; - register unsigned n; - register char *base; + unsigned n; + char *base; /* * xglobs[] should be located in front of mglobs[], see upd_reloc() @@ -139,7 +139,7 @@ static siz_t* getsizes(char *str) */ static void argument(char *arg) { - register int w; + int w; if (oflag) { @@ -179,8 +179,8 @@ static void argument(char *arg) */ static void flags(char *arg) { - register char *argp; - register int on; + char *argp; + int on; argp = arg; while (*++argp) @@ -294,8 +294,8 @@ void do_proc(void) static void archive(void) { - register int i; - register char *p; + int i; + char *p; /* * Read a library. @@ -417,10 +417,10 @@ void initproc(void) void endproc(void) { /* Throw the contents of the line and local label table away */ - register line_t *lnp1; - register locl_t *lbhead, *lbp, *lbp_next; - register int kind; - register stat_t *prevstate; + line_t *lnp1; + locl_t *lbhead, *lbp, *lbp_next; + int kind; + stat_t *prevstate; while ((lnp1 = pstate.s_fline) != NULL) { @@ -481,7 +481,7 @@ void end_module(void) static void enmd_pro(void) { - register proc_t *p, *limit; + proc_t *p, *limit; /* * Check that all local procedures have been defined, @@ -511,7 +511,7 @@ static void enmd_pro(void) static void enmd_glo(void) { - register glob_t *mg, *xg, *limit; + glob_t *mg, *xg, *limit; /* * Tougher then enmd_pro(). @@ -586,7 +586,7 @@ static void c_print(void) static void c_dprint(char *str, char* cnt) { - register int first, curr; + int first, curr; printf("unused %s opcodes\n", str); for (first = -1, curr = 0; curr <= 256; curr++) { @@ -616,9 +616,9 @@ static void c_dprint(char *str, char* cnt) static void check_def(void) { - register proc_t *p; - register glob_t *g; - register int count; + proc_t *p; + glob_t *g; + int count; /* * Check for unresolved references. diff --git a/util/ass/ass30.c b/util/ass/ass30.c index ed25376178..dd0427aa9c 100644 --- a/util/ass/ass30.c +++ b/util/ass/ass30.c @@ -18,7 +18,7 @@ short opt_line; /* max_line_no - # lines removed from end */ /* Forward declarations. */ -static int valid(register line_t *); +static int valid(line_t *); static char *findfit(int, cons_t); static char *findnop(int); @@ -28,13 +28,13 @@ static char *findnop(int); */ void pass_3(void) { - register line_t *lnp, *rev_lnp; + line_t *lnp, *rev_lnp; line_t *tmp_lnp; locl_t *lbp; int min_l, max_l, min_bytes; short last_line; short hol_err_line; - register int insno; + int insno; pass = 3; opt_line = line_num; @@ -147,8 +147,8 @@ int oplength(int flag) void determine_props(line_t *lnp, int *min_len, int *max_len) { cons_t val; - register int insno; - register char *f_off, *l_off; + int insno; + char *f_off, *l_off; char defined; insno = ctrunc(lnp->instr_num); @@ -194,7 +194,7 @@ void determine_props(line_t *lnp, int *min_len, int *max_len) static char *findfit(int instr, cons_t val) { - register char *currc, *endc; + char *currc, *endc; int found, flags, number; char *opc; @@ -220,7 +220,7 @@ static char *findfit(int instr, cons_t val) static char* findnop(int instr) { - register char *currc, *endc; + char *currc, *endc; endc = opindex[instr + 1]; for (currc = opindex[instr]; currc < endc; currc++) @@ -294,9 +294,9 @@ int opfit(int flag, int number, cons_t val, int i_flag) */ cons_t parval(line_t *lnp, char *defined) { - register int type; - register locl_t *lbp; - register glob_t *gbp; + int type; + locl_t *lbp; + glob_t *gbp; cons_t offs; *defined = TRUE; @@ -374,7 +374,7 @@ cons_t parval(line_t *lnp, char *defined) return (0); } -static int valid(register line_t *lnp) +static int valid(line_t *lnp) { cons_t val; int type; diff --git a/util/ass/ass40.c b/util/ass/ass40.c index fe3e8178dc..b823cd2f3f 100644 --- a/util/ass/ass40.c +++ b/util/ass/ass40.c @@ -15,8 +15,8 @@ */ void pass_4(void) { - register line_t *lnp; - register locl_t *lbp; + line_t *lnp; + locl_t *lbp; int min_l, max_l; int instr; diff --git a/util/ass/ass50.c b/util/ass/ass50.c index 6f6bbf8ca3..bd562b5db5 100644 --- a/util/ass/ass50.c +++ b/util/ass/ass50.c @@ -21,11 +21,11 @@ static void patchcase(void); void pass_5(void) { - register line_t *lnp; + line_t *lnp; cons_t off1; char defined ; int afterlength, partype ; - register int inslength, ope; + int inslength, ope; char *op_curr ; pass = 5; @@ -87,7 +87,7 @@ void pass_5(void) void genop(char *startc,cons_t value,int i_flag) { char *currc ; - register int flag ; + int flag ; char opc ; currc= startc ; @@ -166,8 +166,8 @@ void genop(char *startc,cons_t value,int i_flag) static void patchcase(void) { - register relc_t *r; - register locl_t *k; + relc_t *r; + locl_t *k; if ( (r= pstate.s_fdata) ) { r= r->r_next ; diff --git a/util/ass/ass60.c b/util/ass/ass60.c index 0a99b6d18d..2e9dcf1026 100644 --- a/util/ass/ass60.c +++ b/util/ass/ass60.c @@ -21,7 +21,7 @@ static char *r_data[] = cons_t nicepr(int typ, addr_u *ap) { - register proc_t *pl; + proc_t *pl; switch (typ) { @@ -51,7 +51,7 @@ cons_t nicepr(int typ, addr_u *ap) char *pflags(int flg) { static char res[9]; - register char *cp; + char *cp; cp = res; if (flg & OPESC) @@ -76,10 +76,10 @@ char *pflags(int flg) void dump(int n) { - register glob_t *gb; - register line_t *ln; - register locl_t *lbp; - register locl_t *lbhead; + glob_t *gb; + line_t *ln; + locl_t *lbp; + locl_t *lbhead; proc_t *pl; int i; int insno; @@ -193,7 +193,7 @@ void dump(int n) } if (r_flag) { - register relc_t *rl; + relc_t *rl; printf("\nData relocation\n"); printf("\n\t%10s %10s %10s\n", "offset", "type", "value"); for (rl = f_data; rl; rl = rl->r_next) diff --git a/util/ass/ass70.c b/util/ass/ass70.c index ddd267af94..0a8331ba14 100644 --- a/util/ass/ass70.c +++ b/util/ass/ass70.c @@ -23,9 +23,9 @@ static int globstep; */ static int glohash(char *aname ,int size) { - register char *p; - register int i; - register int sum; + char *p; + int i; + int sum; /* * Computes a hash-value from a string. @@ -87,8 +87,8 @@ static void findext(glob_t *g) */ glob_t *glolookup(char *name,int status,glob_t *table, int size) { - register glob_t *g; - register int rem,j; + glob_t *g; + int rem,j; int new; @@ -159,8 +159,8 @@ glob_t *glolookup(char *name,int status,glob_t *table, int size) */ locl_t *loclookup(unsigned int an,int status) { - register locl_t *lbp,*l_lbp; - register unsigned int num; + locl_t *lbp,*l_lbp; + unsigned int num; char hinum; if ( !pstate.s_locl ) fatal("label outside procedure"); @@ -214,8 +214,8 @@ locl_t *loclookup(unsigned int an,int status) */ proc_t *prolookup(char *name,int status) { - register proc_t *p= NULL; - register int pstat = 0; + proc_t *p= NULL; + int pstat = 0; switch(status) { @@ -296,8 +296,8 @@ proc_t *prolookup(char *name,int status) */ proc_t *searchproc(char *name,proc_t *table,int size) { - register proc_t *p; - register int rem,j; + proc_t *p; + int rem,j; rem = glohash(name,size); @@ -327,7 +327,7 @@ proc_t *searchproc(char *name,proc_t *table,int size) */ proc_t *enterproc(char *name,int status,proc_t *place) { - register proc_t *p; + proc_t *p; p=place; p->p_name = (char *) getarea((unsigned) (strlen(name) + 1)); diff --git a/util/ass/ass80.c b/util/ass/ass80.c index 168a4a2b6f..39ba1b555c 100644 --- a/util/ass/ass80.c +++ b/util/ass/ass80.c @@ -73,23 +73,23 @@ void fatal(char *s) -int xgetc(register FILE *af) +int xgetc(FILE *af) { - register int nextc; + int nextc; nextc=fgetc(af) ; if ( feof(af) ) fatal("unexpected end of file"); return nextc ; } -void xputc(int c,register FILE *af) +void xputc(int c, FILE *af) { fputc(c,af) ; if ( ferror(af) ) fatal("write error") ; } -void putblk(register FILE *stream,register char *from, register int amount) +void putblk(FILE *stream, char *from, int amount) { for ( ; amount-- ; from++ ) { fputc(*from,stream) ; @@ -97,7 +97,7 @@ void putblk(register FILE *stream,register char *from, register int amount) } } -int getblk(register FILE *stream, register char *from, register int amount) +int getblk(FILE *stream, char *from, int amount) { for ( ; amount-- ; from++ ) { *from = fgetc(stream) ; @@ -164,7 +164,7 @@ int xget8(void) unsigned int get8(void) { - register int nextc; + int nextc; /* * Read one byte from ifile. */ @@ -181,7 +181,7 @@ unsigned int get8(void) cons_t xgetarb(int l,FILE *f) { cons_t val ; - register int shift ; + int shift ; int c; shift=0 ; val=0 ; @@ -218,7 +218,7 @@ void extword(cons_t w) /* Assemble the word constant w. * NOTE: The bytes are written low to high. */ - register int i ; + int i ; for ( i=wordsize ; i-- ; ) { ext8( int_cast w) ; w >>= 8 ; @@ -230,7 +230,7 @@ void extarb(int size, long value) /* Assemble the 'size' constant value. * The bytes are again written low to high. */ - register int i ; + int i ; for ( i=size ; i-- ; ) { ext8( int_cast value ) ; value >>=8 ; @@ -242,7 +242,7 @@ void extadr(cons_t a) /* Assemble the pointer constant a. * NOTE: The bytes are written low to high. */ - register int i ; + int i ; for ( i=ptrsize ; i-- ; ) { ext8( int_cast a) ; a >>= 8 ; @@ -252,7 +252,7 @@ void extadr(cons_t a) void xputa(cons_t a,FILE* f) { - register int i ; + int i ; for ( i=ptrsize ; i-- ; ) { xputc( int_cast a,f) ; a >>= 8 ; @@ -262,7 +262,7 @@ void xputa(cons_t a,FILE* f) cons_t xgeta(FILE* f) { - register int i, shift ; + int i, shift ; cons_t val ; val = 0 ; shift=0 ; for ( i=ptrsize ; i-- ; ) { diff --git a/util/ass/assci.c b/util/ass/assci.c index f12c7f79d3..4fa7c5198f 100644 --- a/util/ass/assci.c +++ b/util/ass/assci.c @@ -58,12 +58,12 @@ static void typealign(enum m_type); static void sizealign(cons_t); static void extconst(cons_t); static void extbss(cons_t); -static void extloc(register locl_t *); +static void extloc(locl_t *); static void extglob(glob_t *, cons_t); static void extpro(proc_t *); static void extstring(void); static void extxcon(int); -static long myatol(register char *); +static long myatol(char *); static void extvcon(int); @@ -133,7 +133,7 @@ static int table3(int i) int get16(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = get8(); h_byte = get8(); @@ -144,7 +144,7 @@ int get16(void) int getu16(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = get8(); h_byte = get8(); @@ -153,8 +153,8 @@ int getu16(void) cons_t get32(void) { - register cons_t l; - register int h_byte; + cons_t l; + int h_byte; l = get8(); l |= (unsigned) get8() * 256; @@ -167,7 +167,7 @@ cons_t get32(void) static int table1(void) { - register int i; + int i; i = xget8(); if (i < sp_fmnem + sp_nmnem && i >= sp_fmnem) @@ -190,7 +190,7 @@ static int table1(void) static int table2(void) { - register int i; + int i; i = get8(); if (i < sp_fcst0 + sp_ncst0 && i >= sp_fcst0) @@ -204,7 +204,7 @@ static int table2(void) /* Read argument of instruction */ static int getarg(int typset) { - register int t, argtyp; + int t, argtyp; argtyp = t = table2(); t -= sp_fspec; @@ -228,7 +228,7 @@ static glob_t *getlab(int status) static char *getdig(char *str, unsigned int number) { - register int remain; + int remain; remain = number % 10; number /= 10; @@ -246,8 +246,8 @@ static void make_string(unsigned int n) static void getstring(void) { - register char *p; - register int n; + char *p; + int n; getarg(cst_ptyp); if (argval < 0 || argval >= MAXSTRING - 1) @@ -272,8 +272,8 @@ static char *inproname(void) static int needed(void) { - register glob_t *g; - register proc_t *p; + glob_t *g; + proc_t *p; for (;;) { @@ -337,7 +337,7 @@ static cons_t valsize(void) void newline(int type) { - register line_t *n_lnp; + line_t *n_lnp; if (type > VALLOW) type = VALLOW; @@ -372,10 +372,10 @@ static void setline(void) static void inpseudo(int instr_no) { cons_t cst; - register proc_t *prptr; + proc_t *prptr; cons_t objsize; cons_t par1, par2; - register char *pars; + char *pars; /* * get operands of pseudo (if needed) and process it. @@ -544,7 +544,7 @@ static void inpseudo(int instr_no) */ static void compact_line(void) { - register int instr_no; + int instr_no; curglosym = 0; @@ -709,7 +709,7 @@ static void setsizes(void) static void exchange(int p1, int p2) { int size, line; - register line_t *t_lnp, *a_lnp, *b_lnp; + line_t *t_lnp, *a_lnp, *b_lnp; /* Since the lines are linked backwards it is easy * to count the number of lines backwards. @@ -802,7 +802,7 @@ static void exchange(int p1, int p2) static void doinsert(line_t *lnp, int first, int extra) { /* Beware : s_fline will be clobbered and restored */ - register line_t *t_lnp; + line_t *t_lnp; t_lnp = pstate.s_fline; pstate.s_fline = lnp->l_next; @@ -865,7 +865,7 @@ static void chkstart(void) set_mode(DATA_REP); if (wordsize < ABSSIZE) { - register int factor = ABSSIZE / wordsize - 1; + int factor = ABSSIZE / wordsize - 1; extadr((cons_t) factor); databytes += factor * wordsize; } @@ -959,7 +959,7 @@ static void extbss(cons_t n) } } -static void extloc(register locl_t *lbp) +static void extloc(locl_t *lbp) { /* @@ -973,7 +973,7 @@ static void extloc(register locl_t *lbp) static void extglob(glob_t *agbp, cons_t off) { - register glob_t *gbp; + glob_t *gbp; /* * generate a word of data that is defined by a global symbol. @@ -1004,8 +1004,8 @@ static void extpro(proc_t *aprp) static void extstring(void ) { - register char *s; - register int n; + char *s; + int n; /* * generate data for a string. @@ -1020,8 +1020,8 @@ static void extstring(void ) static void extxcon(int header) { - register char *s; - register int n; + char *s; + int n; /* * generate data for a floating constant initialized by a string. @@ -1040,10 +1040,10 @@ static void extxcon(int header) } /* Added atol() that ignores overflow. --Ceriel */ -static long myatol(register char *s) +static long myatol(char *s) { - register long total = 0; - register unsigned digit; + long total = 0; + unsigned digit; int minus = 0; while (*s == ' ' || *s == '\t') diff --git a/util/ass/asscm.c b/util/ass/asscm.c index dcec8bb479..26d99e9be7 100644 --- a/util/ass/asscm.c +++ b/util/ass/asscm.c @@ -44,8 +44,8 @@ static struct freeblock freexx[2] = area_t getarea(unsigned int size) { - register struct freeblock *c_ptr, *l_ptr; - register char *ptr; + struct freeblock *c_ptr, *l_ptr; + char *ptr; unsigned rqsize; size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int); @@ -90,9 +90,9 @@ area_t getarea(unsigned int size) UNREACHABLE_CODE; } -void freearea(register area_t ptr, unsigned int size) +void freearea(area_t ptr, unsigned int size) { - register struct freeblock *c_ptr, *l_ptr; + struct freeblock *c_ptr, *l_ptr; size = ((size + (sizeof(int) - 1)) / sizeof(int)) * sizeof(int); #ifdef MEMUSE diff --git a/util/ass/asscm.h b/util/ass/asscm.h index c28d6db36f..bdc8decb21 100644 --- a/util/ass/asscm.h +++ b/util/ass/asscm.h @@ -13,7 +13,7 @@ */ area_t getarea(unsigned int size); /* Frees an area of memory of "size" bytes. */ -void freearea(register area_t ptr, unsigned int size); +void freearea(area_t ptr, unsigned int size); #ifdef MEMUSE void memuse(void); diff --git a/util/ass/assex.h b/util/ass/assex.h index d83bfb9f78..fe16a42d92 100644 --- a/util/ass/assex.h +++ b/util/ass/assex.h @@ -127,7 +127,7 @@ extern char *tmpfil(void); /* Read next byte from "af" file, fatal error if there isn't one. */ -extern int xgetc(register FILE *af); +extern int xgetc(FILE *af); /* Read a value of length "l" bytes from file "f", * fatal error if cannot be read. */ @@ -140,7 +140,7 @@ extern cons_t xgeta(FILE* f); /* Output one byte into file "af" and fatal error if it gives an error */ -extern void xputc(int c,register FILE *af); +extern void xputc(int c, FILE *af); /* Output a 16-bit value into file "f" in little-endian, fatal error if it gives an error. */ extern void xput16(int w,FILE *f); /* Output a value of "l" bytes into file "f" and fatal error if it gives an error. */ @@ -204,8 +204,8 @@ extern void extadr(cons_t a); extern int oplength(int); extern void genop(char *,cons_t,int ); -extern void putblk(register FILE *stream,register char *from, register int amount); -extern int getblk(register FILE *stream, register char *from, register int amount); +extern void putblk(FILE *stream, char *from, int amount); +extern int getblk(FILE *stream, char *from, int amount); extern void set_mode(int mode); diff --git a/util/ass/assrl.c b/util/ass/assrl.c index 2da8645c68..b96568b547 100644 --- a/util/ass/assrl.c +++ b/util/ass/assrl.c @@ -36,7 +36,7 @@ relc_t * text_reloc(glob_t *glosym, FOFFSET off, int typ) * into the one in xglobs[] later. */ - register relc_t *nxtextreloc; + relc_t *nxtextreloc; nxtextreloc = rlp_cast getarea(sizeof *nxtextreloc); if (!f_text) @@ -62,7 +62,7 @@ relc_t * data_reloc(char *arg ,FOFFSET off, int typ) * Same as above. */ - register relc_t *nxdatareloc; + relc_t *nxdatareloc; nxdatareloc = rlp_cast getarea(sizeof *nxdatareloc); if (!f_data) @@ -83,7 +83,7 @@ relc_t * data_reloc(char *arg ,FOFFSET off, int typ) void copyout(void) { - register int i; + int i; int remtext; /* @@ -168,7 +168,7 @@ static void dataprocess(FILE *f1, FILE *outf) { relc_t datareloc; FOFFSET i; - register int ieof; + int ieof; rewind(rdfile); ieof = getblk(rdfile, (char *) (&datareloc.r_off), @@ -217,9 +217,9 @@ static void textprocess(FILE *f1, FILE *outf) FOFFSET i; FILE *otfile; int insl; - register int ieof; + int ieof; char *op_curr; - register FOFFSET keep; + FOFFSET keep; rewind(rtfile); keep = textoff; @@ -275,8 +275,8 @@ static void textprocess(FILE *f1, FILE *outf) void upd_reloc(void) { - register relc_t *p; - register glob_t *gbp; + relc_t *p; + glob_t *gbp; /* * Change reloc-tables such that for every pointer into mglobs diff --git a/util/ass/maktab.c b/util/ass/maktab.c index 39cd333287..15e7abfaf8 100644 --- a/util/ass/maktab.c +++ b/util/ass/maktab.c @@ -89,9 +89,9 @@ int main(int argc, char **argv) static void readin(void) { - register struct opform *nextform; + struct opform *nextform; char *firstid; - register int maxl; + int maxl; maxl = 0; for (nextform = intable; !feof(stdin) && nextform < &intable[NOTAB];) @@ -135,8 +135,8 @@ static char *ident(void) */ static char array[200]; - register int c; - register char *cc; + int c; + char *cc; do { @@ -339,10 +339,10 @@ static int decflag(char *str) static void writeout(void) { - register struct opform *next; + struct opform *next; int elem[sp_lmnem - sp_fmnem + 1 + 1]; /* for each op points to first of descr. */ - register int i, currop; + int i, currop; int nch; qsort(intable, (lastform - intable) + 1, sizeof intable[0], compare); @@ -444,8 +444,8 @@ char negc[NMNEM], zc[NMNEM], posc[NMNEM]; static void checkall(void) { - register int i, flag; - register struct opform *next; + int i, flag; + struct opform *next; int opc, low; for (i = 0; i < NMNEM; i++) diff --git a/util/ceg/EM_parser/common/eval.c b/util/ceg/EM_parser/common/eval.c index b7ff69cef6..cd1ca3b50e 100644 --- a/util/ceg/EM_parser/common/eval.c +++ b/util/ceg/EM_parser/common/eval.c @@ -9,7 +9,7 @@ char *str; * parameter-names, converted where necessary. */ { - register char c; + char c; int i; for ( c = *str++; c != '\0'; c= *str++) diff --git a/util/ceg/EM_parser/common/help.c b/util/ceg/EM_parser/common/help.c index a997354bb2..fb55820cc3 100644 --- a/util/ceg/EM_parser/common/help.c +++ b/util/ceg/EM_parser/common/help.c @@ -23,7 +23,7 @@ char *str; /* Print : "if ( ) {" */ { - register char c; + char c; int arg_nr; out( "if ( "); @@ -49,7 +49,7 @@ char *str; * that are generated, look for text?() and reloc?() calls. */ { - register char c; + char c; int arg_nr; extern int no_conversions; diff --git a/util/ceg/ce_back/obj_back/common.c b/util/ceg/ce_back/obj_back/common.c index 4b142cb6ea..3e605d7eb6 100644 --- a/util/ceg/ce_back/obj_back/common.c +++ b/util/ceg/ce_back/obj_back/common.c @@ -5,7 +5,7 @@ common(n) arith n; { extern int Label, Label_waiting; - register struct outname *nm = &symbol_table[Label]; + struct outname *nm = &symbol_table[Label]; if (Label_waiting) { /* If possible, generate a common. Local commons must diff --git a/util/ceg/ce_back/obj_back/dbsym.c b/util/ceg/ce_back/obj_back/dbsym.c index 6c32448789..1272b4ab07 100644 --- a/util/ceg/ce_back/obj_back/dbsym.c +++ b/util/ceg/ce_back/obj_back/dbsym.c @@ -8,7 +8,7 @@ char *s, *val; arith added; { int i = find_sym(val, STORE_STRING); - register struct outname *p; + struct outname *p; if (! s) s = ""; p = &symbol_table[find_sym(s, FORCE_DEF)]; @@ -21,7 +21,7 @@ B_symbcst(s, len, type, add, val) char *s; arith val; { - register struct outname *p; + struct outname *p; if (! s) s = ""; p = &symbol_table[find_sym(s, FORCE_DEF)]; @@ -33,7 +33,7 @@ arith val; B_symd(s, len, type, add) char *s; { - register struct outname *p; + struct outname *p; if (! s) s = ""; p = &symbol_table[find_sym(s, FORCE_DEF)]; diff --git a/util/ceg/ce_back/obj_back/end_back.c b/util/ceg/ce_back/obj_back/end_back.c index 30b9e692a4..4b55590eb7 100644 --- a/util/ceg/ce_back/obj_back/end_back.c +++ b/util/ceg/ce_back/obj_back/end_back.c @@ -9,8 +9,8 @@ finish_tables() /* Prepare tables for do_local_relocation() and output(). */ { - register struct outname *np = symbol_table; - register int i = nname; + struct outname *np = symbol_table; + int i = nname; for (; i; i--, np++) { if ((np->on_type & S_COM) && ! (np->on_type & S_EXT)) { diff --git a/util/ceg/ce_back/obj_back/output.c b/util/ceg/ce_back/obj_back/output.c index 0bf5947bae..9c3cf2ad70 100644 --- a/util/ceg/ce_back/obj_back/output.c +++ b/util/ceg/ce_back/obj_back/output.c @@ -97,13 +97,13 @@ reduce_name_table() #define S_NEEDED S_MOD #define removable(nm) (!(nm->on_type & (S_NEEDED|S_STB)) && *(nm->on_foff+string_area) == GENLAB) - register int *diff_index = + int *diff_index = (int *) Malloc((unsigned)(nname + 1) * sizeof(int)); - register struct outrelo *rp = reloc_info; - register struct outname *np; - register int i; + struct outrelo *rp = reloc_info; + struct outname *np; + int i; char *new_str; - register char *p, *q; + char *p, *q; *diff_index++ = 0; for (i = 0; i < nrelo; i++) { @@ -176,8 +176,8 @@ convert_outname( header) struct outhead *header; { int i; - register struct outname *np; - register long l = OFF_CHAR(*header); + struct outname *np; + long l = OFF_CHAR(*header); for (i = 0, np = symbol_table; i < nname; i++, np++) { np->on_foff += l; diff --git a/util/ceg/ce_back/obj_back/reloc1.c b/util/ceg/ce_back/obj_back/reloc1.c index 04e43a3d51..2ee92d882d 100644 --- a/util/ceg/ce_back/obj_back/reloc1.c +++ b/util/ceg/ce_back/obj_back/reloc1.c @@ -26,7 +26,7 @@ char *sym; arith off; int pcrel; { - register struct outrelo *r; + struct outrelo *r; if ( relo - reloc_info >= size_reloc) mem_relo(); diff --git a/util/ceg/ce_back/obj_back/reloc2.c b/util/ceg/ce_back/obj_back/reloc2.c index 26aea55f67..3ca4c88f8a 100644 --- a/util/ceg/ce_back/obj_back/reloc2.c +++ b/util/ceg/ce_back/obj_back/reloc2.c @@ -26,7 +26,7 @@ char *sym; arith off; int pcrel; { - register struct outrelo *r; + struct outrelo *r; if ( relo - reloc_info >= size_reloc) mem_relo(); diff --git a/util/ceg/ce_back/obj_back/reloc4.c b/util/ceg/ce_back/obj_back/reloc4.c index d2546783c2..297cbb0dfc 100644 --- a/util/ceg/ce_back/obj_back/reloc4.c +++ b/util/ceg/ce_back/obj_back/reloc4.c @@ -27,7 +27,7 @@ char *sym; arith off; int pcrel; { - register struct outrelo *r; + struct outrelo *r; if ( relo - reloc_info >= size_reloc) mem_relo(); diff --git a/util/ceg/ce_back/obj_back/relocation.c b/util/ceg/ce_back/obj_back/relocation.c index 98b0ee2bda..baf62b4a20 100644 --- a/util/ceg/ce_back/obj_back/relocation.c +++ b/util/ceg/ce_back/obj_back/relocation.c @@ -16,16 +16,16 @@ do_local_relocation() * Also remove useless relocation structures. */ { - register struct outrelo *rp; + struct outrelo *rp; int diff = 0; for ( rp = reloc_info; rp < relo; rp++) { - register struct outname *np = &symbol_table[rp->or_nami]; + struct outname *np = &symbol_table[rp->or_nami]; int olddiff = diff; if ( np->on_valu != -1 && ! (np->on_type & S_COM)) { - register long oldval,newval; - register char *sect; + long oldval,newval; + char *sect; switch( rp->or_sect - S_MIN) { case SEGTXT: diff --git a/util/ceg/ce_back/obj_back/symtable.c b/util/ceg/ce_back/obj_back/symtable.c index 8733392e30..1deede3d12 100644 --- a/util/ceg/ce_back/obj_back/symtable.c +++ b/util/ceg/ce_back/obj_back/symtable.c @@ -41,9 +41,9 @@ int find_sym( sym, isdef) char *sym; int isdef; { - register struct outname *s; - register struct Hashitem *ip; - register int h; + struct outname *s; + struct Hashitem *ip; + int h; if (isdef != FORCE_DEF) { if ( index_symbol_table != -1 ) { @@ -60,7 +60,7 @@ int isdef; h = Hash(sym); for ( ip = Hashtab[h] + Hashitems ; ip != Hashitems; ip = (ip->hs_next) + Hashitems) { - register char *p = sym, *q; + char *p = sym, *q; s = symbol_table + ip->hs_nami; q = string_area + s->on_foff; @@ -99,7 +99,7 @@ int isdef; if ( sym == string) string += string_lengte; else { /* zie C_fil, C_lin, C_lni */ - register char *p; + char *p; string_lengte = 0; for( p=sym; *p != '\0' ; p++) { @@ -125,8 +125,8 @@ int isdef; static int Hash(sym) char *sym; { - register unsigned h; - register char *s = sym; + unsigned h; + char *s = sym; h = 0; while (*s) { diff --git a/util/ceg/defaults/C_out_skel.c b/util/ceg/defaults/C_out_skel.c index da2204304e..294aacd551 100644 --- a/util/ceg/defaults/C_out_skel.c +++ b/util/ceg/defaults/C_out_skel.c @@ -11,7 +11,7 @@ #define CODE_EXPANDER #define EXPORT -#define PRIVATE static +#define static static #include #include @@ -26,11 +26,11 @@ extern char em_flag[]; /* One per EM instruction: indicates parameter kind */ extern short em_ptyp[]; /* One per parameter kind: indicates parameter type */ char *C_error; -PRIVATE C_dopseudo(); +static C_dopseudo(); EXPORT int C_out(p) - register struct e_instr *p; + struct e_instr *p; { C_error = 0; switch(p->em_type) { @@ -109,9 +109,9 @@ C_out(p) return 1; } -PRIVATE +static C_dopseudo(p) - register struct e_instr *p; + struct e_instr *p; { switch(p->em_opcode) { diff --git a/util/cgg/booth.h b/util/cgg/booth.h index d66206acc7..704f0aab68 100644 --- a/util/cgg/booth.h +++ b/util/cgg/booth.h @@ -218,23 +218,23 @@ EXTERN int rvnumbers[4][MAXREGVARS]; /* The register numbers */ #define MUST2BEBOOL(e1,e2) int exp1=e1.expr_index,exp2=e2.expr_index;tstbool(e1);tstbool(e2) ident_p ilookup(string name, int enterf); -unsigned hash(register string name); +unsigned hash(string name); int lookup(int comm, int operator, int lnode, int rnode); list2 lookstruct(list2 ll); string scopy(string s); void tabovf(string tablename); int strlookup(string s); -int structsize(register list2 s); +int structsize(list2 s); void yyerror(string s, ...); int instno(inst_t inst); int yyparse(void); -int stringno(register string s); +int stringno(string s); int exprlookup(set_t sett); void tstint(expr_t e); void tstbool(expr_t e); void inbetween(void); -int formconversion(register char *p, register token_p tp); -void setfields(register token_p tp, string format); +int formconversion(char *p, token_p tp); +void setfields(token_p tp, string format); void chkregexp(int number); int findstructel(int number, string name, int *t); int argtyp(int mn); diff --git a/util/cgg/main.c b/util/cgg/main.c index 7e2460a689..03c6ff0fc2 100644 --- a/util/cgg/main.c +++ b/util/cgg/main.c @@ -26,7 +26,7 @@ static int want_verbose = 0; char *myalloc(int n) { - register char *p; + char *p; p = malloc((unsigned) n); if (p == 0) @@ -51,10 +51,10 @@ void tstbool(expr_t e) yyerror("Must be boolean expression"); } -int structsize(register list2 s) +int structsize(list2 s) { - register list1 l; - register int sum; + list1 l; + int sum; sum = 0; while (s != 0) @@ -109,7 +109,7 @@ list2 lookstruct(list2 ll) int instno(inst_t inst) { - register int i, j; + int i, j; for (i = 1; i < narinstance; i++) { @@ -128,7 +128,7 @@ int instno(inst_t inst) string scopy(string s) { - register string t; + string t; t = (char *) myalloc(strlen(s) + 1); strcpy(t, s); @@ -137,7 +137,7 @@ string scopy(string s) int strlookup(string s) { - register int i; + int i; for (i = 0; i < ncodestrings; i++) if (strcmp(s, codestrings[i]) == 0) @@ -147,10 +147,10 @@ int strlookup(string s) return (ncodestrings++); } -int stringno(register string s) +int stringno(string s) { char buf[256]; - register char *p = buf; + char *p = buf; while (*s != 0) switch (*s) @@ -213,7 +213,7 @@ int stringno(register string s) else { char field[256]; - register char *f = field; + char *f = field; int type, offset; while (*s != ']' && *s != 0) @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) int lookup(int comm, int operator, int lnode, int rnode) { - register node_p p; + node_p p; for (p = nodes + 1; p < lastnode; p++) { @@ -352,7 +352,7 @@ int lookup(int comm, int operator, int lnode, int rnode) static void compueq(void) { - register int i, j; + int i, j; for (i = 1; i < nmachregs; i++) { @@ -369,8 +369,8 @@ static void compueq(void) static int eqregclass(int r1, int r2) { - register reginfo rp1, rp2; - register int i; + reginfo rp1, rp2; + int i; short regbits[(MAXREGS + 15) >> 4]; int member; @@ -395,10 +395,10 @@ static int eqregclass(int r1, int r2) return (1); } -unsigned hash(register string name) +unsigned hash(string name) { - register unsigned sum; - register int i; + unsigned sum; + int i; for (sum = i = 0; *name; i += 3) sum ^= (*name++) << (i & 07); @@ -407,7 +407,7 @@ unsigned hash(register string name) ident_p ilookup(string name, int enterf) { - register ident_p p, *pp; + ident_p p, *pp; pp = &identtab[hash(name) % ITABSIZE]; while (*pp != 0) @@ -461,7 +461,7 @@ static void initio(void) int exprlookup(set_t sett) { - register int i, j, ok; + int i, j, ok; for (i = 0; i < nmachsets; i++) { @@ -483,8 +483,8 @@ int exprlookup(set_t sett) static void inittables(void) { - register reginfo r; - register int i; + reginfo r; + int i; inst_t inst; set_t sett; @@ -519,7 +519,7 @@ static void inittables(void) static void outregs(void) { - register int i, j, k; + int i, j, k; static short rset[(MAXREGS + 15) >> 4]; int t, ready; @@ -584,11 +584,11 @@ static void outregs(void) static void finishio(void) { - register int i; - register node_p np; + int i; + node_p np; int j; int setsize; - register move_p mp; + move_p mp; fprintf(cfile, "};\n\n"); if (wsize > 0) @@ -641,12 +641,12 @@ static void finishio(void) fprintf(cfile, "};\n\nstring codestrings[] = {\n"); for (i = 0; i < ncodestrings; i++) { - register char *p; + char *p; p = codestrings[i]; fprintf(cfile, "\t\""); while (*p) { - register int c = (*p) & BMASK; + int c = (*p) & BMASK; if (!isasc(c) || iscntrl(c)) { /* The next line used to have (c>>6)&03, @@ -747,7 +747,7 @@ static void finishio(void) static void outregvar(void) { - register int i, j; + int i, j; fprintf(hfile, "#define REGVARS\n"); fprintf(cfile, "#include \"regvar.h\"\n"); @@ -796,9 +796,9 @@ static void verbose(void) void inbetween(void) { - register ident_p ip; - register int i, j; - register move_p mp; + ident_p ip; + int i, j; + move_p mp; lookident = 1; /* for lexical analysis */ @@ -841,12 +841,12 @@ void inbetween(void) } } -int formconversion(register char *p, register token_p tp) +int formconversion(char *p, token_p tp) { char buf[256]; - register char *q = buf; + char *q = buf; char field[256]; - register char *f; + char *f; int i; if (p == 0) @@ -887,11 +887,11 @@ int formconversion(register char *p, register token_p tp) return (strlookup(buf)); } -void setfields(register token_p tp, string format) +void setfields(token_p tp, string format) { - register int i; + int i; list2 ll; - register list1 l; + list1 l; int type; for (i = 0; i < TOKENSIZE - 1; i++) @@ -921,7 +921,7 @@ void setfields(register token_p tp, string format) void chkregexp(int number) { - register int i; + int i; for (i = nmachregs + 1; i < nmachregs + 1 + nmachtokens; i++) if (machsets[number].set_val[i >> 4] & (01 << (i & 017))) @@ -930,9 +930,9 @@ void chkregexp(int number) int findstructel(int number, string name, int *t) { - register int i; - register token_p tp; - register list2 structdecl; + int i; + token_p tp; + list2 structdecl; int offset; for (i = 1; i <= nmachregs; i++) @@ -1009,7 +1009,7 @@ struct hashmnem void inithash(void) { - register int i; + int i; for (i = 0; i <= sp_lmnem - sp_fmnem; i++) enter(em_mnem[i], i + sp_fmnem); @@ -1017,7 +1017,7 @@ void inithash(void) void enter(char *name, int value) { - register unsigned h; + unsigned h; h = hash(name) % HASHSIZE; while (hashmnem[h].h_name[0] != 0) @@ -1028,7 +1028,7 @@ void enter(char *name, int value) int mlookup(char *name) { - register unsigned int h; + unsigned int h; h = hash(name) % HASHSIZE; while (strncmp(hashmnem[h].h_name, name, 3) != 0 @@ -1040,8 +1040,8 @@ int mlookup(char *name) void hashpatterns(void) { short index; - register byte *bp, *tp; - register short i; + byte *bp, *tp; + short i; unsigned short hashvalue; int patlen; @@ -1080,18 +1080,18 @@ void hashpatterns(void) static void debug(void) { - register int i, j; + int i, j; for (i = 0; i < ITABSIZE; i++) { - register ident_p ip; + ident_p ip; for (ip = identtab[i]; ip != 0; ip = ip->i_next) printf("%-14s %1d %3d\n", ip->i_name, ip->i_type, ip->i_i.i_regno); } for (i = 2; i < nmachregs; i++) { - register reginfo rp; + reginfo rp; rp = machregs[i]; printf("%s = (\"%s\", %d", rp->rname, rp->rrepr, rp->rsize); diff --git a/util/cmisc/GCIPM.c b/util/cmisc/GCIPM.c index 78b3a9d7ec..6766529578 100644 --- a/util/cmisc/GCIPM.c +++ b/util/cmisc/GCIPM.c @@ -13,129 +13,153 @@ extern void BeginOfProgram(void); extern void EndOfProgram(void); extern void DoOption(char*); -extern void CheckId(char *, int); +extern void CheckId(char*, int); +#define MAX_ID_LEN 256 -#define MAX_ID_LEN 256 - -char *ProgName; +char* ProgName; int GCcopy; - -void DoFile(FILE *); -void SkipString(FILE *, int); -void SkipComment(FILE *); -void DoIdent(FILE *, int); +void DoFile(FILE*); +void SkipString(FILE*, int); +void SkipComment(FILE*); +void DoIdent(FILE*, int); int StartId(int); int InId(int); int StartNum(int); -void DoNum(register FILE *, int); - +void DoNum(FILE*, int); - -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { - char **nargv; + char** nargv; int nargc = 0; - FILE *fp; + FILE* fp; ProgName = *argv++; nargv = argv; BeginOfProgram(); - while (--argc > 0) { - if ((*argv)[0] == '-') { + while (--argc > 0) + { + if ((*argv)[0] == '-') + { DoOption(*argv++); } - else { + else + { nargv[nargc++] = *argv++; } } - if (nargc > 0) { - while (nargc-- > 0) { - if ((fp = fopen(*nargv, "r")) == NULL) { - fprintf(stderr, "%s: cannot read file \"%s\"\n", - ProgName, *nargv); + if (nargc > 0) + { + while (nargc-- > 0) + { + if ((fp = fopen(*nargv, "r")) == NULL) + { + fprintf(stderr, "%s: cannot read file \"%s\"\n", ProgName, *nargv); } - else { + else + { DoFile(fp); } nargv++; } } - else { + else + { DoFile(stdin); } EndOfProgram(); return 0; } -void DoFile(FILE *fp) +void DoFile(FILE* fp) { - register int c; - - while ((c = getc(fp)) != EOF) { - switch (c) { - - case '"': - case '\'': - if (GCcopy) putchar(c); - SkipString(fp, c); - break; - - case '/': - if (GCcopy) putchar(c); - if ((c = getc(fp)) == '*') { - if (GCcopy) putchar(c); - SkipComment(fp); - } - else { - ungetc(c, fp); - } - break; - - default: - if (StartId(c)) { - DoIdent(fp, c); - } - else if (StartNum(c)) { - if (GCcopy) putchar(c); - DoNum(fp, c); - } - else if (GCcopy) putchar(c); - break; + int c; + + while ((c = getc(fp)) != EOF) + { + switch (c) + { + + case '"': + case '\'': + if (GCcopy) + putchar(c); + SkipString(fp, c); + break; + + case '/': + if (GCcopy) + putchar(c); + if ((c = getc(fp)) == '*') + { + if (GCcopy) + putchar(c); + SkipComment(fp); + } + else + { + ungetc(c, fp); + } + break; + + default: + if (StartId(c)) + { + DoIdent(fp, c); + } + else if (StartNum(c)) + { + if (GCcopy) + putchar(c); + DoNum(fp, c); + } + else if (GCcopy) + putchar(c); + break; } } fclose(fp); } -void SkipString(FILE *fp, int stopc) +void SkipString(FILE* fp, int stopc) { - register int c; - - while ((c = getc(fp)) != EOF) { - if (GCcopy) putchar(c); - if (c == stopc) { + int c; + + while ((c = getc(fp)) != EOF) + { + if (GCcopy) + putchar(c); + if (c == stopc) + { return; } - if (c == '\\') { + if (c == '\\') + { c = getc(fp); - if (GCcopy) putchar(c); + if (GCcopy) + putchar(c); } } } -void SkipComment(FILE *fp) +void SkipComment(FILE* fp) { - register int c; - - while ((c = getc(fp)) != EOF) { - if (GCcopy) putchar(c); - if (c == '*') { - if ((c = getc(fp)) == '/') { - if (GCcopy) putchar(c); + int c; + + while ((c = getc(fp)) != EOF) + { + if (GCcopy) + putchar(c); + if (c == '*') + { + if ((c = getc(fp)) == '/') + { + if (GCcopy) + putchar(c); return; } ungetc(c, fp); @@ -143,19 +167,22 @@ void SkipComment(FILE *fp) } } -void DoIdent(FILE *fp, int s) +void DoIdent(FILE* fp, int s) { char id_buf[MAX_ID_LEN]; - register int cnt = 1; - register int c; + int cnt = 1; + int c; id_buf[0] = s; - while ((c = getc(fp)) != EOF) { - if (InId(c)) { + while ((c = getc(fp)) != EOF) + { + if (InId(c)) + { id_buf[cnt++] = c; } - else { + else + { ungetc(c, fp); id_buf[cnt] = '\0'; CheckId(id_buf, cnt); @@ -166,79 +193,198 @@ void DoIdent(FILE *fp, int s) int StartId(int c) { - switch (c) { + switch (c) + { + + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + return 1; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': case 'g': case 'h': case 'i': case 'j': - case 'k': case 'l': case 'm': case 'n': case 'o': - case 'p': case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': case 'y': - case 'z': - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': case 'G': case 'H': case 'I': case 'J': - case 'K': case 'L': case 'M': case 'N': case 'O': - case 'P': case 'Q': case 'R': case 'S': case 'T': - case 'U': case 'V': case 'W': case 'X': case 'Y': - case 'Z': - case '_': - return 1; - - default: - return 0; + default: + return 0; } } int InId(int c) { - switch (c) { + switch (c) + { + + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return 1; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': case 'g': case 'h': case 'i': case 'j': - case 'k': case 'l': case 'm': case 'n': case 'o': - case 'p': case 'q': case 'r': case 's': case 't': - case 'u': case 'v': case 'w': case 'x': case 'y': - case 'z': - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': case 'G': case 'H': case 'I': case 'J': - case 'K': case 'L': case 'M': case 'N': case 'O': - case 'P': case 'Q': case 'R': case 'S': case 'T': - case 'U': case 'V': case 'W': case 'X': case 'Y': - case 'Z': - case '_': - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - return 1; - - default: - return 0; + default: + return 0; } } int StartNum(int c) { - switch(c) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - return 1; + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + return 1; } return 0; } -#define inrange(c, l, u) ((unsigned)((c) - (l)) <= ((u) - (l))) +#define inrange(c, l, u) ((unsigned)((c) - (l)) <= ((u) - (l))) #define isdec(c) inrange(c, '0', '9') #define isoct(c) inrange(c, '0', '7') #define ishex(c) (isdec(c) || inrange(c, 'a', 'f') || inrange(c, 'A', 'F')) -#define getdec(c, fp) do { c = getc((fp)); if (GCcopy) putchar(c);} while (isdec(c)) -#define getoct(c, fp) do { c = getc((fp)); if (GCcopy) putchar(c);} while (isoct(c)) -#define gethex(c, fp) do { c = getc((fp)); if (GCcopy) putchar(c);} while (ishex(c)) - -void DoNum(register FILE *fp, int c) +#define getdec(c, fp) \ + do \ + { \ + c = getc((fp)); \ + if (GCcopy) \ + putchar(c); \ + } while (isdec(c)) +#define getoct(c, fp) \ + do \ + { \ + c = getc((fp)); \ + if (GCcopy) \ + putchar(c); \ + } while (isoct(c)) +#define gethex(c, fp) \ + do \ + { \ + c = getc((fp)); \ + if (GCcopy) \ + putchar(c); \ + } while (ishex(c)) + +void DoNum(FILE* fp, int c) { - if (c != '0') { + if (c != '0') + { getdec(c, fp); if (c == '.') getdec(c, fp); - if (c == 'e') { + if (c == 'e') + { c = getc(fp); if (c == '+' || c == '-') c = getc(fp); @@ -246,13 +392,14 @@ void DoNum(register FILE *fp, int c) getdec(c, fp); } } - else { + else + { c = getc(fp); - if (GCcopy) putchar(c); + if (GCcopy) + putchar(c); if (c == 'x' || c == 'X') gethex(c, fp); - else - if (isoct(c)) + else if (isoct(c)) getoct(c, fp); } } diff --git a/util/cmisc/cclash.c b/util/cmisc/cclash.c index 9221c1df9a..804a647eab 100644 --- a/util/cmisc/cclash.c +++ b/util/cmisc/cclash.c @@ -4,173 +4,150 @@ * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* - cclash: find clashing names within C programs - - Flags: - -c : produce oldname=newname line for each clashing id - (useful input for cid) - -l : check identifiers of or more characters - (default = 8) - -m : output a #define for each clashing id - - Author: Erik Baalbergen - Date: Nov 8, 1985 - - Revised: Dec 10, 1985 - C keywords are not listed - Revised: Aug 27, 1986 - Skip C numeric constants - Revised: Wed Jul 23 13:27:16 MDT 1986 - by Ceriel Jacobs, - replaced "stoi" by "atoi" - Revised: Tue Nov 11 13:32:31 MET 1986 - by Ceriel Jacobs, - to produce lists for "cid" or preprocessor in - alphabetical order. + cclash: find clashing names within C programs + + Flags: + -c : produce oldname=newname line for each clashing id + (useful input for cid) + -l : check identifiers of or more characters + (default = 8) + -m : output a #define for each clashing id + + Author: Erik Baalbergen + Date: Nov 8, 1985 + + Revised: Dec 10, 1985 + C keywords are not listed + Revised: Aug 27, 1986 + Skip C numeric constants + Revised: Wed Jul 23 13:27:16 MDT 1986 + by Ceriel Jacobs, + replaced "stoi" by "atoi" + Revised: Tue Nov 11 13:32:31 MET 1986 + by Ceriel Jacobs, + to produce lists for "cid" or preprocessor in + alphabetical order. */ #include #include #include -#define DEF_LENGTH 8 +#define DEF_LENGTH 8 -struct idf { - struct idf *id_next; - char *id_name; - struct idf *id_same; +struct idf +{ + struct idf* id_next; + char* id_name; + struct idf* id_same; char id_key; }; -#define ACT_LISTONLY 0 -#define ACT_MAPFILE 1 -#define ACT_CID 2 +#define ACT_LISTONLY 0 +#define ACT_MAPFILE 1 +#define ACT_CID 2 int maxlen = DEF_LENGTH; int action = ACT_LISTONLY; -extern char *ProgName; - -char * keywords[] = { - "asm", - "auto", - "break", - "case", - "char", - "continue", - "default", - "do", - "double", - "else", - "entry", - "extern", - "float", - "for", - "fortran", - "goto", - "if", - "int", - "long", - "register", - "return", - "short", - "sizeof", - "static", - "struct", - "switch", - "typedef", - "union", - "unsigned", - "while", - 0 -}; +extern char* ProgName; +char* keywords[] + = { "asm", "auto", "break", "case", "char", "continue", "default", "do", + "double", "else", "entry", "extern", "float", "for", "fortran", "goto", + "if", "int", "long", "register", "return", "short", "sizeof", "static", + "struct", "switch", "typedef", "union", "unsigned", "while", 0 }; -void InsertId(char *,int); -char *Malloc(unsigned int); -char *Salloc(char *); +void InsertId(char*, int); +char* Malloc(unsigned int); +char* Salloc(char*); int EnHash(char*); void EndOfProgram(void); void DoOption(char*); -void CheckId(char *, int); -void saveline(register struct idf *); -void mapline(char *); - - +void CheckId(char*, int); +void saveline(struct idf*); +void mapline(char*); -struct idf *maplist = 0; +struct idf* maplist = 0; void DefineKeys(void) { - register char **pkey = &keywords[0]; - register char *id; + char** pkey = &keywords[0]; + char* id; while ((id = *pkey++)) if (strlen(id) >= maxlen) InsertId(id, 1); } -void DoOption(char *str) +void DoOption(char* str) { - switch (str[1]) { + switch (str[1]) + { + + case 'c': + action = ACT_CID; + break; + + case 'l': + if ((maxlen = atoi(&str[2])) <= 0) + { + fprintf(stderr, "%s: option \"-l%s\" ignored\n", ProgName, &str[2]); + maxlen = DEF_LENGTH; + } + break; - case 'c': - action = ACT_CID; - break; + case 'm': + action = ACT_MAPFILE; + break; - case 'l': - if ((maxlen = atoi(&str[2])) <= 0) { - fprintf(stderr, "%s: option \"-l%s\" ignored\n", - ProgName, &str[2]); - maxlen = DEF_LENGTH; - } - break; - - case 'm': - action = ACT_MAPFILE; - break; - - default: - fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); - break; + default: + fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); + break; } } #define HASHSIZE 257 -struct idf *hash_tab[HASHSIZE]; +struct idf* hash_tab[HASHSIZE]; char *Malloc(), *Salloc(); -void InsertId(char *id, int key) +void InsertId(char* id, int key) { int hash_val = EnHash(id); - register struct idf *idp = hash_tab[hash_val]; - register struct idf *p = 0; + struct idf* idp = hash_tab[hash_val]; + struct idf* p = 0; - while (idp && strncmp(idp->id_name, id, maxlen)) { + while (idp && strncmp(idp->id_name, id, maxlen)) + { p = idp; idp = idp->id_next; } - if (idp == 0) { - idp = (struct idf *) Malloc(sizeof(struct idf)); + if (idp == 0) + { + idp = (struct idf*)Malloc(sizeof(struct idf)); idp->id_next = 0; - if (!p) hash_tab[hash_val] = idp; - else p->id_next = idp; + if (!p) + hash_tab[hash_val] = idp; + else + p->id_next = idp; idp->id_name = Salloc(id); idp->id_same = 0; } p = idp; - while (p && strcmp(p->id_name, id)) { + while (p && strcmp(p->id_name, id)) + { idp = p; p = p->id_same; } - if (p == 0) { - p = (struct idf *) Malloc(sizeof(struct idf)); + if (p == 0) + { + p = (struct idf*)Malloc(sizeof(struct idf)); p->id_next = 0; p->id_same = 0; p->id_name = Salloc(id); @@ -180,18 +157,19 @@ void InsertId(char *id, int key) p->id_key = key; } -char *Malloc(unsigned n) +char* Malloc(unsigned n) { - char *mem; + char* mem; - if ((mem = malloc(n)) == 0) { + if ((mem = malloc(n)) == 0) + { fprintf(stderr, "%s: out of memory\n", ProgName); exit(1); } return mem; } -char *Salloc(char *str) +char* Salloc(char* str) { if (str == 0) str = ""; @@ -199,108 +177,120 @@ char *Salloc(char *str) return strcpy(Malloc((unsigned)strlen(str) + 1), str); } -int EnHash(char *id) +int EnHash(char* id) { - register unsigned hash_val = 0; - register int n = maxlen; + unsigned hash_val = 0; + int n = maxlen; while (n-- && *id) hash_val = 31 * hash_val + *id++; - return hash_val % (unsigned) HASHSIZE; + return hash_val % (unsigned)HASHSIZE; } -void BeginOfProgram(void) { DefineKeys(); } +void BeginOfProgram(void) +{ + DefineKeys(); +} void EndOfProgram(void) { - register int i; - register struct idf *idp, *p; + int i; + struct idf *idp, *p; - for (i = 0; i < HASHSIZE; i++) { - for (idp = hash_tab[i]; idp; idp = idp->id_next) { + for (i = 0; i < HASHSIZE; i++) + { + for (idp = hash_tab[i]; idp; idp = idp->id_next) + { if (idp->id_same == 0) continue; - switch (action) { - register int n; - - case ACT_LISTONLY: - n = 0; - if (idp->id_key == 0) { - printf("%s",idp->id_name); - n++; - } - for (p = idp->id_same; p; p = p->id_same) - if (p->id_key == 0) { - printf("%s%s", - n ? " " : "", - p->id_name - ); + switch (action) + { + int n; + + case ACT_LISTONLY: + n = 0; + if (idp->id_key == 0) + { + printf("%s", idp->id_name); n++; } - if (n) - printf("\n"); - break; - - case ACT_CID: - case ACT_MAPFILE: - for (p = idp->id_same; p;) { - register struct idf *q = p->id_same; - - if (p->id_key == 0) - saveline(p); - p = q; - } - if (idp->id_key == 0) - saveline(idp); - break; + for (p = idp->id_same; p; p = p->id_same) + if (p->id_key == 0) + { + printf("%s%s", n ? " " : "", p->id_name); + n++; + } + if (n) + printf("\n"); + break; + + case ACT_CID: + case ACT_MAPFILE: + for (p = idp->id_same; p;) + { + struct idf* q = p->id_same; + + if (p->id_key == 0) + saveline(p); + p = q; + } + if (idp->id_key == 0) + saveline(idp); + break; } } } - switch(action) { - case ACT_CID: - case ACT_MAPFILE: - for (idp = maplist; idp; idp = idp->id_same) { - mapline(idp->id_name); - } + switch (action) + { + case ACT_CID: + case ACT_MAPFILE: + for (idp = maplist; idp; idp = idp->id_same) + { + mapline(idp->id_name); + } } } -void saveline(register struct idf *p) +void saveline(struct idf* p) { - register struct idf *idp = maplist, *idp1 = 0; + struct idf *idp = maplist, *idp1 = 0; - while (idp && strcmp(idp->id_name, p->id_name) < 0) { + while (idp && strcmp(idp->id_name, p->id_name) < 0) + { idp1 = idp; idp = idp->id_same; } p->id_same = idp; - if (idp1 == 0) { + if (idp1 == 0) + { maplist = p; } - else { + else + { idp1->id_same = p; } } -void mapline(char *nm) +void mapline(char* nm) { static int map_count = 0; - switch (action) { + switch (action) + { + + case ACT_MAPFILE: + printf("#define %s _%d_%s\n", nm, ++map_count, nm); + break; - case ACT_MAPFILE: - printf("#define %s _%d_%s\n", nm, ++map_count, nm); - break; - - case ACT_CID: - printf("%s=_%d_%s\n", nm, ++map_count, nm); - break; + case ACT_CID: + printf("%s=_%d_%s\n", nm, ++map_count, nm); + break; } } -void CheckId(char *id, int s) +void CheckId(char* id, int s) { if (s >= maxlen) InsertId(id, 0); diff --git a/util/cmisc/cid.c b/util/cmisc/cid.c index 96e20df093..57a365ea7a 100644 --- a/util/cmisc/cid.c +++ b/util/cmisc/cid.c @@ -4,13 +4,13 @@ * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* Change IDentifiers occurring in C programs outside comment, strings - and character constants. - -Dname=text : replace all occerences of name by text - -Dname : same as -Dname= - -Ffile : read sentences of the from name=text from file + and character constants. + -Dname=text : replace all occerences of name by text + -Dname : same as -Dname= + -Ffile : read sentences of the from name=text from file - Author: Erik Baalbergen - Date: Oct 23, 1985 + Author: Erik Baalbergen + Date: Oct 23, 1985 */ #include @@ -18,129 +18,140 @@ #include #ifndef DEF_LENGTH -#define DEF_LENGTH 8 +#define DEF_LENGTH 8 #endif -#define LINE_LEN 1024 +#define LINE_LEN 1024 #define HASHSIZE 257 -struct idf { - struct idf *id_next; - char *id_name; - char *id_text; +struct idf +{ + struct idf* id_next; + char* id_name; + char* id_text; }; -struct idf *hash_tab[HASHSIZE]; +struct idf* hash_tab[HASHSIZE]; -char *Malloc(unsigned int); -char *Salloc(char *); +char* Malloc(unsigned int); +char* Salloc(char*); int EnHash(char*); void EndOfProgram(void); void DoOption(char*); -void CheckId(char *, int); -void DoMacro(char *); -void GetMacros(char *); -void InsertMacro(char *, char *); -struct idf *FindId(char *); - - +void CheckId(char*, int); +void DoMacro(char*); +void GetMacros(char*); +void InsertMacro(char*, char*); +struct idf* FindId(char*); -extern char *ProgName; +extern char* ProgName; void DoOption(char* str) { - switch (str[1]) { - - case 'D': - DoMacro(&str[2]); - break; - - case 'F': - GetMacros(&str[2]); - break; - - default: - fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); - break; + switch (str[1]) + { + + case 'D': + DoMacro(&str[2]); + break; + + case 'F': + GetMacros(&str[2]); + break; + + default: + fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); + break; } } /*ARGSUSED*/ -void CheckId(char *id, int len) +void CheckId(char* id, int len) { - struct idf *idp = FindId(id); + struct idf* idp = FindId(id); - if (idp) { + if (idp) + { printf("%s", idp->id_text); } - else { + else + { printf("%s", id); } } -void DoMacro(char *str) +void DoMacro(char* str) { char *id, *text; id = str++; - while (*str != '\0' && *str != '=') { + while (*str != '\0' && *str != '=') + { str++; } - if (*str == '=') { + if (*str == '=') + { *str++ = '\0'; text = str; } - else { + else + { text = ""; } InsertMacro(id, text); } -void GetMacros(char *fn) +void GetMacros(char* fn) { - FILE *fp; - register int c; + FILE* fp; + int c; char buf[LINE_LEN]; - char *bufp = &buf[0]; + char* bufp = &buf[0]; - if ((fp = fopen(fn, "r")) == NULL) { + if ((fp = fopen(fn, "r")) == NULL) + { fprintf(stderr, "%s: cannot read file \"%s\"\n", ProgName, fn); return; } - while ((c = getc(fp)) != EOF) { - if (c == '\n' && bufp != &buf[0]) { + while ((c = getc(fp)) != EOF) + { + if (c == '\n' && bufp != &buf[0]) + { *bufp = '\0'; DoMacro(&buf[0]); bufp = &buf[0]; } - else { + else + { *bufp++ = c; } } fclose(fp); } -void InsertMacro(char *id, char *text) +void InsertMacro(char* id, char* text) { int hash_val = EnHash(id); - struct idf *idp = hash_tab[hash_val]; + struct idf* idp = hash_tab[hash_val]; - while (idp) { - if (strcmp(idp->id_name, id) == 0) { - fprintf(stderr, "%s: (warning) redefinition of %s\n", - ProgName, id); + while (idp) + { + if (strcmp(idp->id_name, id) == 0) + { + fprintf(stderr, "%s: (warning) redefinition of %s\n", ProgName, id); break; } idp = idp->id_next; } - if (idp == 0) { - idp = (struct idf *) Malloc(sizeof(struct idf)); + if (idp == 0) + { + idp = (struct idf*)Malloc(sizeof(struct idf)); } idp->id_next = hash_tab[hash_val]; @@ -149,32 +160,36 @@ void InsertMacro(char *id, char *text) hash_tab[hash_val] = idp; } -char *Malloc(unsigned int n) +char* Malloc(unsigned int n) { - char *mem; + char* mem; - if ((mem = malloc(n)) == 0) { + if ((mem = malloc(n)) == 0) + { fprintf(stderr, "%s: out of memory\n", ProgName); exit(1); } return mem; } -char *Salloc(char *str) +char* Salloc(char* str) { - if (str == 0) { + if (str == 0) + { str = ""; } return strcpy(Malloc((unsigned)strlen(str) + 1), str); } -struct idf *FindId(char *id) +struct idf* FindId(char* id) { - register int hash_val = EnHash(id); - register struct idf *idp = hash_tab[hash_val]; + int hash_val = EnHash(id); + struct idf* idp = hash_tab[hash_val]; - while (idp) { - if (strcmp(idp->id_name, id) == 0) { + while (idp) + { + if (strcmp(idp->id_name, id) == 0) + { return idp; } idp = idp->id_next; @@ -182,15 +197,16 @@ struct idf *FindId(char *id) return 0; } -int EnHash(char *id) +int EnHash(char* id) { - register unsigned hash_val = 0; + unsigned hash_val = 0; - while (*id) { + while (*id) + { hash_val = 31 * hash_val + *id++; } - return hash_val % (unsigned) HASHSIZE; + return hash_val % (unsigned)HASHSIZE; } extern int GCcopy; diff --git a/util/cmisc/mkdep.c b/util/cmisc/mkdep.c index 1e2749c076..4e193e6ac6 100644 --- a/util/cmisc/mkdep.c +++ b/util/cmisc/mkdep.c @@ -14,29 +14,29 @@ #include #define BSIZ 1024 -char *prog; +char* prog; int dflag = 0; /* suppress "file.c :" */ struct namelist { - struct namelist *next; - char *name; + struct namelist* next; + char* name; }; -struct namelist *freelist; -struct namelist *new_namelist(); -struct namelist *nl = 0; +struct namelist* freelist; +struct namelist* new_namelist(); +struct namelist* nl = 0; -char *Malloc(unsigned int); +char* Malloc(unsigned int); -char *include_line(char *); -int dofile(char *); +char* include_line(char*); +int dofile(char*); -char *Malloc(u) - unsigned u; +char* Malloc(u) +unsigned u; { - char *sp; + char* sp; if ((sp = malloc(u)) == 0) { @@ -46,10 +46,9 @@ char *Malloc(u) return sp; } -struct namelist * -new_namelist() +struct namelist* new_namelist() { - register struct namelist *nlp = freelist; + struct namelist* nlp = freelist; if (nlp) { @@ -57,10 +56,10 @@ new_namelist() return nlp; } - return (struct namelist *) Malloc(sizeof(struct namelist)); + return (struct namelist*)Malloc(sizeof(struct namelist)); } -void free_namelist(struct namelist *nlp) +void free_namelist(struct namelist* nlp) { if (nlp) { @@ -70,13 +69,13 @@ void free_namelist(struct namelist *nlp) } } -void add_name(char *nm) +void add_name(char* nm) { struct namelist *nlp = nl, *lnlp = 0, *nnlp; while (nlp) { - register int i = strcmp(nm, nlp->name); + int i = strcmp(nm, nlp->name); if (i < 0) break; if (i == 0) /* already present */ @@ -85,8 +84,7 @@ void add_name(char *nm) nlp = nlp->next; } - (nnlp = new_namelist())->name = strcpy(Malloc((unsigned) strlen(nm) + 1), - nm); + (nnlp = new_namelist())->name = strcpy(Malloc((unsigned)strlen(nm) + 1), nm); if (lnlp) { @@ -100,7 +98,7 @@ void add_name(char *nm) } } -void print_namelist(char *nm, struct namelist *nlp) +void print_namelist(char* nm, struct namelist* nlp) { while (nlp) { @@ -112,14 +110,14 @@ void print_namelist(char *nm, struct namelist *nlp) } /*ARGSUSED*/ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int err = 0; prog = *argv++; if (*argv && **argv == '-') { - char *opt = &(*argv++)[1]; + char* opt = &(*argv++)[1]; if (*opt++ != 'd' || *opt) { @@ -140,7 +138,7 @@ int main(int argc, char *argv[]) exit(err ? 1 : 0); } -int contains_slash(register char *s) +int contains_slash(char* s) { while (*s) if (*s++ == '/') @@ -148,11 +146,11 @@ int contains_slash(register char *s) return 0; } -int dofile(char *fn) +int dofile(char* fn) { char buf[BSIZ]; - FILE *fp; - char *nm; + FILE* fp; + char* nm; if ((fp = fopen(fn, "r")) == 0) { @@ -162,9 +160,7 @@ int dofile(char *fn) if (contains_slash(fn)) { - fprintf(stderr, - "%s: (warning) %s not in current directory; not checked\n", - prog, fn); + fprintf(stderr, "%s: (warning) %s not in current directory; not checked\n", prog, fn); fclose(fp); return 1; } @@ -181,7 +177,7 @@ int dofile(char *fn) return 1; } -char *include_line(char *s) +char* include_line(char* s) { while ((*s == '\t') || (*s == ' ')) s++; @@ -190,14 +186,14 @@ char *include_line(char *s) { while ((*s == '\t') || (*s == ' ')) s++; - if ((*s++ == 'i') && (*s++ == 'n') && (*s++ == 'c') && (*s++ == 'l') - && (*s++ == 'u') && (*s++ == 'd') && (*s++ == 'e')) + if ((*s++ == 'i') && (*s++ == 'n') && (*s++ == 'c') && (*s++ == 'l') && (*s++ == 'u') + && (*s++ == 'd') && (*s++ == 'e')) { while ((*s == '\t') || (*s == ' ')) s++; if (*s++ == '"') { - char *nm = s; + char* nm = s; while (*s != 0 && *s != '"') s++; @@ -206,5 +202,5 @@ char *include_line(char *s) } } } - return (char *) 0; + return (char*)0; } diff --git a/util/cmisc/objectify.c b/util/cmisc/objectify.c index b8683f1dcb..16b2495174 100644 --- a/util/cmisc/objectify.c +++ b/util/cmisc/objectify.c @@ -30,4 +30,3 @@ int main(int argc, const char* argv[]) return 0; } - diff --git a/util/cmisc/prid.c b/util/cmisc/prid.c index 66aabd5849..0045d63d21 100644 --- a/util/cmisc/prid.c +++ b/util/cmisc/prid.c @@ -4,107 +4,113 @@ * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* Print IDentifiers occurring in C programs outside comment, strings - and character constants. - Flags: - -l : print identifiers of or more characters - (default = 8) + and character constants. + Flags: + -l : print identifiers of or more characters + (default = 8) - Author: Erik Baalbergen - Date: Oct 23, 1985 + Author: Erik Baalbergen + Date: Oct 23, 1985 */ #include #include #include -extern char *ProgName; +extern char* ProgName; #ifndef DEF_LENGTH -#define DEF_LENGTH 8 +#define DEF_LENGTH 8 #endif int maxlen = DEF_LENGTH; - -void InsertId(char *); -char *Malloc(unsigned int); -char *Salloc(char *); +void InsertId(char*); +char* Malloc(unsigned int); +char* Salloc(char*); int EnHash(char*); void EndOfProgram(void); void DoOption(char*); -void CheckId(char *, int); - - +void CheckId(char*, int); - -void BeginOfProgram(void) {} +void BeginOfProgram(void) +{ +} void DoOption(char* str) { - switch (str[1]) { - - case 'l': - if ((maxlen = atoi(&str[2])) <= 0) { - fprintf(stderr, "%s: option \"-l%s\" ignored\n", - ProgName, &str[2]); - maxlen = DEF_LENGTH; - } - break; - - default: - fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); - break; + switch (str[1]) + { + + case 'l': + if ((maxlen = atoi(&str[2])) <= 0) + { + fprintf(stderr, "%s: option \"-l%s\" ignored\n", ProgName, &str[2]); + maxlen = DEF_LENGTH; + } + break; + + default: + fprintf(stderr, "%s: bad option \"%s\"\n", ProgName, str); + break; } } -void CheckId(char *id, int len) +void CheckId(char* id, int len) { - if (len >= maxlen) { + if (len >= maxlen) + { InsertId(id); } } #define HASHSIZE 257 -struct idf { - char *id_name; - struct idf *id_next; +struct idf +{ + char* id_name; + struct idf* id_next; }; -struct idf *hash_tab[HASHSIZE]; +struct idf* hash_tab[HASHSIZE]; -void InsertId(char *id) +void InsertId(char* id) { int hash_val = EnHash(id); - register struct idf *idp = hash_tab[hash_val]; - register struct idf *p = 0; + struct idf* idp = hash_tab[hash_val]; + struct idf* p = 0; - while (idp && strcmp(idp->id_name, id)) { + while (idp && strcmp(idp->id_name, id)) + { p = idp; idp = idp->id_next; } - if (idp == 0) { - idp = (struct idf *) Malloc(sizeof(struct idf)); + if (idp == 0) + { + idp = (struct idf*)Malloc(sizeof(struct idf)); idp->id_next = 0; - if (!p) hash_tab[hash_val] = idp; - else p->id_next = idp; + if (!p) + hash_tab[hash_val] = idp; + else + p->id_next = idp; idp->id_name = Salloc(id); } } -char *Malloc(unsigned int n) +char* Malloc(unsigned int n) { - char *mem; + char* mem; - if ((mem = malloc(n)) == 0) { + if ((mem = malloc(n)) == 0) + { fprintf(stderr, "%s: out of memory\n", ProgName); exit(1); } return mem; } -char *Salloc(char *str) +char* Salloc(char* str) { if (str == 0) @@ -113,24 +119,26 @@ char *Salloc(char *str) return strcpy(Malloc((unsigned)strlen(str) + 1), str); } -int EnHash(char *id) +int EnHash(char* id) { - register unsigned hash_val = 0; - register int n = maxlen; + unsigned hash_val = 0; + int n = maxlen; while (n-- && *id) hash_val = 31 * hash_val + *id++; - return hash_val % (unsigned) HASHSIZE; + return hash_val % (unsigned)HASHSIZE; } void EndOfProgram(void) { - register struct idf *idp; - register int i; + struct idf* idp; + int i; - for (i = 0; i < HASHSIZE; i++) { - for (idp = hash_tab[i]; idp; idp = idp->id_next) { + for (i = 0; i < HASHSIZE; i++) + { + for (idp = hash_tab[i]; idp; idp = idp->id_next) + { printf("%s\n", idp->id_name); } } diff --git a/util/cmisc/tabgen.c b/util/cmisc/tabgen.c index 6497d8650b..1cd4e8268d 100644 --- a/util/cmisc/tabgen.c +++ b/util/cmisc/tabgen.c @@ -3,10 +3,10 @@ * See the copyright notice in the ACK home directory, in the file "Copyright". */ /* - chtabgen - character table generator + chtabgen - character table generator - Author: Erik Baalbergen (..tjalk!erikb) - Many mods by Ceriel Jacobs + Author: Erik Baalbergen (..tjalk!erikb) + Many mods by Ceriel Jacobs */ #include @@ -79,7 +79,7 @@ char* Salloc(char* s) void option(char* str) { /* note that *str indicates the source of the option: - either COMCOM (from command line) or FILECOM (from a file). + either COMCOM (from command line) or FILECOM (from a file). */ switch (*++str) { @@ -125,8 +125,7 @@ void option(char* str) if (i <= 0 || i > MAXTAB) { - fprintf(stderr, "%s: size would exceed maximum\n", - ProgCall); + fprintf(stderr, "%s: size would exceed maximum\n", ProgCall); } else { @@ -203,7 +202,7 @@ int process(char* str, int format) char* Name = cstr; /* overwrite original string! */ /* strip of the entry name - */ + */ while (*str && *str != ':') { if (*str == '\\') @@ -215,8 +214,7 @@ int process(char* str, int format) if (*str != ':') { - fprintf(stderr, "%s: bad specification: \"%s\", ignored\n", - ProgCall, Name); + fprintf(stderr, "%s: bad specification: \"%s\", ignored\n", ProgCall, Name); return 0; } *cstr = '\0'; diff --git a/util/ego/bo/bo.c b/util/ego/bo/bo.c index 80d9a838e4..f67b9fa975 100644 --- a/util/ego/bo/bo.c +++ b/util/ego/bo/bo.c @@ -34,7 +34,7 @@ extern char em_flag[]; #define newbolpx() (lpext_p) newstruct(lpext_ra) #define oldbolpx(x) oldstruct(lpext_ra, x) -STATIC int Sbo; /* #optimizations found */ +static int Sbo; /* #optimizations found */ #define DLINK(l1, l2) \ l1->l_next = l2; \ @@ -61,11 +61,11 @@ STATIC int Sbo; /* #optimizations found */ * are done by this optimization. */ -STATIC line_p last_code(line_p lines, bool skip_pseu) +static line_p last_code(line_p lines, bool skip_pseu) { /* Determine the last line of a list */ - register line_p l; + line_p l; for (l = lines; l->l_next != (line_p)0; l = l->l_next) ; @@ -77,12 +77,12 @@ STATIC line_p last_code(line_p lines, bool skip_pseu) return l; } -STATIC short cc_tab[12] = { op_blt, op_zlt, op_ble, op_zle, op_beq, op_zeq, +static short cc_tab[12] = { op_blt, op_zlt, op_ble, op_zle, op_beq, op_zeq, op_zne, op_bne, op_zgt, op_bgt, op_zge, op_bge }; -STATIC short rev_cond(short cond) +static short rev_cond(short cond) { - register int i; + int i; for (i = 0; i < 12; i++) { @@ -92,12 +92,12 @@ STATIC short rev_cond(short cond) return op_nop; } -STATIC bool is_bcc(line_p l) +static bool is_bcc(line_p l) { return rev_cond(INSTR(l)) != op_nop; } -STATIC void bo_optloop(proc_p p, bblock_p b, bblock_p x, line_p bra, line_p bcc) +static void bo_optloop(proc_p p, bblock_p b, bblock_p x, line_p bra, line_p bcc) { bblock_p prevb, n; line_p l; @@ -156,7 +156,7 @@ STATIC void bo_optloop(proc_p p, bblock_p b, bblock_p x, line_p bra, line_p bcc) b->b_next = x; } -STATIC void bo_tryloop(proc_p p, lset loop) +static void bo_tryloop(proc_p p, lset loop) { Lindex i, j; bblock_p b, x; @@ -183,7 +183,7 @@ STATIC void bo_tryloop(proc_p p, lset loop) } } -STATIC void bo_loops(proc_p p) +static void bo_loops(proc_p p) { Lindex i; loop_p lp; @@ -195,7 +195,7 @@ STATIC void bo_loops(proc_p p) } } -STATIC void mv_code(bblock_p b1, bblock_p b2) +static void mv_code(bblock_p b1, bblock_p b2) { line_p l, x; @@ -210,7 +210,7 @@ STATIC void mv_code(bblock_p b1, bblock_p b2) } } -STATIC void bo_switch(bblock_p b) +static void bo_switch(bblock_p b) { bblock_p s, x; Lindex i; @@ -260,12 +260,12 @@ STATIC void bo_switch(bblock_p b) } } -STATIC void bo_extproc(proc_p p) +static void bo_extproc(proc_p p) { /* Allocate the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; + loop_p lp; + Lindex pi; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { @@ -274,12 +274,12 @@ STATIC void bo_extproc(proc_p p) } } -STATIC void loop_blocks(proc_p p) +static void loop_blocks(proc_p p) { /* Compute the LP_BLOCKS sets for all loops of p */ - register bblock_p b; - register Lindex i; + bblock_p b; + Lindex i; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -290,13 +290,13 @@ STATIC void loop_blocks(proc_p p) } } -STATIC void bo_cleanproc(proc_p p) +static void bo_cleanproc(proc_p p) { /* Allocate the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; - register bblock_p b; + loop_p lp; + Lindex pi; + bblock_p b; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { diff --git a/util/ego/ca/ca.c b/util/ego/ca/ca.c index 22bd656ed5..d3d4bab2b5 100644 --- a/util/ego/ca/ca.c +++ b/util/ego/ca/ca.c @@ -38,7 +38,7 @@ char **dnames, **pnames; /* Dynamically allocated arrays of strings. * of the procedure with proc_id i. */ -STATIC line_p get_ca_lines(FILE* lf, proc_p* p_out) +static line_p get_ca_lines(FILE* lf, proc_p* p_out) { /* Read lines of EM text and link them. * Register messages are outputted immediately after the PRO. @@ -108,7 +108,7 @@ STATIC line_p get_ca_lines(FILE* lf, proc_p* p_out) return head; } -STATIC int makedmap(dblock_p dbl) +static int makedmap(dblock_p dbl) { /* construct the dmap table */ @@ -129,7 +129,7 @@ STATIC int makedmap(dblock_p dbl) return cnt; } -STATIC void getdnames(FILE* dumpd) +static void getdnames(FILE* dumpd) { /* Read the names of the datalabels from * the dump file. @@ -149,7 +149,7 @@ STATIC void getdnames(FILE* dumpd) } } -STATIC void getpnames(FILE* dumpp) +static void getpnames(FILE* dumpp) { /* Read the names of the procedures from * the dump file. @@ -169,7 +169,7 @@ STATIC void getpnames(FILE* dumpp) } } -STATIC void new_name(char** s) +static void new_name(char** s) { static int nn = 0; char buf[20]; @@ -185,7 +185,7 @@ STATIC void new_name(char** s) strcpy(*s, buf); } -STATIC void uniq_names(void) +static void uniq_names(void) { /* The names of all internal procedures and data blocks * are made different. As the optimizer combines several diff --git a/util/ego/ca/ca_put.c b/util/ego/ca/ca_put.c index d3ef7cbac0..e7457809a2 100644 --- a/util/ego/ca/ca_put.c +++ b/util/ego/ca/ca_put.c @@ -21,22 +21,22 @@ FILE* outfile; -STATIC proc_p thispro; +static proc_p thispro; -STATIC void outinst(int m) +static void outinst(int m) { outbyte((byte)m); } -STATIC void coutshort(short i) +static void coutshort(short i) { outbyte((byte)(i & BMASK)); outbyte((byte)(i >> 8)); } -STATIC void coutint(short i) +static void coutint(short i) { if (i >= -sp_zcst0 && i < sp_ncst0 - sp_zcst0) @@ -48,7 +48,7 @@ STATIC void coutint(short i) } } -STATIC void coutoff(offset off) +static void coutoff(offset off) { if ((short)off == off) @@ -61,10 +61,10 @@ STATIC void coutoff(offset off) } } -STATIC void outsym(const char* s, int t) +static void outsym(const char* s, int t) { - register byte* p; - register unsigned num; + byte* p; + unsigned num; if (s[0] == '.') { @@ -94,18 +94,18 @@ STATIC void outsym(const char* s, int t) } } -STATIC void outdsym(dblock_p dbl) +static void outdsym(dblock_p dbl) { if (dnames[dbl->d_id]) outsym(dnames[dbl->d_id], sp_dnam); } -STATIC void outpsym(proc_p p) +static void outpsym(proc_p p) { outsym(pnames[p->p_id], sp_pnam); } -STATIC void outddef(short id) +static void outddef(short id) { dblock_p dbl; @@ -119,7 +119,7 @@ STATIC void outddef(short id) } } -STATIC void outpdef(proc_p p) +static void outpdef(proc_p p) { p->p_flags2 |= PF_SYMOUT; if (p->p_flags1 & PF_EXTERNAL) @@ -129,7 +129,7 @@ STATIC void outpdef(proc_p p) } } -STATIC void outdocc(obj_p obj) +static void outdocc(obj_p obj) { dblock_p dbl; @@ -145,7 +145,7 @@ STATIC void outdocc(obj_p obj) } } -STATIC void outpocc(proc_p p) +static void outpocc(proc_p p) { if ((p->p_flags2 & PF_SYMOUT) == 0) { @@ -158,7 +158,7 @@ STATIC void outpocc(proc_p p) } } -STATIC void coutobject(obj_p obj) +static void coutobject(obj_p obj) { /* In general, an object is defined by a global data * label and an offset. There are two special cases: @@ -185,10 +185,10 @@ STATIC void coutobject(obj_p obj) } } -STATIC void cputstr(argb_p abp) +static void cputstr(argb_p abp) { - register argb_p tbp; - register int length; + argb_p tbp; + int length; length = 0; tbp = abp; @@ -206,7 +206,7 @@ STATIC void cputstr(argb_p abp) } } -STATIC void outnum(int n) +static void outnum(int n) { if (n < 256) { @@ -220,7 +220,7 @@ STATIC void outnum(int n) } } -STATIC void numlab(int n) +static void numlab(int n) { if (n < sp_nilb0) { @@ -232,9 +232,9 @@ STATIC void numlab(int n) } } -STATIC void cputargs(line_p lnp) +static void cputargs(line_p lnp) { - register arg_p ap; + arg_p ap; int cnt = 0; ap = ARG(lnp); while (ap != (arg_p)0) @@ -283,7 +283,7 @@ STATIC void cputargs(line_p lnp) } } -STATIC void outoperand(line_p lnp) +static void outoperand(line_p lnp) { /* Output the operand of instruction lnp */ @@ -348,7 +348,7 @@ STATIC void outoperand(line_p lnp) } } -STATIC void outvisibility(line_p lnp) +static void outvisibility(line_p lnp) { /* In EM names of datalabels and procedures can be made * externally visible, so they can be used in other files. diff --git a/util/ego/cf/cf.c b/util/ego/cf/cf.c index deb4890450..86aa8161f0 100644 --- a/util/ego/cf/cf.c +++ b/util/ego/cf/cf.c @@ -37,8 +37,8 @@ extern char em_flag[]; -STATIC cset lpi_set; /* set of procedures used in LPI instruction */ -STATIC cset cai_set; /* set of all procedures doing a CAI */ +static cset lpi_set; /* set of procedures used in LPI instruction */ +static cset cai_set; /* set of all procedures doing a CAI */ /* The procedure getbblocks reads the EM textfile and * partitions every procedure into a number of basic blocks. @@ -54,15 +54,15 @@ STATIC cset cai_set; /* set of all procedures doing a CAI */ /* These global variables are used by getbblocks and nextblock. */ -STATIC bblock_p b, *bp; /* b is the current basic block, bp is +static bblock_p b, *bp; /* b is the current basic block, bp is * the address where the next block has * to be linked. */ -STATIC line_p lnp, *lp; /* lnp is the current line, lp is +static line_p lnp, *lp; /* lnp is the current line, lp is * the address where the next line * has to be linked. */ -STATIC short state; /* We use a finite state machine with the +static short state; /* We use a finite state machine with the * following states: * LABEL0: after the first (successive) * instruction label. @@ -76,7 +76,7 @@ STATIC short state; /* We use a finite state machine with the * INIT: initial state */ -STATIC void nextblock(void) +static void nextblock(void) { /* allocate a new basic block structure and * set b, bp and lp. @@ -96,7 +96,7 @@ STATIC void nextblock(void) #endif } -STATIC short kind(line_p lnp) +static short kind(line_p lnp) { /* determine if lnp is a label, branch, end or otherwise */ @@ -114,15 +114,15 @@ STATIC short kind(line_p lnp) return (short)NORMAL; } -STATIC line_p doread_line(proc_p* p_out) +static line_p doread_line(proc_p* p_out) { /* read a line, and check pseudos for procedure addresses */ - register line_p lnp = read_line(p_out); + line_p lnp = read_line(p_out); if (lnp && TYPE(lnp) == OPLIST && INSTR(lnp) != ps_mes) { - register arg_p arg = ARG(lnp); + arg_p arg = ARG(lnp); while (arg) { @@ -137,7 +137,7 @@ STATIC line_p doread_line(proc_p* p_out) return lnp; } -STATIC bool getbblocks(FILE* fp, short* kind_out, short* n_out, bblock_p* g_out, line_p* l_out) +static bool getbblocks(FILE* fp, short* kind_out, short* n_out, bblock_p* g_out, line_p* l_out) { bblock_p head = (bblock_p)0; line_p headl = (line_p)0; @@ -246,7 +246,7 @@ STATIC bool getbblocks(FILE* fp, short* kind_out, short* n_out, bblock_p* g_out, } } -STATIC void interproc_analysis(proc_p p) +static void interproc_analysis(proc_p p) { /* Interprocedural analysis of a procedure p determines: * - all procedures called by p (the 'call graph') @@ -355,12 +355,12 @@ STATIC void interproc_analysis(proc_p p) } } -STATIC void cf_cleanproc(proc_p p) +static void cf_cleanproc(proc_p p) { /* Remove the extended data structures of p */ - register bblock_p b; - register Lindex pi; + bblock_p b; + Lindex pi; loop_p lp; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) @@ -379,7 +379,7 @@ STATIC void cf_cleanproc(proc_p p) #define CALLS_UNKNOWN(p) (p->p_flags1 & (byte)PF_CALUNKNOWN) #define ENVIRON(p) (p->p_flags1 & (byte)PF_ENVIRON) -STATIC bool add_info(proc_p q, proc_p p) +static bool add_info(proc_p q, proc_p p) { /* Determine the consequences for used/changed variables info * of the fact that p calls q. If e.g. q changes a variable X @@ -466,13 +466,13 @@ STATIC bool add_info(proc_p q, proc_p p) return diff; } -STATIC void trans_clos(proc_p head) +static void trans_clos(proc_p head) { /* Compute the transitive closure of the used/changed * variable information. */ - register proc_p p, q; + proc_p p, q; Cindex i; bool changes = TRUE; @@ -495,7 +495,7 @@ STATIC void trans_clos(proc_p head) } } -STATIC void indir_calls(void) +static void indir_calls(void) { Cindex i; proc_p p; diff --git a/util/ego/cf/cf_idom.c b/util/ego/cf/cf_idom.c index a9d6a95a94..b76487cf0f 100644 --- a/util/ego/cf/cf_idom.c +++ b/util/ego/cf/cf_idom.c @@ -30,7 +30,7 @@ short dfs_nr; bblock_p* vertex; /* dynamically allocated array */ -STATIC void dfs(bblock_p v) +static void dfs(bblock_p v) { /* Depth First Search */ @@ -51,7 +51,7 @@ STATIC void dfs(bblock_p v) } } -STATIC void compress(bblock_p v) +static void compress(bblock_p v) { if (v->B_ANCESTOR->B_ANCESTOR != (bblock_p)0) { @@ -64,7 +64,7 @@ STATIC void compress(bblock_p v) } } -STATIC bblock_p eval(bblock_p v) +static bblock_p eval(bblock_p v) { if (v->B_ANCESTOR == (bblock_p)0) { @@ -77,7 +77,7 @@ STATIC bblock_p eval(bblock_p v) } } -STATIC void linkblocks(bblock_p v, bblock_p w) +static void linkblocks(bblock_p v, bblock_p w) { w->B_ANCESTOR = v; } @@ -88,7 +88,7 @@ void dominators(bblock_p r, short n) * block in the control flow graph rooted by r. */ - register short i; + short i; Lindex ind, next; bblock_p v, w, u; diff --git a/util/ego/cf/cf_loop.c b/util/ego/cf/cf_loop.c index b0ccb67a88..992495f86f 100644 --- a/util/ego/cf/cf_loop.c +++ b/util/ego/cf/cf_loop.c @@ -41,7 +41,7 @@ * each other (without one being nested inside the other). */ -STATIC bool same_loop(loop_p l1, loop_p l2) +static bool same_loop(loop_p l1, loop_p l2) { /* Two loops are the same if: * (1) they have the same number of basic blocks, and @@ -56,7 +56,7 @@ STATIC bool same_loop(loop_p l1, loop_p l2) && Lis_elem(l1->lp_end, l2->LP_BLOCKS)); } -STATIC bool inner_loop(loop_p l1, loop_p l2) +static bool inner_loop(loop_p l1, loop_p l2) { /* Loop l1 is an inner loop of l2 if: * (1) the first loop has fewer basic blocks than @@ -72,7 +72,7 @@ STATIC bool inner_loop(loop_p l1, loop_p l2) && Lis_elem(l1->lp_end, l2->LP_BLOCKS)); } -STATIC void insrt(bblock_p b, lset* lpb, lset* s_p) +static void insrt(bblock_p b, lset* lpb, lset* s_p) { /* Auxiliary routine used by 'natural_loop'. * Note that we use a set rather than a stack, @@ -86,7 +86,7 @@ STATIC void insrt(bblock_p b, lset* lpb, lset* s_p) } } -STATIC loop_p natural_loop(bblock_p d, bblock_p n) +static loop_p natural_loop(bblock_p d, bblock_p n) { /* Find the basic blocks of the natural loop of the * back edge 'n->d' (i.e. n->d is an edge in the control @@ -124,13 +124,13 @@ STATIC loop_p natural_loop(bblock_p d, bblock_p n) return lp; } -STATIC loop_p org_loop(loop_p lp, lset loops) +static loop_p org_loop(loop_p lp, lset loops) { /* See if the loop lp was already found via another * back edge; if so return this loop; else return 0. */ - register Lindex li; + Lindex li; for (li = Lfirst(loops); li != (Lindex)0; li = Lnext(li, loops)) { @@ -145,10 +145,10 @@ STATIC loop_p org_loop(loop_p lp, lset loops) return (loop_p)0; } -STATIC void collapse_loops(lset* loops_p) +static void collapse_loops(lset* loops_p) { - register Lindex li1, li2; - register loop_p lp1, lp2; + Lindex li1, li2; + loop_p lp1, lp2; for (li1 = Lfirst(*loops_p); li1 != (Lindex)0; li1 = Lnext(li1, *loops_p)) { @@ -171,13 +171,13 @@ STATIC void collapse_loops(lset* loops_p) } } -STATIC void loop_per_block(loop_p lp) +static void loop_per_block(loop_p lp) { bblock_p b; /* Update the b_loops sets */ - register Lindex bi; + Lindex bi; for (bi = Lfirst(lp->LP_BLOCKS); bi != (Lindex)0; bi = Lnext(bi, lp->LP_BLOCKS)) { @@ -186,12 +186,12 @@ STATIC void loop_per_block(loop_p lp) } } -STATIC void loop_attrib(lset loops) +static void loop_attrib(lset loops) { /* Compute several attributes */ - register Lindex li; - register loop_p lp; + Lindex li; + loop_p lp; loop_id lastlpid = 0; for (li = Lfirst(loops); li != (Lindex)0; li = Lnext(li, loops)) @@ -202,7 +202,7 @@ STATIC void loop_attrib(lset loops) } } -STATIC void nest_levels(lset loops) +static void nest_levels(lset loops) { /* Compute the nesting levels of all loops of * the current procedure. For every loop we just count @@ -212,8 +212,8 @@ STATIC void nest_levels(lset loops) * very small, there is no cause for alarm. */ - register Lindex li1, li2; - register loop_p lp; + Lindex li1, li2; + loop_p lp; for (li1 = Lfirst(loops); li1 != (Lindex)0; li1 = Lnext(li1, loops)) { @@ -229,11 +229,11 @@ STATIC void nest_levels(lset loops) } } -STATIC void cleanup(lset loops) +static void cleanup(lset loops) { /* Throw away the LP_BLOCKS sets */ - register Lindex i; + Lindex i; for (i = Lfirst(loops); i != (Lindex)0; i = Lnext(i, loops)) { @@ -241,7 +241,7 @@ STATIC void cleanup(lset loops) } } -STATIC bool does_exit(bblock_p b, loop_p lp) +static bool does_exit(bblock_p b, loop_p lp) { /* See if b may exit the loop, i.e. if it * has a successor outside the loop @@ -257,7 +257,7 @@ STATIC bool does_exit(bblock_p b, loop_p lp) return FALSE; } -STATIC void mark_succ(bblock_p b, loop_p lp) +static void mark_succ(bblock_p b, loop_p lp) { Lindex i; bblock_p succ; @@ -273,7 +273,7 @@ STATIC void mark_succ(bblock_p b, loop_p lp) } } -STATIC void mark_blocks(loop_p lp) +static void mark_blocks(loop_p lp) { /* Mark the strong and firm blocks of a loop. * The last set of blocks consists of the end-block @@ -283,7 +283,7 @@ STATIC void mark_blocks(loop_p lp) * tail of the back edge). */ - register bblock_p b; + bblock_p b; /* First mark all blocks that are the successor of a * block that may exit the loop (i.e. contains a @@ -317,7 +317,7 @@ STATIC void mark_blocks(loop_p lp) } } -STATIC void mark_loopblocks(lset loops) +static void mark_loopblocks(lset loops) { /* Determine for all loops which basic blocks * of the loop are strong (i.e. are executed @@ -347,7 +347,7 @@ void loop_detection(proc_p p) lset loops; /* the set of all loops */ loop_p lp, org; - register bblock_p b; + bblock_p b; bblock_p s; Lindex si; diff --git a/util/ego/cf/cf_succ.c b/util/ego/cf/cf_succ.c index d4d73034ad..50bd7dc47d 100644 --- a/util/ego/cf/cf_succ.c +++ b/util/ego/cf/cf_succ.c @@ -25,7 +25,7 @@ extern char em_flag[]; -STATIC void succeeds(bblock_p succ, bblock_p pred) +static void succeeds(bblock_p succ, bblock_p pred) { assert(pred != (bblock_p)0); if (succ != (bblock_p)0) @@ -42,7 +42,7 @@ STATIC void succeeds(bblock_p succ, bblock_p pred) #define TARGET(lnp) (lbmap[INSTRLAB(lnp)]) #define ATARGET(arg) (lbmap[arg->a_a.a_instrlab]) -STATIC arg_p skip_const(arg_p arg) +static arg_p skip_const(arg_p arg) { assert(arg != (arg_p)0); switch (arg->a_type) @@ -57,7 +57,7 @@ STATIC arg_p skip_const(arg_p arg) return arg->a_next; } -STATIC arg_p use_label(arg_p arg, bblock_p b) +static arg_p use_label(arg_p arg, bblock_p b) { if (arg->a_type == ARGINSTRLAB) { @@ -67,7 +67,7 @@ STATIC arg_p use_label(arg_p arg, bblock_p b) return arg->a_next; } -STATIC void case_flow(short instr, line_p desc, bblock_p b) +static void case_flow(short instr, line_p desc, bblock_p b) { /* Analyse the case descriptor (given as a ROM pseudo instruction). * Every instruction label appearing in the descriptor @@ -75,7 +75,7 @@ STATIC void case_flow(short instr, line_p desc, bblock_p b) * in which the case instruction appears (b). */ - register arg_p arg; + arg_p arg; assert(instr == op_csa || instr == op_csb); assert(TYPE(desc) == OPLIST); @@ -112,7 +112,7 @@ STATIC void case_flow(short instr, line_p desc, bblock_p b) } } -STATIC line_p case_descr(line_p lnp) +static line_p case_descr(line_p lnp) { /* lnp is the instruction just before a csa or csb, * so it is the instruction that pushes the address @@ -122,7 +122,7 @@ STATIC line_p case_descr(line_p lnp) * of the procedure in which the csa/csb occurs. */ - register line_p l; + line_p l; dblock_p d; obj_p obj; dblock_id id; @@ -169,7 +169,7 @@ STATIC line_p case_descr(line_p lnp) UNREACHABLE_CODE; } -STATIC void last2_instrs(bblock_p b, line_p* last_out, line_p* prev_out) +static void last2_instrs(bblock_p b, line_p* last_out, line_p* prev_out) { /* Determine the last and one-but-last instruction * of basic block b. An end-pseudo is not regarded @@ -177,7 +177,7 @@ STATIC void last2_instrs(bblock_p b, line_p* last_out, line_p* prev_out) * instruction, prev_out is 0. */ - register line_p l1, l2; + line_p l1, l2; l2 = b->b_start; /* first instruction of b */ assert(l2 != (line_p)0); /* block can not be empty */ @@ -204,7 +204,7 @@ void control_flow(bblock_p head) * for every basic block. */ - register bblock_p b; + bblock_p b; line_p lnp, prev; short instr; diff --git a/util/ego/cj/cj.c b/util/ego/cj/cj.c index 83e37203fc..f5e67cdce7 100644 --- a/util/ego/cj/cj.c +++ b/util/ego/cj/cj.c @@ -52,15 +52,15 @@ * the code has become smaller. */ -STATIC int Scj; /* number of optimizations found */ +static int Scj; /* number of optimizations found */ -STATIC void showinstr(line_p lnp); +static void showinstr(line_p lnp); #define DLINK(l1, l2) \ l1->l_next = l2; \ l2->l_prev = l1 -STATIC bool same_instr(line_p l1, line_p l2) +static bool same_instr(line_p l1, line_p l2) { /* See if l1 and l2 are the same instruction */ @@ -87,11 +87,11 @@ STATIC bool same_instr(line_p l1, line_p l2) } } -STATIC line_p last_mnem(bblock_p b) +static line_p last_mnem(bblock_p b) { /* Determine the last line of a list */ - register line_p l; + line_p l; for (l = b->b_start; l->l_next != (line_p)0; l = l->l_next) ; @@ -102,7 +102,7 @@ STATIC line_p last_mnem(bblock_p b) return l; } -STATIC bool is_desirable(line_p text) +static bool is_desirable(line_p text) { /* We avoid to generate a BRAnch in the middle of some expression, * as the code generator will write the contents of the fakestack @@ -141,7 +141,7 @@ STATIC bool is_desirable(line_p text) return TRUE; } -STATIC void cp_loops(bblock_p b1, bblock_p b2) +static void cp_loops(bblock_p b1, bblock_p b2) { /* Copy the loopset of b2 to b1 */ @@ -154,7 +154,7 @@ STATIC void cp_loops(bblock_p b1, bblock_p b2) } } -STATIC void jump_cross(line_p l1, line_p l2, bblock_p b1, bblock_p b2) +static void jump_cross(line_p l1, line_p l2, bblock_p b1, bblock_p b2) { /* A cross-jump from block b2 to block b1 is found; the code in * block b2 from line l2 up to the BRAnch is removed; block b1 is @@ -230,7 +230,7 @@ STATIC void jump_cross(line_p l1, line_p l2, bblock_p b1, bblock_p b2) INSTRLAB(l) = INSTRLAB(b->b_start); } -STATIC bool try_tail(bblock_p b1, bblock_p b2) +static bool try_tail(bblock_p b1, bblock_p b2) { /* See if b1 and b2 end on the same sequence of instructions */ @@ -286,14 +286,14 @@ STATIC bool try_tail(bblock_p b1, bblock_p b2) return FALSE; } -STATIC bool try_pred(bblock_p b) +static bool try_pred(bblock_p b) { /* See if there is any pair (b1,b2), both in PRED(b) for * which we can perform cross jumping. */ - register bblock_p b1, b2; - register Lindex i, j; + bblock_p b1, b2; + Lindex i, j; lset s = b->b_pred; for (i = Lfirst(s); i != (Lindex)0; i = Lnext(i, s)) @@ -360,7 +360,7 @@ int main(int argc, char* argv[]) extern char em_mnem[]; /* The mnemonics of the EM instructions. */ -STATIC void showinstr(line_p lnp) +static void showinstr(line_p lnp) { /* Makes the instruction in `lnp' human readable. Only lines that diff --git a/util/ego/cs/cs.c b/util/ego/cs/cs.c index 856d5917ed..4c7f9b9464 100644 --- a/util/ego/cs/cs.c +++ b/util/ego/cs/cs.c @@ -24,7 +24,7 @@ int Scs; /* Number of optimizations found. */ -STATIC void cs_clear(void) +static void cs_clear(void) { clr_avails(); clr_entities(); @@ -33,12 +33,12 @@ STATIC void cs_clear(void) start_valnum(); } -STATIC void cs_optimize(void* vp) +static void cs_optimize(void* vp) { /* Optimize all basic blocks of one procedure. */ proc_p p = vp; - register bblock_p rbp, bdone; + bblock_p rbp, bdone; if (IS_ENTERED_WITH_GTO(p)) return; diff --git a/util/ego/cs/cs_aux.c b/util/ego/cs/cs_aux.c index a7293b1410..8a0c8afecc 100644 --- a/util/ego/cs/cs_aux.c +++ b/util/ego/cs/cs_aux.c @@ -49,7 +49,7 @@ entity_p en_elem(Lindex i) * start at 1. */ -STATIC valnum val_no; +static valnum val_no; valnum newvalnum(void) { diff --git a/util/ego/cs/cs_avail.c b/util/ego/cs/cs_avail.c index ee358f0133..0582f95523 100644 --- a/util/ego/cs/cs_avail.c +++ b/util/ego/cs/cs_avail.c @@ -22,7 +22,7 @@ avail_p avails; /* The list of available expressions. */ -STATIC bool commutative(int instr) +static bool commutative(int instr) { /* Is instr a commutative operator? */ @@ -43,7 +43,7 @@ STATIC bool commutative(int instr) } } -STATIC bool same_avail(byte kind, avail_p avp1, avail_p avp2) +static bool same_avail(byte kind, avail_p avp1, avail_p avp2) { /* Two expressions are the same if they have the same operator, * the same size, and their operand(s) have the same value. @@ -77,7 +77,7 @@ STATIC bool same_avail(byte kind, avail_p avp1, avail_p avp2) UNREACHABLE_CODE; } -STATIC void check_local(avail_p avp) +static void check_local(avail_p avp) { /* Check if the local in which the result of avp was stored, * still holds this result. Update if not. @@ -92,7 +92,7 @@ STATIC void check_local(avail_p avp) } } -STATIC entity_p result_local(offset size, line_p l) +static entity_p result_local(offset size, line_p l) { /* If the result of an expression of size bytes is stored into a * local for which a registermessage was generated, return a pointer @@ -117,7 +117,7 @@ STATIC entity_p result_local(offset size, line_p l) return (entity_p)0; } -STATIC void copy_avail(int kind, avail_p src, avail_p dst) +static void copy_avail(int kind, avail_p src, avail_p dst) { /* Copy some attributes from src to dst. */ @@ -152,7 +152,7 @@ avail_p av_enter(avail_p avp, occur_p ocp, int kind) * if it is not already there. * Add ocp to the set of occurrences of this expression. */ - register avail_p ravp; + avail_p ravp; line_p last = ocp->oc_llast; for (ravp = avails; ravp != (avail_p)0; ravp = ravp->av_before) @@ -196,9 +196,9 @@ void clr_avails(void) { /* Throw away the information about the available expressions. */ - register avail_p ravp, next; - register Lindex i; - register lset s; + avail_p ravp, next; + Lindex i; + lset s; for (ravp = avails; ravp != (avail_p)0; ravp = next) { diff --git a/util/ego/cs/cs_debug.c b/util/ego/cs/cs_debug.c index f032ef06ae..a730d350f1 100644 --- a/util/ego/cs/cs_debug.c +++ b/util/ego/cs/cs_debug.c @@ -18,7 +18,7 @@ extern char em_mnem[]; /* The mnemonics of the EM instructions. */ -STATIC void showinstr(line_p lnp) +static void showinstr(line_p lnp) { /* Makes the instruction in `lnp' human readable. Only lines that * can occur in expressions that are going to be eliminated are @@ -55,7 +55,7 @@ void SHOWOCCUR(occur_p ocp) { /* Shows all instructions in an occurrence. */ - register line_p lnp, next; + line_p lnp, next; if (verbose_flag) { @@ -82,7 +82,7 @@ void SHOWAVAIL(avail_p avp) void OUTAVAILS(void) { - register avail_p ravp; + avail_p ravp; fprintf(stderr, "AVAILABLE EXPRESSIONS\n"); @@ -93,7 +93,7 @@ void OUTAVAILS(void) } } -STATIC char* enkinds[] = { "constant", +static char* enkinds[] = { "constant", "local", "external", "indirect", @@ -112,12 +112,12 @@ STATIC char* enkinds[] = { "constant", void OUTENTITIES(void) { - register Lindex i; + Lindex i; fprintf(stderr, "ENTITIES\n"); for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { - register entity_p rep = en_elem(i); + entity_p rep = en_elem(i); fprintf(stderr, "%s,", enkinds[rep->en_kind]); fprintf(stderr, "size %ld,", rep->en_size); diff --git a/util/ego/cs/cs_elim.c b/util/ego/cs/cs_elim.c index c22f58f595..e7a6ea7166 100644 --- a/util/ego/cs/cs_elim.c +++ b/util/ego/cs/cs_elim.c @@ -20,7 +20,7 @@ #include "cs_partit.h" #include "cs_debug.h" -STATIC void dlink(line_p l1, line_p l2) +static void dlink(line_p l1, line_p l2) { /* Doubly link the lines in l1 and l2. */ @@ -30,12 +30,12 @@ STATIC void dlink(line_p l1, line_p l2) l2->l_prev = l1; } -STATIC void remove_lines(line_p first, line_p last) +static void remove_lines(line_p first, line_p last) { /* Throw away the lines between and including first and last. * Don't worry about any pointers; they (must) have been taken care of. */ - register line_p lnp, next; + line_p lnp, next; last->l_next = (line_p)0; /* Delimit the list. */ for (lnp = first; lnp != (line_p)0; lnp = next) @@ -45,11 +45,11 @@ STATIC void remove_lines(line_p first, line_p last) } } -STATIC bool contained(occur_p ocp1, occur_p ocp2) +static bool contained(occur_p ocp1, occur_p ocp2) { /* Determine whether ocp1 is contained within ocp2. */ - register line_p lnp, next; + line_p lnp, next; for (lnp = ocp2->oc_lfirst; lnp != (line_p)0; lnp = next) { @@ -61,7 +61,7 @@ STATIC bool contained(occur_p ocp1, occur_p ocp2) return FALSE; } -STATIC void delete(occur_p ocp, avail_p start) +static void delete(occur_p ocp, avail_p start) { /* Delete all occurrences that are contained within ocp. * They must have been entered in the list before start: @@ -69,8 +69,8 @@ STATIC void delete(occur_p ocp, avail_p start) * appears before the operator line of the other because EM-expressions * are postfix. */ - register avail_p ravp; - register Lindex i, next; + avail_p ravp; + Lindex i, next; for (ravp = start; ravp != (avail_p)0; ravp = ravp->av_before) { @@ -91,7 +91,7 @@ STATIC void delete(occur_p ocp, avail_p start) } } -STATIC void complete_aar(line_p lnp, int instr, valnum descr_vn) +static void complete_aar(line_p lnp, int instr, valnum descr_vn) { /* Lnp is an instruction that loads the address of an array-element. * Instr tells us what effect we should achieve; load (instr is op_lar) @@ -99,7 +99,7 @@ STATIC void complete_aar(line_p lnp, int instr, valnum descr_vn) * valuenumber of the address of the descriptor of this array. * We append a loi or sti of the correct number of bytes. */ - register line_p lindir; + line_p lindir; lindir = int_line(array_elemsize(descr_vn)); lindir->l_instr = instr == op_lar ? op_loi : op_sti; @@ -107,7 +107,7 @@ STATIC void complete_aar(line_p lnp, int instr, valnum descr_vn) dlink(lnp, lindir); } -STATIC void complete_dv_as_rm(line_p lnp, avail_p avp, bool first) +static void complete_dv_as_rm(line_p lnp, avail_p avp, bool first) { /* Complete a / b as a % b = a - b * (a / b). For the first * occurrence, lnp must stack q, where q = a / b. We prepend a @@ -144,7 +144,7 @@ STATIC void complete_dv_as_rm(line_p lnp, avail_p avp, bool first) dlink(lnp, ml); } -STATIC void replace(occur_p ocp, offset tmp, avail_p avp) +static void replace(occur_p ocp, offset tmp, avail_p avp) { /* Replace the lines in the occurrence in ocp by a load of the * temporary with offset tmp. @@ -219,7 +219,7 @@ STATIC void replace(occur_p ocp, offset tmp, avail_p avp) remove_lines(first, last); } -STATIC void append(avail_p avp, offset tmp) +static void append(avail_p avp, offset tmp) { /* Avp->av_found points to a line with an operator in it. This * routine emits a sequence of instructions that saves the result @@ -228,8 +228,8 @@ STATIC void append(avail_p avp, offset tmp) * avp->av_size. If however the operator is an aar contained * within a lar or sar, we must first generate the aar. */ - register line_p stl, lol; - register int instr; + line_p stl, lol; + int instr; assert(avp->av_size == ws || avp->av_size == 2 * ws); @@ -269,7 +269,7 @@ STATIC void append(avail_p avp, offset tmp) } } -STATIC void set_replace(avail_p avp, offset tmp) +static void set_replace(avail_p avp, offset tmp) { /* Avp->av_occurs is now a set of occurrences, each of which will be * replaced by a reference to a local. @@ -277,8 +277,8 @@ STATIC void set_replace(avail_p avp, offset tmp) * list those expressions that are physically contained in them, * because we cannot eliminate them again. */ - register Lindex i; - register lset s = avp->av_occurs; + Lindex i; + lset s = avp->av_occurs; for (i = Lfirst(s); i != (Lindex)0; i = Lnext(i, s)) { @@ -290,7 +290,7 @@ STATIC void set_replace(avail_p avp, offset tmp) } } -STATIC int reg_score(entity_p enp) +static int reg_score(entity_p enp) { /* Enp is a local that will go into a register. * We return its score upto now. @@ -299,13 +299,13 @@ STATIC int reg_score(entity_p enp) return regv_arg(enp->en_loc, 4); } -STATIC line_p gen_mesreg(offset off, avail_p avp, proc_p pp) +static line_p gen_mesreg(offset off, avail_p avp, proc_p pp) { /* Generate a register message for the local that will hold the * result of the expression in avp, at the appropriate place in * the procedure in pp. */ - register line_p reg; + line_p reg; reg = reg_mes(off, (short)avp->av_size, regtype(avp->av_instr), 0); appnd_line(reg, pp->p_start->b_start); @@ -313,11 +313,11 @@ STATIC line_p gen_mesreg(offset off, avail_p avp, proc_p pp) return reg; } -STATIC void change_score(line_p mes, int score) +static void change_score(line_p mes, int score) { /* Change the score in the register message in mes to score. */ - register arg_p ap = ARG(mes); + arg_p ap = ARG(mes); ap = ap->a_next; /* Offset. */ ap = ap->a_next; /* Size. */ @@ -338,10 +338,10 @@ void eliminate(proc_p pp) * Code is appended to the first occurrence of the expression * to store the result into a local. */ - register avail_p ravp; - register int score; - register offset tmp; - register line_p mes; + avail_p ravp; + int score; + offset tmp; + line_p mes; for (ravp = avails; ravp != (avail_p)0; ravp = ravp->av_before) { diff --git a/util/ego/cs/cs_entity.c b/util/ego/cs/cs_entity.c index bbe81a1e91..0c0965af3d 100644 --- a/util/ego/cs/cs_entity.c +++ b/util/ego/cs/cs_entity.c @@ -22,7 +22,7 @@ entity_p find_entity(valnum vn) { /* Try to find the entity with valuenumber vn. */ - register Lindex i; + Lindex i; for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { @@ -33,7 +33,7 @@ entity_p find_entity(valnum vn) return (entity_p)0; } -STATIC bool same_entity(entity_p enp1, entity_p enp2) +static bool same_entity(entity_p enp1, entity_p enp2) { if (enp1->en_kind != enp2->en_kind) return FALSE; @@ -70,7 +70,7 @@ STATIC bool same_entity(entity_p enp1, entity_p enp2) } } -STATIC void copy_entity(entity_p src, entity_p dst) +static void copy_entity(entity_p src, entity_p dst) { dst->en_static = src->en_static; dst->en_kind = src->en_kind; @@ -117,8 +117,8 @@ entity_p en_enter(entity_p enp) /* Put the entity in enp in the entity set, if it is not already there. * Return pointer to stored entity. */ - register Lindex i; - register entity_p new; + Lindex i; + entity_p new; for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { @@ -138,7 +138,7 @@ void clr_entities(void) { /* Throw away all pseudo-symboltable information. */ - register Lindex i; + Lindex i; for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { diff --git a/util/ego/cs/cs_getent.c b/util/ego/cs/cs_getent.c index f6273881ed..cb53b79ac8 100644 --- a/util/ego/cs/cs_getent.c +++ b/util/ego/cs/cs_getent.c @@ -19,7 +19,7 @@ #define ARGW 3 #define ARDESC3 4 -STATIC struct inf_entity +static struct inf_entity { byte inf_instr; /* Key. */ byte inf_used; /* Kind of entity used by key. */ @@ -44,7 +44,7 @@ STATIC struct inf_entity #define ENKIND(ip) ip->inf_used #define SIZEINF(ip) ip->inf_size -STATIC struct inf_entity* getinf(int n) +static struct inf_entity* getinf(int n) { struct inf_entity* ip; diff --git a/util/ego/cs/cs_kill.c b/util/ego/cs/cs_kill.c index 912bf81c61..8bb622eb62 100644 --- a/util/ego/cs/cs_kill.c +++ b/util/ego/cs/cs_kill.c @@ -18,7 +18,7 @@ #include "cs_entity.h" #include "cs_kill.h" -STATIC valnum base_valno(entity_p enp) +static valnum base_valno(entity_p enp) { /* Return the value number of the (base) address of an indirectly * accessed entity. @@ -38,18 +38,18 @@ STATIC valnum base_valno(entity_p enp) UNREACHABLE_CODE; } -STATIC entity_p find_base(valnum vn) +static entity_p find_base(valnum vn) { /* Vn is the valuenumber of the (base) address of an indirectly * accessed entity. Return the entity that holds this address * recursively. */ - register Lindex i; - register avail_p ravp; + Lindex i; + avail_p ravp; for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { - register entity_p renp = en_elem(i); + entity_p renp = en_elem(i); if (renp->en_vn == vn) { @@ -84,7 +84,7 @@ STATIC entity_p find_base(valnum vn) return (entity_p)0; } -STATIC bool obj_overlap(obj_p op1, obj_p op2) +static bool obj_overlap(obj_p op1, obj_p op2) { /* Op1 and op2 point to two objects in the same datablock. * Obj_overlap returns whether these objects might overlap. @@ -103,7 +103,7 @@ STATIC bool obj_overlap(obj_p op1, obj_p op2) #define same_datablock(o1, o2) ((o1)->o_dblock == (o2)->o_dblock) -STATIC bool addr_local(entity_p enp) +static bool addr_local(entity_p enp) { /* Is enp the address of a stack item. */ @@ -113,14 +113,14 @@ STATIC bool addr_local(entity_p enp) return enp->en_kind == ENALOCAL || enp->en_kind == ENALOCBASE || enp->en_kind == ENAARGBASE; } -STATIC bool addr_external(entity_p enp) +static bool addr_external(entity_p enp) { /* Is enp the address of an external. */ return enp != (entity_p)0 && enp->en_kind == ENAEXTERNAL; } -STATIC void kill_external(obj_p obp, int indir) +static void kill_external(obj_p obp, int indir) { /* A store is done via the object in obp. If this store is direct * we kill directly accessed entities in the same data block only @@ -129,7 +129,7 @@ STATIC void kill_external(obj_p obp, int indir) * proven taht they are not in the same data block, are killed in * both cases. */ - register Lindex i; + Lindex i; OUTTRACE("kill external", 0); for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) @@ -166,7 +166,7 @@ STATIC void kill_external(obj_p obp, int indir) } } -STATIC bool loc_overlap(entity_p enp1, entity_p enp2) +static bool loc_overlap(entity_p enp1, entity_p enp2) { /* Enp1 and enp2 point to two locals. Loc_overlap returns whether * they overlap. @@ -188,11 +188,11 @@ STATIC bool loc_overlap(entity_p enp1, entity_p enp2) return enp1->en_size == UNKNOWN_SIZE || enp1->en_loc + enp1->en_size > enp2->en_loc; } -STATIC void kill_local(entity_p enp, bool indir) +static void kill_local(entity_p enp, bool indir) { /* This time a store is done into an ENLOCAL. */ - register Lindex i; + Lindex i; OUTTRACE("kill local", 0); for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) @@ -245,16 +245,16 @@ STATIC void kill_local(entity_p enp, bool indir) } } -STATIC void kill_sim(void) +static void kill_sim(void) { /* A store is done into the ENIGNMASK. */ - register Lindex i; + Lindex i; OUTTRACE("kill sim", 0); for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { - register entity_p rep = en_elem(i); + entity_p rep = en_elem(i); if (rep->en_kind == ENIGNMASK) { @@ -327,12 +327,12 @@ extern void kill_much(void) /* Kills all killable entities, * except the locals for which a registermessage was generated. */ - register Lindex i; + Lindex i; OUTTRACE("kill much", 0); for (i = Lfirst(entities); i != (Lindex)0; i = Lnext(i, entities)) { - register entity_p rep = en_elem(i); + entity_p rep = en_elem(i); if (rep->en_static) continue; @@ -343,7 +343,7 @@ extern void kill_much(void) } } -STATIC bool bad_procflags(proc_p pp) +static bool bad_procflags(proc_p pp) { /* Return whether the flags about the procedure in pp indicate * that we have little information about it. It might be that @@ -353,12 +353,12 @@ STATIC bool bad_procflags(proc_p pp) return !(pp->p_flags1 & PF_BODYSEEN) || (pp->p_flags1 & PF_CALUNKNOWN); } -STATIC void kill_globset(cset s) +static void kill_globset(cset s) { /* S is a set of global variables that might be changed. * We act as if a direct store is done into each of them. */ - register Cindex i; + Cindex i; OUTTRACE("kill globset", 0); for (i = Cfirst(s); i != (Cindex)0; i = Cnext(i, s)) @@ -393,7 +393,7 @@ void kill_all(void) { /* Kills all entities. */ - register Lindex i; + Lindex i; OUTTRACE("kill all entities", 0); for (i = Lfirst(entities); i != (Lindex)i; i = Lnext(i, entities)) diff --git a/util/ego/cs/cs_partit.c b/util/ego/cs/cs_partit.c index 070a5ab76b..00a4d7f7bc 100644 --- a/util/ego/cs/cs_partit.c +++ b/util/ego/cs/cs_partit.c @@ -28,7 +28,7 @@ #define PTR 1 #define FLT 2 -STATIC struct +static struct { byte i_group; /* Group of instruction. */ byte i_op1; /* Indication of size of operand of unary operator. */ @@ -748,7 +748,7 @@ bool stack_group(int instr) } } -STATIC offset argw(line_p lnp) +static offset argw(line_p lnp) { /* Some EM-instructions have their argument either on the same line, * or on top of the stack. We give up when the argument is on top of diff --git a/util/ego/cs/cs_profit.c b/util/ego/cs/cs_profit.c index c4cf92f7c8..42af28ef46 100644 --- a/util/ego/cs/cs_profit.c +++ b/util/ego/cs/cs_profit.c @@ -20,15 +20,15 @@ #include "cs_avail.h" #include "cs_partit.h" -STATIC cset addr_modes; -STATIC cset cheaps; -STATIC cset forbidden; -STATIC cset sli_counts; -STATIC short LX_threshold; -STATIC short AR_limit; -STATIC bool RM_to_DV; - -STATIC void get_instrs(FILE* f, cset* s_p) +static cset addr_modes; +static cset cheaps; +static cset forbidden; +static cset sli_counts; +static short LX_threshold; +static short AR_limit; +static bool RM_to_DV; + +static void get_instrs(FILE* f, cset* s_p) { /* Read a set of integers from inputfile f into *s_p. * Such a set must be delimited by a negative number. @@ -43,7 +43,7 @@ STATIC void get_instrs(FILE* f, cset* s_p) } } -STATIC void choose_cset(FILE* f, cset* s_p, int max) +static void choose_cset(FILE* f, cset* s_p, int max) { /* Read two compact sets of integers from inputfile f. * Choose the first if we optimize with respect to time, @@ -143,7 +143,7 @@ bool may_become_dv(void) return RM_to_DV; } -STATIC bool sli_no_eliminate(line_p lnp) +static bool sli_no_eliminate(line_p lnp) { /* Return whether the SLI-instruction in lnp is part of * an array-index computation, and should not be eliminated. @@ -155,7 +155,7 @@ STATIC bool sli_no_eliminate(line_p lnp) && Cis_elem((Celem_t)cst, sli_counts); } -STATIC bool gains(avail_p avp) +static bool gains(avail_p avp) { /* Return whether we can gain something, when we eliminate * an expression such as in avp. We just glue together some @@ -183,12 +183,12 @@ STATIC bool gains(avail_p avp) return TRUE; } -STATIC bool okay_lines(avail_p avp, occur_p ocp) +static bool okay_lines(avail_p avp, occur_p ocp) { /* Check whether all lines in this occurrence can in * principle be eliminated; no stores, messages, calls etc. */ - register line_p lnp, next; + line_p lnp, next; for (lnp = ocp->oc_lfirst; lnp != (line_p)0; lnp = next) { @@ -208,7 +208,7 @@ STATIC bool okay_lines(avail_p avp, occur_p ocp) bool desirable(avail_p avp) { - register Lindex i, next; + Lindex i, next; if (!gains(avp)) { diff --git a/util/ego/cs/cs_stack.c b/util/ego/cs/cs_stack.c index 6ef841f7f4..41c667ae16 100644 --- a/util/ego/cs/cs_stack.c +++ b/util/ego/cs/cs_stack.c @@ -15,8 +15,8 @@ #define STACK_DEPTH 250 -STATIC struct token Stack[STACK_DEPTH]; -STATIC token_p free_token; +static struct token Stack[STACK_DEPTH]; +static token_p free_token; #define Delete_top() \ { \ @@ -103,9 +103,9 @@ void Dup(line_p lnp) { /* Duplicate top bytes on the Stack. */ - register token_p bottom = Top; - register token_p oldtop = Top; - register offset nbytes = off_set(lnp); + token_p bottom = Top; + token_p oldtop = Top; + offset nbytes = off_set(lnp); struct token dummy; /* Find the bottom of the bytes to be duplicated. diff --git a/util/ego/cs/cs_vnm.c b/util/ego/cs/cs_vnm.c index 824b2c9f76..42800e6622 100644 --- a/util/ego/cs/cs_vnm.c +++ b/util/ego/cs/cs_vnm.c @@ -22,7 +22,7 @@ #include "cs_getent.h" #include "cs_profit.h" -STATIC void push_entity(entity_p enp, line_p lfirst) +static void push_entity(entity_p enp, line_p lfirst) { /* Build token and Push it. */ @@ -34,7 +34,7 @@ STATIC void push_entity(entity_p enp, line_p lfirst) Push(&tk); } -STATIC void put_expensive_load(bblock_p bp, line_p lnp, line_p lfirst, entity_p enp) +static void put_expensive_load(bblock_p bp, line_p lnp, line_p lfirst, entity_p enp) { struct avail av; occur_p ocp; @@ -48,7 +48,7 @@ STATIC void put_expensive_load(bblock_p bp, line_p lnp, line_p lfirst, entity_p av_enter(&av, ocp, EXPENSIVE_LOAD); } -STATIC void put_aar(bblock_p bp, line_p lnp, line_p lfirst, entity_p enp) +static void put_aar(bblock_p bp, line_p lnp, line_p lfirst, entity_p enp) { /* Enter the implicit AAR in a LAR or SAR, where enp points to * the ENARRELEM, and AAR computes its address. @@ -75,7 +75,7 @@ STATIC void put_aar(bblock_p bp, line_p lnp, line_p lfirst, entity_p enp) } } -STATIC void push_avail(avail_p avp, line_p lfirst) +static void push_avail(avail_p avp, line_p lfirst) { struct token tk; @@ -85,7 +85,7 @@ STATIC void push_avail(avail_p avp, line_p lfirst) Push(&tk); } -STATIC void push_unair_op(bblock_p bp, line_p lnp, token_p tkp1) +static void push_unair_op(bblock_p bp, line_p lnp, token_p tkp1) { struct avail av; occur_p ocp; @@ -99,7 +99,7 @@ STATIC void push_unair_op(bblock_p bp, line_p lnp, token_p tkp1) push_avail(av_enter(&av, ocp, UNAIR_OP), tkp1->tk_lfirst); } -STATIC void push_binair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) +static void push_binair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) { struct avail av; occur_p ocp; @@ -114,7 +114,7 @@ STATIC void push_binair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) push_avail(av_enter(&av, ocp, BINAIR_OP), tkp1->tk_lfirst); } -STATIC void push_ternair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2, token_p tkp3) +static void push_ternair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2, token_p tkp3) { struct avail av; occur_p ocp; @@ -130,7 +130,7 @@ STATIC void push_ternair_op(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2, push_avail(av_enter(&av, ocp, TERNAIR_OP), tkp1->tk_lfirst); } -STATIC void push_remainder(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) +static void push_remainder(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) { /* Enter the implicit division tkp1 / tkp2, * then push the remainder tkp1 % tkp2. @@ -162,7 +162,7 @@ STATIC void push_remainder(bblock_p bp, line_p lnp, token_p tkp1, token_p tkp2) push_avail(av_enter(&av, ocp, REMAINDER), tkp1->tk_lfirst); } -STATIC void fiddle_stack(line_p lnp) +static void fiddle_stack(line_p lnp) { /* The instruction in lnp does something to the valuenumber-stack. */ @@ -243,7 +243,7 @@ STATIC void fiddle_stack(line_p lnp) } } -STATIC proc_p find_proc(valnum vn) +static proc_p find_proc(valnum vn) { /* Find the procedure-identifier with valuenumber vn. */ @@ -257,7 +257,7 @@ STATIC proc_p find_proc(valnum vn) return (proc_p)0; } -STATIC void side_effects(line_p lnp) +static void side_effects(line_p lnp) { /* Lnp contains a cai or cal instruction. We try to find the callee * and see what side-effects it has. @@ -285,7 +285,7 @@ STATIC void side_effects(line_p lnp) } } -STATIC void hopeless(int instr) +static void hopeless(int instr) { /* The effect of `instr' is too difficult to * compute. We assume worst case behaviour. @@ -313,8 +313,8 @@ STATIC void hopeless(int instr) void vnm(bblock_p bp) { - register line_p lnp; - register entity_p rep; + line_p lnp; + entity_p rep; line_p lfirst; struct token tk, tk1, tk2, tk3; diff --git a/util/ego/em_ego/em_ego.c b/util/ego/em_ego/em_ego.c index 4610b96b72..2bdf90ccd0 100644 --- a/util/ego/em_ego/em_ego.c +++ b/util/ego/em_ego/em_ego.c @@ -90,7 +90,7 @@ static void cleanup(void) if (!keeptemps) { - register int i; + int i; for (i = NTEMPS * 2; i > 0; i--) { @@ -153,7 +153,7 @@ static void old_infiles(void) { /* Remove old input files unless we have to keep them around. */ - register int i; + int i; if (phargs[1] == pdump || keeptemps) return; @@ -166,7 +166,7 @@ static void get_infiles(void) { /* Make output temps from previous phase input temps of next phase. */ - register int i; + int i; char** dst = &phargs[1]; char** src = &phargs[NTEMPS + 1]; @@ -182,7 +182,7 @@ static void new_outfiles(void) static int Bindex = 0; static char dig1 = '1'; static char dig2 = '0'; - register int i; + int i; char** dst = &phargs[NTEMPS + 1]; if (!Bindex) @@ -211,8 +211,8 @@ static void run_phase(int phase) IC and CA. */ static int flags_added; - register int argc; - register int i; + int argc; + int i; char buf[256]; int pid, status; @@ -275,7 +275,7 @@ static void run_phase(int phase) if (v_flag) { - register int i = 0; + int i = 0; while (phargs[i]) { diff --git a/util/ego/ic/ic.c b/util/ego/ic/ic.c index 39d7b96602..1a002a56c3 100644 --- a/util/ego/ic/ic.c +++ b/util/ego/ic/ic.c @@ -52,10 +52,10 @@ lab_id lastlid = 0; offset mespar = UNKNOWN_SIZE; /* argumument of ps_par message of current procedure */ -STATIC void process_lines(FILE*); -STATIC int readline(short*, line_p*); -STATIC line_p readoperand(short instr); -STATIC line_p inpseudo(short); +static void process_lines(FILE*); +static int readline(short*, line_p*); +static line_p readoperand(short instr); +static line_p inpseudo(short); int main(int argc, char* argv[]) { @@ -132,7 +132,7 @@ int main(int argc, char* argv[]) #define END_INSTR 4 #define DELETED_INSTR 5 -STATIC void add_end(void) +static void add_end(void) { /* Add an end-pseudo to the current instruction list */ @@ -141,7 +141,7 @@ STATIC void add_end(void) lastline->l_instr = ps_end; } -STATIC void process_lines(FILE* fout) +static void process_lines(FILE* fout) { line_p lnp; short instr; @@ -233,9 +233,9 @@ STATIC void process_lines(FILE* fout) } } -STATIC int readline(short* instr_out, line_p* lnp_out) +static int readline(short* instr_out, line_p* lnp_out) { - register line_p lnp; + line_p lnp; short n; /* Read one line. If it is a normal EM instruction without @@ -307,13 +307,13 @@ STATIC int readline(short* instr_out, line_p* lnp_out) UNREACHABLE_CODE; } -STATIC line_p readoperand(short instr) +static line_p readoperand(short instr) { /* Read the operand of the given instruction. * Create a line struct and return a pointer to it. */ - register line_p lnp; + line_p lnp; short flag; VI(instr); @@ -424,7 +424,7 @@ static char* hol_label(void) return lastname; } -STATIC line_p inpseudo(short n) +static line_p inpseudo(short n) { int m; line_p lnp; diff --git a/util/ego/ic/ic_aux.c b/util/ego/ic/ic_aux.c index 4411ee3275..0ce108d296 100644 --- a/util/ego/ic/ic_aux.c +++ b/util/ego/ic/ic_aux.c @@ -49,7 +49,7 @@ offset opr_size(short instr) /* dblockdef */ -STATIC offset argsize(arg_p arg) +static offset argsize(arg_p arg) { /* Compute the size (in bytes) that the given initializer * will occupy. @@ -92,7 +92,7 @@ STATIC offset argsize(arg_p arg) UNREACHABLE_CODE; } -STATIC offset blocksize(byte pseudo, arg_p args) +static offset blocksize(byte pseudo, arg_p args) { /* Determine the number of bytes of a datablock */ @@ -123,7 +123,7 @@ STATIC offset blocksize(byte pseudo, arg_p args) UNREACHABLE_CODE; } -STATIC arg_p copy_arg(arg_p arg) +static arg_p copy_arg(arg_p arg) { /* Copy one argument */ @@ -135,7 +135,7 @@ STATIC arg_p copy_arg(arg_p arg) return new; } -STATIC arg_p copy_rom(arg_p args) +static arg_p copy_rom(arg_p args) { /* Make a copy of the values of a rom, * provided that the rom contains only integer values, @@ -247,7 +247,7 @@ void combine(dblock_p db, line_p l1, line_p l2, byte pseu) /* arglist */ -STATIC void arg_string(offset length, register argb_p abp) +static void arg_string(offset length, argb_p abp) { while (length--) @@ -261,7 +261,7 @@ STATIC void arg_string(offset length, register argb_p abp) line_p arglist(int n) { line_p lnp; - register arg_p ap, *app; + arg_p ap, *app; bool moretocome; offset length; @@ -367,7 +367,7 @@ dblock_p block_of_lab(char* ident) /* object */ -STATIC obj_p make_object(dblock_p dbl, offset off, offset size) +static obj_p make_object(dblock_p dbl, offset off, offset size) { /* Allocate an obj struct with the given attributes * (if it did not exist already). diff --git a/util/ego/ic/ic_io.c b/util/ego/ic/ic_io.c index 553352f243..7c74f57f3e 100644 --- a/util/ego/ic/ic_io.c +++ b/util/ego/ic/ic_io.c @@ -19,12 +19,12 @@ #include "../share/alloc.h" #include "ic_io.h" -STATIC short libstate; -STATIC long bytecnt; +static short libstate; +static long bytecnt; -STATIC FILE* infile; /* The current EM input file */ +static FILE* infile; /* The current EM input file */ -STATIC int readbyte(void) +static int readbyte(void) { if (libstate == ARCHIVE && bytecnt-- == 0L) { @@ -39,7 +39,7 @@ STATIC int readbyte(void) short readshort(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = readbyte(); h_byte = readbyte(); @@ -51,8 +51,8 @@ short readshort(void) #ifdef LONGOFF offset readoffset(void) { - register long l; - register int h_byte; + long l; + int h_byte; l = readbyte(); l |= ((unsigned)readbyte()) * 256; @@ -97,17 +97,17 @@ offset get_off(void) } } -STATIC void make_string(int n) +static void make_string(int n) { sprintf(string, ".%u", n); } -STATIC void inident(void) +static void inident(void) { - register int n; - register char* p = string; - register int c; + int n; + char* p = string; + int c; n = get_int(); while (n--) @@ -171,7 +171,7 @@ int table3(int n) int table1(void) { - register int n; + int n; n = readbyte(); if (n == EOF) @@ -196,7 +196,7 @@ int table1(void) int table2(void) { - register int n; + int n; n = readbyte(); if ((n < sp_fcst0 + sp_ncst0) && (n >= sp_fcst0)) diff --git a/util/ego/ic/ic_lib.c b/util/ego/ic/ic_lib.c index 5b4b688260..ea45028e7a 100644 --- a/util/ego/ic/ic_lib.c +++ b/util/ego/ic/ic_lib.c @@ -22,7 +22,7 @@ #include "../share/files.h" #include "ic_lib.h" -STATIC void skip_string(offset n) +static void skip_string(offset n) { /* Read a string of length n and void it */ @@ -32,7 +32,7 @@ STATIC void skip_string(offset n) } } -STATIC void skip_arguments(void) +static void skip_arguments(void) { /* Skip the arguments of a MES pseudo. The argument * list is terminated by a sp_cend byte. @@ -59,7 +59,7 @@ STATIC void skip_arguments(void) } } -STATIC bool proc_wanted(const char* name) +static bool proc_wanted(const char* name) { /* See if 'name' is the name of an external procedure * that has been used before, but for which no body @@ -78,7 +78,7 @@ STATIC bool proc_wanted(const char* name) } } -STATIC bool data_wanted(const char* name) +static bool data_wanted(const char* name) { /* See if 'name' is the name of an externally visible * data block that has been used before, but for which @@ -97,7 +97,7 @@ STATIC bool data_wanted(const char* name) } } -STATIC bool wanted_names(void) +static bool wanted_names(void) { /* Read the names of procedures and data labels, * appearing in a 'MES ms_ext' pseudo. Those are @@ -136,8 +136,8 @@ STATIC bool wanted_names(void) } } -STATIC FILE* curfile = NULL; -STATIC bool useful(void) +static FILE* curfile = NULL; +static bool useful(void) { /* Determine if any entity imported by the current * compact EM assembly file (which will usually be @@ -172,30 +172,30 @@ STATIC bool useful(void) } } -STATIC bool is_archive(char* name) +static bool is_archive(char* name) { /* See if 'name' is the name of an archive file, i.e. it * should end on ".ma" and should at least be four characters * long (i.e. the name ".ma" is not accepted as an archive name!). */ - register char* p; + char* p; for (p = name; *p; p++) ; return (p > name + 3) && (*--p == 'a') && (*--p == 'm') && (*--p == '.'); } -STATIC struct ar_hdr hdr; +static struct ar_hdr hdr; -STATIC bool read_hdr(void) +static bool read_hdr(void) { /* Read the header of an archive module */ char buf[AR_TOTAL]; - register char* c = buf; - register char* p = hdr.ar_name; - register int i; + char* c = buf; + char* p = hdr.ar_name; + int i; fread(c, AR_TOTAL, 1, curfile); if (feof(curfile)) @@ -223,8 +223,8 @@ STATIC bool read_hdr(void) return 1; } -STATIC int argcnt = 0; -STATIC short arstate = NO_ARCHIVE; +static int argcnt = 0; +static short arstate = NO_ARCHIVE; FILE* next_file(int argc, char* argv[]) { diff --git a/util/ego/ic/ic_lookup.c b/util/ego/ic/ic_lookup.c index 8d8fb647f2..078793434f 100644 --- a/util/ego/ic/ic_lookup.c +++ b/util/ego/ic/ic_lookup.c @@ -40,7 +40,7 @@ char* lastname; lab_id instr_lab(short number) { - register num_p *npp, np; + num_p *npp, np; /* In EM assembly language, a label is an unsigned number, * e.g. 120 in 'BRA *120'. In IC the labels of a procedure @@ -77,10 +77,10 @@ lab_id instr_lab(short number) /* symlookup */ -STATIC unsigned hash(const char* string) +static unsigned hash(const char* string) { - register const char* p; - register unsigned i, sum; + const char* p; + unsigned i, sum; for (sum = i = 0, p = string; *p; i += 3) sum ^= (*p++) << (i & 07); @@ -98,8 +98,8 @@ dblock_p symlookup(const char* name, int status) * data label, i.e. a hol block need not have a name. */ - register sym_p *spp, sp; - register dblock_p dp; + sym_p *spp, sp; + dblock_p dp; if (name == (char*)0) { @@ -208,8 +208,8 @@ proc_p getproc(int status) proc_p proclookup(const char* name, int status) { - register prc_p *ppp, pp; - register proc_p dp; + prc_p *ppp, pp; + proc_p dp; ppp = &prochash[hash(name) % NPROCHASH]; while (*ppp != (prc_p)0) @@ -279,7 +279,7 @@ proc_p proclookup(const char* name, int status) void cleaninstrlabs(void) { - register num_p *npp, np, next; + num_p *npp, np, next; for (npp = numhash; npp < &numhash[NNUMHASH]; npp++) { @@ -309,7 +309,7 @@ void dump_procnames(prc_p hash[], int n, FILE* f) * more than once, the PF_WRITTEN flag is used. */ - register prc_p *pp, ph; + prc_p *pp, ph; proc_p p; #define PF_WRITTEN 01 @@ -344,7 +344,7 @@ void cleanprocs(prc_p hash[], int n, int mask) * remaining prc structs are also removed. */ - register prc_p *pp, ph, x, next; + prc_p *pp, ph, x, next; for (pp = &hash[0]; pp < &hash[n]; pp++) { @@ -388,7 +388,7 @@ void dump_dblocknames(sym_p hash[], int n, FILE* f) * This routine is called once for every input file. */ - register sym_p *sp, sh; + sym_p *sp, sh; dblock_p d; #define DF_WRITTEN 01 @@ -418,7 +418,7 @@ void cleandblocks(sym_p hash[], int n, int mask) * of those data blocks that are internal must be removed. */ - register sym_p *sp, sh, x, next; + sym_p *sp, sh, x, next; for (sp = &hash[0]; sp < &hash[n]; sp++) { diff --git a/util/ego/il/il.c b/util/ego/il/il.c index 5fd3671ede..ccd3620f2c 100644 --- a/util/ego/il/il.c +++ b/util/ego/il/il.c @@ -35,16 +35,16 @@ int calnr; int complete_program; calcnt_p cchead; /* call-count info of current proc */ -STATIC long space = 0; -STATIC long total_size = 0; +static long space = 0; +static long total_size = 0; -STATIC char* cname; -STATIC char* ccname; -STATIC char* cname2; +static char* cname; +static char* ccname; +static char* cname2; /* For debugging only */ -STATIC char* sname; -STATIC int kp_temps = 0; +static char* sname; +static int kp_temps = 0; int Ssubst; #ifdef VERBOSE @@ -62,7 +62,7 @@ int Sbig_caller, Sdispensable, Schangedcallee, Sbigcallee, Sspace, Szeroratio; * The call descriptors are put in a file (calfile). */ -STATIC void pass1(const char* lnam, const char* bnam, const char* cnam) +static void pass1(const char* lnam, const char* bnam, const char* cnam) { FILE *f, *gf, *cf, *ccf; /* The EM input, the basic block graph, * the call-list file and the calcnt file. @@ -128,7 +128,7 @@ STATIC void pass1(const char* lnam, const char* bnam, const char* cnam) * be expanded in line. It does not use the EM text. */ -STATIC void pass2(const char* cnam, long space) +static void pass2(const char* cnam, long space) { FILE *cf, *cf2, *ccf; call_p c, a; @@ -247,13 +247,13 @@ void pass3(const char* lnam, const char* lnam2) } } -STATIC void il_extptab(proc_p ptab) +static void il_extptab(proc_p ptab) { /* Allocate space for extension of proctable entries. * Also, initialise some of the fields just allocated. */ - register proc_p p; + proc_p p; for (p = ptab; p != (proc_p)0; p = p->p_next) { @@ -263,11 +263,11 @@ STATIC void il_extptab(proc_p ptab) } } -STATIC void il_cleanptab(proc_p ptab) +static void il_cleanptab(proc_p ptab) { /* De-allocate space for extensions */ - register proc_p p; + proc_p p; for (p = ptab; p != (proc_p)0; p = p->p_next) { @@ -276,7 +276,7 @@ STATIC void il_cleanptab(proc_p ptab) } #ifdef VERBOSE -STATIC void Sdiagnostics(void) +static void Sdiagnostics(void) { /* print statictical information */ diff --git a/util/ego/il/il1_anal.c b/util/ego/il/il1_anal.c index 3325508147..46a2387d7c 100644 --- a/util/ego/il/il1_anal.c +++ b/util/ego/il/il1_anal.c @@ -46,7 +46,7 @@ void apriori(proc_p proctab) * of the call list. */ - register proc_p p; + proc_p p; for (p = proctab; p != (proc_p)0; p = p->p_next) { @@ -69,7 +69,7 @@ void apriori(proc_p proctab) } } -STATIC void check_labels(proc_p p, arg_p arglist) +static void check_labels(proc_p p, arg_p arglist) { /* Check if any of the arguments contains an instruction * label; if so, make p unsuitable. @@ -90,7 +90,7 @@ STATIC void check_labels(proc_p p, arg_p arglist) } } -STATIC void anal_instr(proc_p p, bblock_p b, FILE* cf) +static void anal_instr(proc_p p, bblock_p b, FILE* cf) { /* Analyze the instructions of block b * within procedure p. @@ -100,7 +100,7 @@ STATIC void anal_instr(proc_p p, bblock_p b, FILE* cf) * the CAL instructions. */ - register line_p l; + line_p l; for (l = b->b_start; l != (line_p)0; l = l->l_next) { @@ -155,7 +155,7 @@ void anal_proc(proc_p p, FILE* cf, FILE* ccf) * its instructions. */ - register bblock_p b; + bblock_p b; bool fallthrough = TRUE; cchead = (calcnt_p)0; diff --git a/util/ego/il/il1_aux.c b/util/ego/il/il1_aux.c index 836d0ec3bb..a576dd4381 100644 --- a/util/ego/il/il1_aux.c +++ b/util/ego/il/il1_aux.c @@ -30,7 +30,7 @@ bool same_size(int t1, int t2) return tsize(t1) == tsize(t2); } -STATIC bool is_reg(offset off, int s) +static bool is_reg(offset off, int s) { /* See if there is a register message * for the local or parameter at offset off @@ -162,9 +162,9 @@ int proclength(proc_p p) { /* count the number of EM instructions of p */ - register int cnt; - register bblock_p b; - register line_p l; + int cnt; + bblock_p b; + line_p l; cnt = 0; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) diff --git a/util/ego/il/il1_cal.c b/util/ego/il/il1_cal.c index ef27f2ce73..c5158ecabb 100644 --- a/util/ego/il/il1_cal.c +++ b/util/ego/il/il1_cal.c @@ -22,7 +22,7 @@ #include "il1_aux.h" #include "../share/parser.h" -STATIC actual_p acts, *app; +static actual_p acts, *app; #define INIT_ACTS() \ { \ @@ -35,7 +35,7 @@ STATIC actual_p acts, *app; app = &a->ac_next; \ } -STATIC void make_actual(line_p l1, line_p l2, offset size) +static void make_actual(line_p l1, line_p l2, offset size) { /* Allocate a struct for a new actual parameter * expression, the code of which extends from @@ -50,7 +50,7 @@ STATIC void make_actual(line_p l1, line_p l2, offset size) APPEND_ACTUAL(a); /* append it to actual-list */ } -STATIC bool chck_asp(proc_p p, line_p l) +static bool chck_asp(proc_p p, line_p l) { /* We require a call to a procedure p that has n formal * parameters to be followed by an 'asp n' instruction @@ -63,7 +63,7 @@ STATIC bool chck_asp(proc_p p, line_p l) && SHORT(l) == p->p_nrformals)); } -STATIC void inc_count(proc_p caller, proc_p callee) +static void inc_count(proc_p caller, proc_p callee) { /* Update the call-count information. * Record the fact that there is one more call diff --git a/util/ego/il/il1_formal.c b/util/ego/il/il1_formal.c index 15c3e31bd0..cbd5bd145f 100644 --- a/util/ego/il/il1_formal.c +++ b/util/ego/il/il1_formal.c @@ -71,7 +71,7 @@ formal_p find_formal(proc_p p, int type, offset off) return nf; } -STATIC void no_inl_pars(proc_p p) +static void no_inl_pars(proc_p p) { /* p may not have any in line parameters */ @@ -79,7 +79,7 @@ STATIC void no_inl_pars(proc_p p) remov_formals(p); } -STATIC void inc_use(formal_p f, bblock_p b) +static void inc_use(formal_p f, bblock_p b) { /* Increment the use count of formal f. * The counter has only three states: not used, diff --git a/util/ego/il/il2_aux.c b/util/ego/il/il2_aux.c index f4bdb8d565..1f0659b925 100644 --- a/util/ego/il/il2_aux.c +++ b/util/ego/il/il2_aux.c @@ -35,10 +35,10 @@ #define IS_CHANGED(p) (p->p_flags2 & PF_CHANGED) #ifdef VERBOSE -STATIC void Sstat(proc_p proclist, long space); +static void Sstat(proc_p proclist, long space); #endif -STATIC bool match_pars(formal_p fm, actual_p act) +static bool match_pars(formal_p fm, actual_p act) { /* Check if every actual parameter has the same * size as its corresponding formal. If not, the @@ -57,7 +57,7 @@ STATIC bool match_pars(formal_p fm, actual_p act) return (fm == (formal_p)0 ? TRUE : FALSE); } -STATIC bool change_act(proc_p p, actual_p act) +static bool change_act(proc_p p, actual_p act) { /* See if a call to p migth change any of the * operands of the actual parameter expression. @@ -99,7 +99,7 @@ STATIC bool change_act(proc_p p, actual_p act) return FALSE; } -STATIC bool is_simple(line_p expr) +static bool is_simple(line_p expr) { /* See if expr is something simple, i.e. a constant or * a variable. So the expression must consist of @@ -122,7 +122,7 @@ STATIC bool is_simple(line_p expr) return FALSE; } -STATIC bool too_expensive(formal_p fm, actual_p act) +static bool too_expensive(formal_p fm, actual_p act) { /* If the formal parameter is used often and the * actual parameter is not something simple @@ -174,7 +174,7 @@ bool anal_params(call_p c) return TRUE; } -STATIC short space_saved(call_p c) +static short space_saved(call_p c) { /* When a call gets expanded in line, the total size of the * code usually gets incremented, because we have to @@ -190,7 +190,7 @@ STATIC short space_saved(call_p c) return (1 + (c->cl_flags & CLF_INLPARS) + (c->cl_proc->p_nrformals > 0)); } -STATIC short param_score(call_p c) +static short param_score(call_p c) { /* If a call has an inline parameter that is a constant, * chances are high that other optimization techniques @@ -198,7 +198,7 @@ STATIC short param_score(call_p c) * happens to be "0". So the call gets extra points for this. */ - register actual_p act; + actual_p act; line_p l; short score = 0; @@ -289,7 +289,7 @@ call_p abstract(call_p c) return a; } -STATIC void adjust_counts(proc_p callee, FILE* ccf) +static void adjust_counts(proc_p callee, FILE* ccf) { /* A call to callee is expanded in line; * the text of callee is not removed, so @@ -307,7 +307,7 @@ STATIC void adjust_counts(proc_p callee, FILE* ccf) remcc(head); /* remove calcnt info */ } -STATIC bool is_dispensable(proc_p callee, FILE* ccf) +static bool is_dispensable(proc_p callee, FILE* ccf) { /* A call to callee is expanded in line. * Decrement its P_NRCALLED field and see if @@ -334,7 +334,7 @@ STATIC bool is_dispensable(proc_p callee, FILE* ccf) } } -STATIC call_p nested_calls(call_p a) +static call_p nested_calls(call_p a) { /* Get a list of all calls that will appear in the * EM text if the call 'a' is expanded in line. @@ -362,14 +362,14 @@ STATIC call_p nested_calls(call_p a) return head; } -STATIC call_p find_origin(call_p c) +static call_p find_origin(call_p c) { /* c is a nested call. Find the original call. * This origional must be in the P_CALS list * of the calling procedure. */ - register call_p x; + call_p x; for (x = c->cl_caller->P_CALS; x != (call_p)0; x = x->cl_cdr) { @@ -380,7 +380,7 @@ STATIC call_p find_origin(call_p c) UNREACHABLE_CODE; } -STATIC void selected(call_p a) +static void selected(call_p a) { /* The call a is selected for in line expansion. * Mark the call as being selected and get the @@ -393,7 +393,7 @@ STATIC void selected(call_p a) a->cl_car = nested_calls(a); } -STATIC void compare(call_p x, call_p* best, long space) +static void compare(call_p x, call_p* best, long space) { /* See if x is better than the current best choice */ @@ -407,7 +407,7 @@ STATIC void compare(call_p x, call_p* best, long space) } } -STATIC call_p best_one(call_p list, long space) +static call_p best_one(call_p list, long space) { /* Find the best candidate of the list * that has not already been selected. The @@ -433,7 +433,7 @@ STATIC call_p best_one(call_p list, long space) return best; } -STATIC void singles(call_p cals) +static void singles(call_p cals) { /* If a procedure is only called once, this call * will be expanded in line, because it costs @@ -468,7 +468,7 @@ STATIC void singles(call_p cals) } } -STATIC void single_calls(proc_p proclist) +static void single_calls(proc_p proclist) { proc_p p; @@ -485,7 +485,7 @@ STATIC void single_calls(proc_p proclist) } } -STATIC void unused(proc_p proclist) +static void unused(proc_p proclist) { /* See if any procedures are defined but will * never be called. These can be safely removed. @@ -566,9 +566,9 @@ void select_calls(proc_p proclist, FILE* ccf, long space) #endif } -STATIC void nonnested_calls(FILE* cfile) +static void nonnested_calls(FILE* cfile) { - register call_p c, a; + call_p c, a; while ((c = getcall(cfile)) != (call_p)0) { @@ -585,7 +585,7 @@ STATIC void nonnested_calls(FILE* cfile) } } -STATIC void copy_pars(call_p src, call_p dest) +static void copy_pars(call_p src, call_p dest) { /* Copy the actual parameters of src to dest. */ @@ -603,7 +603,7 @@ STATIC void copy_pars(call_p src, call_p dest) } } -STATIC void nest_pars(call_p cals) +static void nest_pars(call_p cals) { /* Recursive auxiliary procedure of add_actuals. */ @@ -644,7 +644,7 @@ void add_actuals(proc_p proclist, FILE* cfile) } } -STATIC void clean(call_p* cals) +static void clean(call_p* cals) { call_p c, next, *cpp; @@ -674,7 +674,7 @@ void cleancals(proc_p proclist) * that were not selected for in line expansion. */ - register proc_p p; + proc_p p; for (p = proclist; p != (proc_p)0; p = p->p_next) { @@ -708,7 +708,7 @@ void append_abstract(call_p a, proc_p p) * remaining calls were not expanded inline. */ -STATIC void Sstatist(call_p list, long space) +static void Sstatist(call_p list, long space) { call_p c; @@ -734,7 +734,7 @@ STATIC void Sstatist(call_p list, long space) } } -STATIC void Sstat(proc_p proclist, long space) +static void Sstat(proc_p proclist, long space) { proc_p p; diff --git a/util/ego/il/il3_aux.c b/util/ego/il/il3_aux.c index 9b42f72d23..c54681dbca 100644 --- a/util/ego/il/il3_aux.c +++ b/util/ego/il/il3_aux.c @@ -19,7 +19,7 @@ line_p last_line(line_p lines) { /* Determine the last line of a list */ - register line_p l; + line_p l; assert(lines != (line_p)0); for (l = lines; l->l_next != (line_p)0; l = l->l_next) diff --git a/util/ego/il/il3_change.c b/util/ego/il/il3_change.c index 6855321ee5..62a5122310 100644 --- a/util/ego/il/il3_change.c +++ b/util/ego/il/il3_change.c @@ -30,7 +30,7 @@ /* chg_callseq */ -STATIC line_p par_expr(line_p l, line_p expr) +static line_p par_expr(line_p l, line_p expr) { /* Find the first line of the expression of which * l is the last line; expr contains a pointer @@ -48,7 +48,7 @@ STATIC line_p par_expr(line_p l, line_p expr) return l; } -STATIC void rem_text(line_p l1, line_p l2) +static void rem_text(line_p l1, line_p l2) { /* Remove the lines from l1 to l2 (inclusive) */ @@ -61,7 +61,7 @@ STATIC void rem_text(line_p l1, line_p l2) } } -STATIC void store_tmp(proc_p p, line_p l, offset size) +static void store_tmp(proc_p p, line_p l, offset size) { /* Emit code to store a 'size'-byte value in a new * temporary local variable in the stack frame of p. @@ -96,7 +96,7 @@ STATIC void store_tmp(proc_p p, line_p l, offset size) appnd_line(lnp, l); } -STATIC void chg_actuals(call_p c, line_p cal) +static void chg_actuals(call_p c, line_p cal) { /* Change the actual parameter expressions of the call. */ @@ -124,7 +124,7 @@ STATIC void chg_actuals(call_p c, line_p cal) } } -STATIC void rm_callpart(call_p c, line_p cal) +static void rm_callpart(call_p c, line_p cal) { /* Remove the call part, consisting of a CAL, * an optional ASP and an optional LFR. @@ -185,7 +185,7 @@ line_p make_label(line_p l, proc_p p) /* modify */ -STATIC void act_info(offset off, actual_p acts, offset ab_off, actual_p* act_out, offset* off_out) +static void act_info(offset off, actual_p acts, offset ab_off, actual_p* act_out, offset* off_out) { /* Find the actual parameter that corresponds to * the formal parameter with the given offset. @@ -223,7 +223,7 @@ STATIC void act_info(offset off, actual_p acts, offset ab_off, actual_p* act_out assert(FALSE); } -STATIC void store_off(offset off, line_p l) +static void store_off(offset off, line_p l) { if (TYPE(l) == OPSHORT) { @@ -236,7 +236,7 @@ STATIC void store_off(offset off, line_p l) } } -STATIC void inl_actual(line_p l, line_p expr) +static void inl_actual(line_p l, line_p expr) { /* Expand an actual parameter in line. * A LOL or LDL instruction is replaced @@ -266,7 +266,7 @@ STATIC void inl_actual(line_p l, line_p expr) app_list(e, lnp); } -STATIC void localref(line_p l, call_p c, offset ab_off, offset lb_off) +static void localref(line_p l, call_p c, offset ab_off, offset lb_off) { /* Change a reference to a local variable or parameter * of the called procedure. @@ -297,7 +297,7 @@ STATIC void localref(line_p l, call_p c, offset ab_off, offset lb_off) } } -STATIC void chg_mes(line_p l, call_p c, offset ab_off, offset lb_off) +static void chg_mes(line_p l, call_p c, offset ab_off, offset lb_off) { /* The register messages of the called procedure * must be changed. If the message applies to a @@ -344,7 +344,7 @@ STATIC void chg_mes(line_p l, call_p c, offset ab_off, offset lb_off) } } -STATIC void chg_ret(line_p l, call_p c, line_p lab) +static void chg_ret(line_p l, call_p c, line_p lab) { /* Change the RET instruction appearing in the * expanded text of a call. If the called procedure @@ -365,7 +365,7 @@ STATIC void chg_ret(line_p l, call_p c, line_p lab) } } -STATIC void mod_instr(line_p l, call_p c, line_p lab, offset ab_off, offset lb_off, int lab_off) +static void mod_instr(line_p l, call_p c, line_p lab, offset ab_off, offset lb_off, int lab_off) { if (TYPE(l) == OPINSTRLAB) { @@ -418,7 +418,7 @@ void modify(line_p text, call_p c, line_p lab, offset ab_off, offset lb_off, int * Note that the first line of the text is a dummy instruction. */ - register line_p l; + line_p l; line_p next; for (l = text->l_next; l != (line_p)0; l = next) @@ -461,7 +461,7 @@ void mod_actuals(call_p nc, call_p c, line_p lab, offset ab_off, offset lb_off, /* insert */ -STATIC line_p first_nonpseudo(line_p l) +static line_p first_nonpseudo(line_p l) { /* Find the first non-pseudo instruction of * a list of instructions. diff --git a/util/ego/il/il3_subst.c b/util/ego/il/il3_subst.c index 8c3c6fb789..9da0003f37 100644 --- a/util/ego/il/il3_subst.c +++ b/util/ego/il/il3_subst.c @@ -22,7 +22,7 @@ #include "il3_change.h" #include "il3_subst.h" -STATIC line_p fetch_text(FILE* lf, call_p c) +static line_p fetch_text(FILE* lf, call_p c) { /* Read the EM text of the called procedure. * We use random access I/O here. @@ -46,7 +46,7 @@ line_p scan_to_cal(line_p lines, short n) { /* Find the n-th CAL instruction */ - register line_p l; + line_p l; for (l = lines; l != (line_p)0; l = l->l_next) { diff --git a/util/ego/il/il_aux.c b/util/ego/il/il_aux.c index 6978199589..e08c564578 100644 --- a/util/ego/il/il_aux.c +++ b/util/ego/il/il_aux.c @@ -133,10 +133,10 @@ void rem_call(call_p c) /* remunit */ -STATIC void remlines(line_p l) +static void remlines(line_p l) { - register line_p lnp; + line_p lnp; line_p next; for (lnp = l; lnp != (line_p)0; lnp = next) @@ -148,7 +148,7 @@ STATIC void remlines(line_p l) void remunit(short kind, proc_p p, line_p l) { - register bblock_p b; + bblock_p b; bblock_p next; Lindex pi; @@ -301,7 +301,7 @@ calcnt_p getcc(FILE* ccf, proc_p p) /* The following routines are only used by the Inline Substitution phase */ -STATIC void putactuals(actual_p alist, FILE* cfile) +static void putactuals(actual_p alist, FILE* cfile) { /* output a list of actual parameters */ diff --git a/util/ego/lv/lv.c b/util/ego/lv/lv.c index 80546ef414..9a18c5b9c5 100644 --- a/util/ego/lv/lv.c +++ b/util/ego/lv/lv.c @@ -36,12 +36,12 @@ short nrvars; -STATIC int Slv; -STATIC bool mesgflag = FALSE; /* Suppress generation of live/dead info */ +static int Slv; +static bool mesgflag = FALSE; /* Suppress generation of live/dead info */ -STATIC void app_block(line_p l, bblock_p b); +static void app_block(line_p l, bblock_p b); -STATIC void clean_up(void) +static void clean_up(void) { local_p* p; @@ -52,7 +52,7 @@ STATIC void clean_up(void) oldmap((void**)locals, nrlocals); } -STATIC bool is_dir_use(line_p l) +static bool is_dir_use(line_p l) { /* See if l is a direct use of some variable * (i.e. not through a pointer). A LIL is a @@ -84,7 +84,7 @@ STATIC bool is_dir_use(line_p l) UNREACHABLE_CODE; } -STATIC bool is_indir_use(line_p l) +static bool is_indir_use(line_p l) { /* See if instruction l uses some variable(s) indirectly, * i.e. through a pointer or via a procedure call. @@ -110,7 +110,7 @@ STATIC bool is_indir_use(line_p l) UNREACHABLE_CODE; } -STATIC bool is_def(line_p l) +static bool is_def(line_p l) { /* See if l does a direct definition */ @@ -129,7 +129,7 @@ STATIC bool is_def(line_p l) UNREACHABLE_CODE; } -STATIC void def_use(proc_p p) +static void def_use(proc_p p) { /* Compute DEF(b) and USE(b), for every basic block b * of procedure p. DEF(b) contains the variables that @@ -142,8 +142,8 @@ STATIC void def_use(proc_p p) * the basic block from beginning till end. */ - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; short v; bool found; cset all_ind_uses; @@ -200,7 +200,7 @@ STATIC void def_use(proc_p p) Cdeleteset(all_ind_uses); } -STATIC void unite_ins(lset bbset, cset* setp) +static void unite_ins(lset bbset, cset* setp) { /* Take the union of L_IN(b), for all b in bbset, * and put the result in setp. @@ -215,7 +215,7 @@ STATIC void unite_ins(lset bbset, cset* setp) } } -STATIC void solve_lv(proc_p p) +static void solve_lv(proc_p p) { /* Solve the data flow equations for Live Variables, * for procedure p. These equations are: @@ -224,7 +224,7 @@ STATIC void solve_lv(proc_p p) * where SUCC(b) = {s1, ... , sn} */ - register bblock_p b; + bblock_p b; cset newout = Cempty_set(nrvars); bool change = TRUE; @@ -253,7 +253,7 @@ STATIC void solve_lv(proc_p p) Cdeleteset(newout); } -STATIC void live_variables_analysis(proc_p p) +static void live_variables_analysis(proc_p p) { make_localtab(p); nrvars = nrglobals + nrlocals; @@ -261,13 +261,13 @@ STATIC void live_variables_analysis(proc_p p) solve_lv(p); } -STATIC void init_live_dead(bblock_p b) +static void init_live_dead(bblock_p b) { /* For every register variable, see if it is * live or dead at the end of b. */ - register short v; + short v; local_p loc; for (v = 1; v <= nrlocals; v++) @@ -284,7 +284,7 @@ STATIC void init_live_dead(bblock_p b) } } -STATIC line_p make_mesg(short mesg, local_p loc) +static line_p make_mesg(short mesg, local_p loc) { /* Create a line for a message stating that * local variable loc is live/dead. This message @@ -293,7 +293,7 @@ STATIC line_p make_mesg(short mesg, local_p loc) */ line_p l = newline(OPLIST); - register arg_p ap; + arg_p ap; l->l_instr = ps_mes; ap = ARG(l) = newarg(ARGOFF); @@ -307,7 +307,7 @@ STATIC line_p make_mesg(short mesg, local_p loc) return l; } -STATIC void block_entry(bblock_p b, bblock_p prev) +static void block_entry(bblock_p b, bblock_p prev) { short v, vn; local_p loc; @@ -342,7 +342,7 @@ STATIC void block_entry(bblock_p b, bblock_p prev) } } -STATIC void app_block(line_p l, bblock_p b) +static void app_block(line_p l, bblock_p b) { line_p x = b->b_start; @@ -367,7 +367,7 @@ STATIC void app_block(line_p l, bblock_p b) } } -STATIC void definition(line_p l, bool* useless_out, short* v_out, bool mesgflag) +static void definition(line_p l, bool* useless_out, short* v_out, bool mesgflag) { /* Process a definition. If the defined (register-) variable * is live after 'l', then create a live-message and put @@ -389,7 +389,7 @@ STATIC void definition(line_p l, bool* useless_out, short* v_out, bool mesgflag) /* Tricky stuff here. Make sure that a variable that is assigned to is alive, at least for a very very short time. Otherwize, the - register allocation pass might think that it + allocation pass might think that it is never alive, and (incorrectly) use the same register for this variable as for another variable, that is alive at this point. @@ -418,7 +418,7 @@ STATIC void definition(line_p l, bool* useless_out, short* v_out, bool mesgflag) } } -STATIC void use(line_p l, bool mesgflag) +static void use(line_p l, bool mesgflag) { /* Process a use. If the defined (register-) variable * is dead after 'l', then create a dead-message and put @@ -445,11 +445,11 @@ STATIC void use(line_p l, bool mesgflag) } /* ARGSUSED */ -STATIC void nothing(line_p l1, line_p l2, offset size) +static void nothing(line_p l1, line_p l2, offset size) { } /* No action to be undertaken at level 0 of parser */ -STATIC void rem_code(line_p l1, line_p l2, bblock_p b) +static void rem_code(line_p l1, line_p l2, bblock_p b) { line_p l, x, y, next; @@ -476,7 +476,7 @@ STATIC void rem_code(line_p l1, line_p l2, bblock_p b) #define SIZE(v) ((offset)locals[TO_LOCAL(v)]->lc_size) -STATIC void lv_mesg(proc_p p, bool mesgflag) +static void lv_mesg(proc_p p, bool mesgflag) { /* Create live/dead messages for every possible register * variable of p. A dead-message is put after a "use" of @@ -503,8 +503,8 @@ STATIC void lv_mesg(proc_p p, bool mesgflag) * On the fly, useless assignments are removed. */ - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; line_p lnp, prev; bblock_p prevb = (bblock_p)0; short v; @@ -555,11 +555,11 @@ STATIC void lv_mesg(proc_p p, bool mesgflag) } } -STATIC void lv_extend(proc_p p) +static void lv_extend(proc_p p) { /* Allocate extended data structures for Use Definition analysis */ - register bblock_p b; + bblock_p b; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -567,11 +567,11 @@ STATIC void lv_extend(proc_p p) } } -STATIC void lv_cleanup(proc_p p) +static void lv_cleanup(proc_p p) { /* Deallocate extended data structures for Use Definition analysis */ - register bblock_p b; + bblock_p b; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { diff --git a/util/ego/ra/ra.c b/util/ego/ra/ra.c index dbf318aa77..9f39693e5f 100644 --- a/util/ego/ra/ra.c +++ b/util/ego/ra/ra.c @@ -36,7 +36,7 @@ #define oldrabx(x) oldstruct(bext_ra, x) #define oldralpx(x) oldstruct(lpext_ra, x) -STATIC void stat_regusage(alloc_p list); +static void stat_regusage(alloc_p list); short alloc_id; static item_p items[NRITEMTYPES]; @@ -58,7 +58,7 @@ short regs_available[] = { short use_any_as_pointer = 0; -STATIC cond_p getcondtab(FILE* f) +static cond_p getcondtab(FILE* f) { int l, i; cond_p tab; @@ -73,7 +73,7 @@ STATIC cond_p getcondtab(FILE* f) return tab; } -STATIC void get_atab(FILE* f, cond_p tab[NRREGTYPES][NRREGTYPES]) +static void get_atab(FILE* f, cond_p tab[NRREGTYPES][NRREGTYPES]) { int i, cnt, totyp, regtyp; @@ -87,7 +87,7 @@ STATIC void get_atab(FILE* f, cond_p tab[NRREGTYPES][NRREGTYPES]) } } -STATIC void get_otab(FILE* f, cond_p tab[NRREGTYPES]) +static void get_otab(FILE* f, cond_p tab[NRREGTYPES]) { int i, cnt, regtyp; @@ -100,7 +100,7 @@ STATIC void get_otab(FILE* f, cond_p tab[NRREGTYPES]) } } -STATIC void ra_machinit(void* vp) +static void ra_machinit(void* vp) { /* Read target machine dependent information for this phase */ FILE* f = vp; @@ -133,7 +133,7 @@ STATIC void ra_machinit(void* vp) regsav_cost = getcondtab(f); } -STATIC bblock_p header(loop_p lp) +static bblock_p header(loop_p lp) { /* Try to determine the 'header' block of loop lp. * If 'e' is the entry block of loop L, then block 'b' is @@ -152,13 +152,13 @@ STATIC bblock_p header(loop_p lp) return (bblock_p)0; } -STATIC void ra_extproc(proc_p p) +static void ra_extproc(proc_p p) { /* Allocate the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; - register bblock_p b; + loop_p lp; + Lindex pi; + bblock_p b; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { @@ -172,13 +172,13 @@ STATIC void ra_extproc(proc_p p) } } -STATIC void ra_cleanproc(proc_p p) +static void ra_cleanproc(proc_p p) { /* Allocate the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; - register bblock_p b; + loop_p lp; + Lindex pi; + bblock_p b; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { @@ -191,12 +191,12 @@ STATIC void ra_cleanproc(proc_p p) } } -STATIC void loop_blocks(proc_p p) +static void loop_blocks(proc_p p) { /* Compute the LP_BLOCKS sets for all loops of p */ - register bblock_p b; - register Lindex i; + bblock_p b; + Lindex i; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -207,13 +207,13 @@ STATIC void loop_blocks(proc_p p) } } -STATIC void make_instrmap(proc_p p, line_p map[]) +static void make_instrmap(proc_p p, line_p map[]) { /* make the instructions map of procedure p */ - register bblock_p b; - register line_p l; - register int i = 0; + bblock_p b; + line_p l; + int i = 0; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -226,7 +226,7 @@ STATIC void make_instrmap(proc_p p, line_p map[]) } } -STATIC bool useful_item(item_p item) +static bool useful_item(item_p item) { /* See if it may be useful to put the item in a register. * A local variable may always be put in a register. @@ -238,10 +238,10 @@ STATIC bool useful_item(item_p item) return nruses > 1 || item->it_type == LOCALVAR; } -STATIC void cleantimeset(lset s) +static void cleantimeset(lset s) { - register Lindex i; - register time_p t; + Lindex i; + time_p t; for (i = Lfirst(s); i != (Lindex)0; i = Lnext(i, s)) { @@ -251,13 +251,13 @@ STATIC void cleantimeset(lset s) Ldeleteset(s); } -STATIC item_p cat_items(item_p items[]) +static item_p cat_items(item_p items[]) { /* Make one item list out of an array of itemlists. * Remove items that are used only once. */ - register item_p it; + item_p it; item_p *ip, head, next; int t; @@ -283,9 +283,9 @@ STATIC item_p cat_items(item_p items[]) return head; } -STATIC void clean_interval(interv_p list) +static void clean_interval(interv_p list) { - register interv_p x, next; + interv_p x, next; for (x = list; x != (interv_p)0; x = next) { @@ -294,9 +294,9 @@ STATIC void clean_interval(interv_p list) } } -STATIC void clean_allocs(alloc_p list) +static void clean_allocs(alloc_p list) { - register alloc_p x, next; + alloc_p x, next; for (x = list; x != (alloc_p)0; x = next) { @@ -310,9 +310,9 @@ STATIC void clean_allocs(alloc_p list) } } -STATIC void cleanitems(item_p list) +static void cleanitems(item_p list) { - register item_p x, next; + item_p x, next; for (x = list; x != (item_p)0; x = next) { @@ -474,8 +474,8 @@ print_allocs(list) } #endif -STATIC short regs_needed[4]; -STATIC void stat_regusage(alloc_p list) +static short regs_needed[4]; +static void stat_regusage(alloc_p list) { int i; alloc_p x; @@ -501,7 +501,7 @@ int cnt_regtypes[reg_float+1]; statistics(items) item_p items[]; { - register item_p item,next; + item_p item,next; int t,r; int cnt; diff --git a/util/ego/ra/ra_allocl.c b/util/ego/ra/ra_allocl.c index 6473149a8a..95b3d701e2 100644 --- a/util/ego/ra/ra_allocl.c +++ b/util/ego/ra/ra_allocl.c @@ -27,7 +27,7 @@ #include "ra_allocl.h" #include "ra_interv.h" -STATIC void count_usage(proc_p p, item_p item, short nrloops, short sloopcnt[], short dloopcnt[]) +static void count_usage(proc_p p, item_p item, short nrloops, short sloopcnt[], short dloopcnt[]) { /* Determine how many times the item is used in every loop. * We maintain a 'static' count and a 'dynamic' count. The dynamic @@ -63,7 +63,7 @@ STATIC void count_usage(proc_p p, item_p item, short nrloops, short sloopcnt[], } } -STATIC alloc_p cons_alloc( +static alloc_p cons_alloc( item_p item, interv_p timespan, short stat_usecount, @@ -88,7 +88,7 @@ STATIC alloc_p cons_alloc( return x; } -STATIC void insert_alloc(alloc_p alloc, alloc_p* list_p) +static void insert_alloc(alloc_p alloc, alloc_p* list_p) { alloc->al_next = *list_p; *list_p = alloc; @@ -97,7 +97,7 @@ STATIC void insert_alloc(alloc_p alloc, alloc_p* list_p) #define MUST_INIT(i, b) (i->it_type != LOCALVAR || contains(b->B_BEGIN, i->it_lives)) #define MUST_UPDATE(i, b) (i->it_type == LOCALVAR && contains(b->B_BEGIN, i->it_lives)) -STATIC lset loop_inits(loop_p lp, item_p item, bblock_p header) +static lset loop_inits(loop_p lp, item_p item, bblock_p header) { /* Build the set of entry points to loop lp where item * must be initialized @@ -113,7 +113,7 @@ STATIC lset loop_inits(loop_p lp, item_p item, bblock_p header) #define IN_LOOP(b) (Lnrelems(b->b_loops) > 0) -STATIC bblock_p init_point(item_p item) +static bblock_p init_point(item_p item) { /* Find the most appropriate point to initialize any register * containing the item. We want to do the initialization as @@ -145,7 +145,7 @@ STATIC bblock_p init_point(item_p item) return dom; } -STATIC void add_blocks(bblock_p b, cset* s, interv_p* span) +static void add_blocks(bblock_p b, cset* s, interv_p* span) { Lindex pi; @@ -160,7 +160,7 @@ STATIC void add_blocks(bblock_p b, cset* s, interv_p* span) } } -STATIC void whole_lifetime(item_p item, bblock_p* ini_out, interv_p* span_out) +static void whole_lifetime(item_p item, bblock_p* ini_out, interv_p* span_out) { /* Find the initialization point and the time_span of the item, if * we put the item in a register during all its uses. @@ -187,7 +187,7 @@ STATIC void whole_lifetime(item_p item, bblock_p* ini_out, interv_p* span_out) *span_out = span; } -STATIC lset proc_inits(proc_p p, item_p item, bblock_p ini) +static lset proc_inits(proc_p p, item_p item, bblock_p ini) { lset s = Lempty_set(); @@ -199,7 +199,7 @@ STATIC lset proc_inits(proc_p p, item_p item, bblock_p ini) return s; } -STATIC bool updates_needed(loop_p lp, item_p item) +static bool updates_needed(loop_p lp, item_p item) { /* See if the value of item is live after the loop has * been exited, i.e. must the item be updated after the loop? @@ -223,7 +223,7 @@ STATIC bool updates_needed(loop_p lp, item_p item) return FALSE; } -STATIC short countuses(lset usage, bblock_p b) +static short countuses(lset usage, bblock_p b) { short cnt = 0; Lindex ti; @@ -238,7 +238,7 @@ STATIC short countuses(lset usage, bblock_p b) return cnt; } -STATIC void allocs_of_item( +static void allocs_of_item( proc_p p, item_p item, lset loops, @@ -246,7 +246,7 @@ STATIC void allocs_of_item( short* dloopcnt, /* dynamic arrays */ alloc_p* alloc_list_p) { - register Lindex li; + Lindex li; loop_p lp; bblock_p header, ini; short susecount, dusecount; @@ -308,7 +308,7 @@ STATIC void allocs_of_item( alloc_p build_alloc_list(proc_p p, short nrloops, item_p itemlist) { short *sloopcnt, *dloopcnt; /* dynamic arrays */ - register item_p item; + item_p item; alloc_p alloc_list = (alloc_p)0; sloopcnt = (short*)newtable(nrloops); @@ -335,7 +335,7 @@ void build_rivals_graph(alloc_p alloclist) * allocation. */ - register alloc_p alloc, x; + alloc_p alloc, x; for (alloc = alloclist; alloc != (alloc_p)0; alloc = alloc->al_next) { diff --git a/util/ego/ra/ra_interv.c b/util/ego/ra/ra_interv.c index 301d94c5b6..4fda76074d 100644 --- a/util/ego/ra/ra_interv.c +++ b/util/ego/ra/ra_interv.c @@ -36,7 +36,7 @@ void add_interval(short t1, short t2, interv_p* list) * putting adjacent intervals in one interval. */ - register interv_p x1, x2, *q; + interv_p x1, x2, *q; int adjacent = 0; interv_p x; @@ -90,8 +90,8 @@ interv_p loop_lifetime(loop_p lp) */ interv_p lt = 0; - register bblock_p b; - register Lindex bi; + bblock_p b; + Lindex bi; for (bi = Lfirst(lp->LP_BLOCKS); bi != (Lindex)0; bi = Lnext(bi, lp->LP_BLOCKS)) { @@ -105,14 +105,14 @@ interv_p proc_lifetime(proc_p p) { /* Determine the lifetime of an entire procedure */ - register bblock_p b; + bblock_p b; for (b = p->p_start; b->b_next != (bblock_p)0; b = b->b_next) ; return cons_interval(0, b->B_END); } -STATIC void set_min_max(interv_p* iv1, interv_p* iv2) +static void set_min_max(interv_p* iv1, interv_p* iv2) { /* Auxiliary routine of intersect */ @@ -205,7 +205,7 @@ bool not_disjoint(interv_p list1, interv_p list2) bool contains(short t, interv_p timespan) { - register interv_p iv; + interv_p iv; for (iv = timespan; iv != (interv_p)0; iv = iv->i_next) { diff --git a/util/ego/ra/ra_items.c b/util/ego/ra/ra_items.c index 8066bc3dde..61cba14ce9 100644 --- a/util/ego/ra/ra_items.c +++ b/util/ego/ra/ra_items.c @@ -61,7 +61,7 @@ bool is_item(line_p l) item_p item_of(offset off, item_p items[]) { - register item_p x; + item_p x; for (x = items[LOCALVAR]; x != (item_p)0; x = x->it_next) { @@ -93,7 +93,7 @@ void fill_item(item_p item, line_p l) } } -STATIC bool desirable(line_p l) +static bool desirable(line_p l) { /* See if it is really desirable to put the item of line l * in a register. We do not put an item in a register if it @@ -114,7 +114,7 @@ STATIC bool desirable(line_p l) return TRUE; } -STATIC int cmp_items(item_p a, item_p b) +static int cmp_items(item_p a, item_p b) { /* This routine defines the <, = and > relations between items, * used to sort them for fast lookup. @@ -146,7 +146,7 @@ bool same_item(item_p a, item_p b) return cmp_items(a, b) == 0; } -STATIC bool lt_item(item_p a, item_p b) +static bool lt_item(item_p a, item_p b) { return cmp_items(a, b) == -1; } @@ -167,7 +167,7 @@ STATIC bool lt_item(item_p a, item_p b) static item_p items[NRITEMTYPES]; /* items[i] points to the list of type i */ -STATIC short reg_type(item_p item) +static short reg_type(item_p item) { /* See which type of register the item should best be assigned to */ @@ -189,7 +189,7 @@ STATIC short reg_type(item_p item) UNREACHABLE_CODE; } -STATIC short item_size(item_p item) +static short item_size(item_p item) { /* Determine the size of the item (in bytes) */ @@ -212,7 +212,7 @@ STATIC short item_size(item_p item) UNREACHABLE_CODE; } -STATIC void init_item(item_p a, item_p b) +static void init_item(item_p a, item_p b) { a->it_type = b->it_type; switch (a->it_type) @@ -232,13 +232,13 @@ STATIC void init_item(item_p a, item_p b) a->it_desirable = b->it_desirable; } -STATIC void add_item(item_p item, time_p t, item_p items[]) +static void add_item(item_p item, time_p t, item_p items[]) { /* See if there was already a list element for item. In any * case record the fact that item is used at 't'. */ - register item_p x, *q; + item_p x, *q; q = &items[item->it_type]; /* each type has its own list */ for (x = *q; x != (item_p)0; x = *q) @@ -267,7 +267,7 @@ STATIC void add_item(item_p item, time_p t, item_p items[]) Ladd(t, &x->it_usage); } -STATIC void add_usage(line_p l, bblock_p b, item_p items[]) +static void add_usage(line_p l, bblock_p b, item_p items[]) { /* An item is used at line l. Add it to the list of items. * A local variable is only considered to be an item, if @@ -299,9 +299,9 @@ void build_itemlist(proc_p p, item_p items[], int* nrinstr_out) * As a side effect, determine the number of instructions of p. */ - register line_p l; - register bblock_p b; - register int cnt = 0; + line_p l; + bblock_p b; + int cnt = 0; clean_tab(items); for (b = p->p_start; b != (bblock_p)0; b = b->b_next) diff --git a/util/ego/ra/ra_lifet.c b/util/ego/ra/ra_lifet.c index 23f1194591..d4349452b5 100644 --- a/util/ego/ra/ra_lifet.c +++ b/util/ego/ra/ra_lifet.c @@ -51,8 +51,8 @@ void build_lifetimes(item_p items[]) * dead-message that is not a live -or dead message. */ - register line_p l; - register short now; + line_p l; + short now; item_p item; short last_code; diff --git a/util/ego/ra/ra_pack.c b/util/ego/ra/ra_pack.c index eba6998bba..c1cc81c88d 100644 --- a/util/ego/ra/ra_pack.c +++ b/util/ego/ra/ra_pack.c @@ -29,7 +29,7 @@ short regs_occupied[NRREGTYPES]; /* #occupied registers for reg_pointer, */ #define reg_available(t) (regs_available[t] > regs_occupied[t]) -STATIC void initregcount(void) +static void initregcount(void) { int t; @@ -39,7 +39,7 @@ STATIC void initregcount(void) } } -STATIC alloc_p make_dummy(void) +static alloc_p make_dummy(void) { alloc_p x; @@ -48,7 +48,7 @@ STATIC alloc_p make_dummy(void) return x; } -STATIC bool fits_in(alloc_p a, alloc_p b, bool* cont_item) +static bool fits_in(alloc_p a, alloc_p b, bool* cont_item) { /* See if allocation a can be assigned the same register as b. * Both allocations should be of the same register-type. @@ -75,14 +75,14 @@ STATIC bool fits_in(alloc_p a, alloc_p b, bool* cont_item) return b == (alloc_p)0; } -STATIC alloc_p find_fitting_alloc(alloc_p alloc, alloc_p packed) +static alloc_p find_fitting_alloc(alloc_p alloc, alloc_p packed) { /* Try to find and already packed allocation that is assigned * a register that may also be used for alloc. * We prefer allocations that have the same item as alloc. */ - register alloc_p x; + alloc_p x; alloc_p cand = (alloc_p)0; bool cont_item; @@ -98,18 +98,18 @@ STATIC alloc_p find_fitting_alloc(alloc_p alloc, alloc_p packed) return cand; } -STATIC bool room_for(alloc_p alloc, alloc_p packed) +static bool room_for(alloc_p alloc, alloc_p packed) { /* See if there is any register available for alloc */ return reg_available(alloc->al_regtype) || (find_fitting_alloc(alloc, packed) != (alloc_p)0); } -STATIC alloc_p best_alloc(alloc_p unpacked, alloc_p packed, bool time_opt) /* now unused */ +static alloc_p best_alloc(alloc_p unpacked, alloc_p packed, bool time_opt) /* now unused */ { /* Find the next best candidate */ - register alloc_p x, best; + alloc_p x, best; best = unpacked; /* dummy */ @@ -123,7 +123,7 @@ STATIC alloc_p best_alloc(alloc_p unpacked, alloc_p packed, bool time_opt) /* no return (best == unpacked ? (alloc_p)0 : best); } -STATIC alloc_p choose_location(alloc_p alloc, alloc_p packed, proc_p p) +static alloc_p choose_location(alloc_p alloc, alloc_p packed, proc_p p) { /* Decide in which register to put alloc */ @@ -146,7 +146,7 @@ STATIC alloc_p choose_location(alloc_p alloc, alloc_p packed, proc_p p) return fit; } -STATIC void update_lists(alloc_p alloc, alloc_p unpacked, alloc_p packed, alloc_p fit) +static void update_lists(alloc_p alloc, alloc_p unpacked, alloc_p packed, alloc_p fit) { /* 'alloc' has been granted a register; move it from the 'unpacked' * list to the 'packed' list. Also remove any allocation from 'unpacked' @@ -155,7 +155,7 @@ STATIC void update_lists(alloc_p alloc, alloc_p unpacked, alloc_p packed, alloc_ * 2. a timespan that overlaps the timespan of alloc. */ - register alloc_p x, q, next; + alloc_p x, q, next; q = unpacked; /* dummy element at head of list */ for (x = unpacked->al_next; x != (alloc_p)0; x = next) @@ -190,7 +190,7 @@ STATIC void update_lists(alloc_p alloc, alloc_p unpacked, alloc_p packed, alloc_ } } -STATIC short cum_profits(alloc_p alloc) +static short cum_profits(alloc_p alloc) { /* Add the profits of all allocations packed in the same * register as alloc (i.e. alloc and all its 'mates'). @@ -206,11 +206,11 @@ STATIC short cum_profits(alloc_p alloc) return sum; } -STATIC void best_cumprofits(alloc_p list, alloc_p* x_out, alloc_p* prev_out) +static void best_cumprofits(alloc_p list, alloc_p* x_out, alloc_p* prev_out) { /* Find the allocation with the best cummulative profits */ - register alloc_p x, prev, best_prev; + alloc_p x, prev, best_prev; short best = 0, cum; prev = list; @@ -235,7 +235,7 @@ STATIC void best_cumprofits(alloc_p list, alloc_p* x_out, alloc_p* prev_out) } } -STATIC void account_regsave(alloc_p packed, alloc_p unpacked) +static void account_regsave(alloc_p packed, alloc_p unpacked) { /* After all packing has been done, we check for every allocated * register whether it is really advantageous to use this @@ -285,13 +285,13 @@ STATIC void account_regsave(alloc_p packed, alloc_p unpacked) oldalloc(checked); } -STATIC bool in_single_reg(item_p item, alloc_p packed) +static bool in_single_reg(item_p item, alloc_p packed) { /* See if item is allocated in only one register (i.e. not in * several different registers during several parts of its lifetime. */ - register alloc_p x, m; + alloc_p x, m; bool seen = FALSE; for (x = packed->al_next; x != (alloc_p)0; x = x->al_next) @@ -310,9 +310,9 @@ STATIC bool in_single_reg(item_p item, alloc_p packed) return TRUE; } -STATIC alloc_p find_prev(alloc_p alloc, alloc_p list) +static alloc_p find_prev(alloc_p alloc, alloc_p list) { - register alloc_p x; + alloc_p x; assert(alloc != (alloc_p)0); for (x = list; x->al_next != alloc; x = x->al_next) @@ -326,7 +326,7 @@ STATIC alloc_p find_prev(alloc_p alloc, alloc_p list) * account_regsave from rejecting it. */ -STATIC void repl_allocs(alloc_p new, alloc_p old, alloc_p packed) +static void repl_allocs(alloc_p new, alloc_p old, alloc_p packed) { alloc_p x, next, prev, *p; short prof = 0; @@ -356,9 +356,9 @@ STATIC void repl_allocs(alloc_p new, alloc_p old, alloc_p packed) new->al_profits = prof; } -STATIC void assemble_allocs(alloc_p packed) +static void assemble_allocs(alloc_p packed) { - register alloc_p x, m, next; + alloc_p x, m, next; alloc_p e; bool voidb; @@ -389,7 +389,7 @@ void pack(alloc_p alloclist, bool time_opt, alloc_p* packed_out, alloc_p* not_pa * the same registers (i.e. these allocations fit together). */ - register alloc_p x; + alloc_p x; alloc_p packed, unpacked, fit; initregcount(); diff --git a/util/ego/ra/ra_profits.c b/util/ego/ra/ra_profits.c index cb528468d9..6d08234054 100644 --- a/util/ego/ra/ra_profits.c +++ b/util/ego/ra/ra_profits.c @@ -18,7 +18,7 @@ #include "ra_aux.h" #include "ra_profits.h" -STATIC bool test_cond(short cond, offset val) +static bool test_cond(short cond, offset val) { switch (cond) { @@ -34,7 +34,7 @@ STATIC bool test_cond(short cond, offset val) UNREACHABLE_CODE; } -STATIC short map_value(struct cond_tab tab[], offset val, bool time) +static short map_value(struct cond_tab tab[], offset val, bool time) { cond_p p; @@ -47,7 +47,7 @@ STATIC short map_value(struct cond_tab tab[], offset val, bool time) } } -STATIC short index_value(struct cond_tab tab[], short n, bool time) +static short index_value(struct cond_tab tab[], short n, bool time) { cond_p p; @@ -55,7 +55,7 @@ STATIC short index_value(struct cond_tab tab[], short n, bool time) return (time ? p->mc_tval : p->mc_sval); } -STATIC void allocscore( +static void allocscore( short itemtyp, short localtyp, short size, @@ -104,7 +104,7 @@ STATIC void allocscore( */ } -STATIC void +static void opening_cost(short itemtyp, short localtyp, offset off, short* time_out, short* space_out) { cond_p m; @@ -157,7 +157,7 @@ void regsave_cost(short regs[], short* time_out, short* space_out) */ } -STATIC short dyn_inits(lset inits) +static short dyn_inits(lset inits) { Lindex i; short sum = 0; @@ -178,7 +178,7 @@ void compute_profits(alloc_p alloclist, bool time_opt) * of register, we choose only the most advanteagous one. */ - register alloc_p alloc; + alloc_p alloc; short s, t, rtyp, maxsc; item_p item; short time, space, sc; diff --git a/util/ego/ra/ra_xform.c b/util/ego/ra/ra_xform.c index d4e0c05952..7e1bbb8390 100644 --- a/util/ego/ra/ra_xform.c +++ b/util/ego/ra/ra_xform.c @@ -86,7 +86,7 @@ void init_replacements(short psize, short wsize) * as a 'Load pointer' instruction. */ - register int i, j; + int i, j; short load_pointer; struct repl* r; @@ -131,19 +131,19 @@ void init_replacements(short psize, short wsize) } } -STATIC int repl_index(line_p l) +static int repl_index(line_p l) { return itemtab[INSTR(l) - sp_fmnem].id_replindex; } -STATIC bool is_current(alloc_p alloc, short t) +static bool is_current(alloc_p alloc, short t) { /* Is time t part of alloc's timespan? */ return contains(t, alloc->al_timespan); } -STATIC bool match_item(item_p item, line_p l) +static bool match_item(item_p item, line_p l) { /* See if the item used by l is the same one as 'item' */ struct item thisitem; @@ -159,13 +159,13 @@ STATIC bool match_item(item_p item, line_p l) return item->it_type == thisitem.it_type && same_item(item, &thisitem); } -STATIC alloc_p find_alloc(alloc_p alloclist, line_p l, short t) +static alloc_p find_alloc(alloc_p alloclist, line_p l, short t) { /* See if any of the allocations of the list applies to instruction * l at time t. */ - register alloc_p alloc, m; + alloc_p alloc, m; for (alloc = alloclist; alloc != (alloc_p)0; alloc = alloc->al_next) { @@ -180,7 +180,7 @@ STATIC alloc_p find_alloc(alloc_p alloclist, line_p l, short t) return (alloc_p)0; } -STATIC void replace_line(line_p l, bblock_p b, line_p list) +static void replace_line(line_p l, bblock_p b, line_p list) { if (b->b_start == l) { @@ -203,7 +203,7 @@ STATIC void replace_line(line_p l, bblock_p b, line_p list) oldline(l); } -STATIC line_p repl_code(line_p lnp, offset regnr) +static line_p repl_code(line_p lnp, offset regnr) { line_p head, *q, l, prev = (line_p)0; int i, index; @@ -238,7 +238,7 @@ STATIC line_p repl_code(line_p lnp, offset regnr) return head; } -STATIC void apply_alloc(bblock_p b, line_p l, alloc_p alloc) +static void apply_alloc(bblock_p b, line_p l, alloc_p alloc) { /* 'l' is an EM instruction using an item that will be put in * a register. Generate new code that uses the register instead @@ -277,7 +277,7 @@ STATIC void apply_alloc(bblock_p b, line_p l, alloc_p alloc) } } -STATIC int loaditem_tab[NRITEMTYPES][2] = { /* WS 2 * WS */ +static int loaditem_tab[NRITEMTYPES][2] = { /* WS 2 * WS */ /*LOCALVAR*/ op_lol, op_ldl, /*LOCAL_ADDR*/ op_lal, op_lal, /*GLOBL_ADDR*/ op_lae, op_lae, @@ -286,7 +286,7 @@ STATIC int loaditem_tab[NRITEMTYPES][2] = { /* WS 2 * WS */ /*DCONST*/ op_nop, op_ldc }; -STATIC line_p load_item(item_p item) +static line_p load_item(item_p item) { /* Generate an EM instruction that loads the item on the stack */ @@ -310,7 +310,7 @@ STATIC line_p load_item(item_p item) return l; } -STATIC line_p store_local(short size, offset off) +static line_p store_local(short size, offset off) { line_p l = int_line(off); @@ -318,10 +318,10 @@ STATIC line_p store_local(short size, offset off) return l; } -STATIC line_p init_place(bblock_p b) +static line_p init_place(bblock_p b) { - register line_p l, prev; + line_p l, prev; prev = (line_p)0; for (l = b->b_start; l != (line_p)0; l = l->l_next) @@ -340,7 +340,7 @@ STATIC line_p init_place(bblock_p b) return prev; } -STATIC void append_code(line_p l1, line_p l2, bblock_p b) +static void append_code(line_p l1, line_p l2, bblock_p b) { /* Append instruction l1 and l2 at begin of block b */ @@ -365,14 +365,14 @@ STATIC void append_code(line_p l1, line_p l2, bblock_p b) } } -STATIC void emit_init_code(alloc_p list) +static void emit_init_code(alloc_p list) { /* Emit initialization code for all packed allocations. * This code looks like "dummy_local := item", e.g. * "LOC 25 ; STL -10" in EM terminology. */ - register alloc_p alloc, m; + alloc_p alloc, m; Lindex bi; bblock_p b; @@ -391,7 +391,7 @@ STATIC void emit_init_code(alloc_p list) } } -STATIC void emit_mesregs(proc_p p, alloc_p alloclist) +static void emit_mesregs(proc_p p, alloc_p alloclist) { line_p l, m, x; alloc_p alloc; @@ -410,10 +410,10 @@ STATIC void emit_mesregs(proc_p p, alloc_p alloclist) #define is_mesreg(l) (INSTR(l) == ps_mes && aoff(ARG(l), 0) == ms_reg) -STATIC void rem_mes(proc_p p) +static void rem_mes(proc_p p) { - register bblock_p b; - register line_p l, next; + bblock_p b; + line_p l, next; offset m; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) @@ -437,9 +437,9 @@ void xform_proc(proc_p p, alloc_p alloclist, short nrinstrs, line_p instrmap[]) * at a point where the item is kept in a register. */ - register short now = 0; - register line_p l, next; - register bblock_p b; + short now = 0; + line_p l, next; + bblock_p b; alloc_p alloc; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) diff --git a/util/ego/share/alloc.c b/util/ego/share/alloc.c index b1cd8ced87..ff8e21a6df 100644 --- a/util/ego/share/alloc.c +++ b/util/ego/share/alloc.c @@ -18,7 +18,7 @@ void* myalloc(size_t); #ifdef DEBUG -STATIC size_t maxuse, curruse; +static size_t maxuse, curruse; void* newcore(size_t size) { diff --git a/util/ego/share/cset.c b/util/ego/share/cset.c index 470e6374dd..99bc0c1b2b 100644 --- a/util/ego/share/cset.c +++ b/util/ego/share/cset.c @@ -108,7 +108,7 @@ Cindex Cfirst(cset s) Cindex Cnext(Cindex i, cset s) { - register short n; + short n; for (n = i + 1; n <= s->v_size; n++) { @@ -133,7 +133,7 @@ void Cjoin(cset s1, cset* s2_p) cset s2; short n; - register short i; + short i; s2 = *s2_p; assert(s1->v_size == s2->v_size); @@ -152,7 +152,7 @@ void Cintersect(cset s1, cset* s2_p) cset s2; short n; - register short i; + short i; s2 = *s2_p; assert(s1->v_size == s2->v_size); @@ -172,7 +172,7 @@ bool Cis_subset(cset s1, cset s2) { /* See if s1 is a subset of s2 */ - register short i; + short i; assert(s1->v_size == s2->v_size); if (s1->v_size == 0) @@ -190,7 +190,7 @@ bool Cis_subset(cset s1, cset s2) void Cclear_set(cset* s_p) { cset s; - register short i; + short i; s = *s_p; assert(s != (cset)0); @@ -203,7 +203,7 @@ void Cclear_set(cset* s_p) void Ccopy_set(cset s1, cset* s2_p) { cset s2; - register short i; + short i; s2 = *s2_p; assert(s1->v_size == s2->v_size); @@ -216,7 +216,7 @@ void Ccopy_set(cset s1, cset* s2_p) void Csubtract(cset s1, cset* s2_p) { cset s2; - register short i; + short i; s2 = *s2_p; assert(s1->v_size == s2->v_size); @@ -228,7 +228,7 @@ void Csubtract(cset s1, cset* s2_p) bool Cequal(cset s1, cset s2) { - register short i; + short i; assert(s1->v_size == s2->v_size); for (i = 0; i <= DIVWL(s1->v_size - 1); i++) @@ -241,7 +241,7 @@ bool Cequal(cset s1, cset s2) short Cnrelems(cset s) { - register short n, cnt; + short n, cnt; cnt = 0; for (n = 1; n <= s->v_size; n++) diff --git a/util/ego/share/debug.h b/util/ego/share/debug.h index 16c7001089..c2b27c8bdc 100644 --- a/util/ego/share/debug.h +++ b/util/ego/share/debug.h @@ -31,8 +31,6 @@ void OUTVERBOSE(const char*, int, int); * global when debugging. */ -#define STATIC - void VI(short); void VL(line_p); void VD(dblock_p); @@ -42,7 +40,6 @@ void VP(proc_p); #else /*DEBUG*/ -#define STATIC static #define NDEBUG /* disable assert() */ #define VI(i) diff --git a/util/ego/share/get.c b/util/ego/share/get.c index 64cdb7f86b..a52a3267c8 100644 --- a/util/ego/share/get.c +++ b/util/ego/share/get.c @@ -50,7 +50,7 @@ lab_id freshlabel(void) short getshort(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = getbyte(); h_byte = getbyte(); @@ -61,8 +61,8 @@ short getshort(void) offset getoff(void) { - register long l; - register int h_byte; + long l; + int h_byte; l = getbyte(); l |= ((unsigned)getbyte()) * 256; @@ -73,7 +73,7 @@ offset getoff(void) return l | (h_byte * 256L * 256 * 256L); } -STATIC int getint(void) +static int getint(void) { /* Read an integer from the input file. This routine is * only used when reading a bitvector-set. We expect an @@ -94,7 +94,7 @@ STATIC int getint(void) /* getptable */ -STATIC void* getloop(loop_id id) +static void* getloop(loop_id id) { /* Map a loop identifier onto a loop struct. * If no struct was alocated yet for this identifier then @@ -110,7 +110,7 @@ STATIC void* getloop(loop_id id) return (lpmap[id]); } -STATIC void* getblock(block_id id) +static void* getblock(block_id id) { /* Map a basic block identifier onto a block struct * If no struct was alocated yet for this identifier then @@ -128,7 +128,7 @@ STATIC void* getblock(block_id id) return (bmap[id]); } -STATIC lset getlset(void* (*p)(short)) +static lset getlset(void* (*p)(short)) { /* Read a 'long' set. Such a set is represented externally * as a sequence of identifying numbers terminated by a 0. @@ -147,14 +147,14 @@ STATIC lset getlset(void* (*p)(short)) return s; } -STATIC cset getcset(void) +static cset getcset(void) { /* Read a 'compact' set. Such a set is represented externally * a row of bytes (its bitvector) preceded by its length. */ cset s; - register short i; + short i; s = Cempty_set(getshort()); for (i = 0; i <= DIVWL(s->v_size - 1); i++) @@ -294,7 +294,7 @@ dblock_p getdtable(const char* dname) /* getbblocks */ -STATIC void argstring(short length, argb_p abp) +static void argstring(short length, argb_p abp) { while (length--) @@ -305,7 +305,7 @@ STATIC void argstring(short length, argb_p abp) } } -STATIC arg_p readargs(void) +static arg_p readargs(void) { /* Read a list of arguments and allocate structures * for them. Return a pointer to the head of the list. diff --git a/util/ego/share/go.c b/util/ego/share/go.c index e7cfea5eae..2fdf8468e6 100644 --- a/util/ego/share/go.c +++ b/util/ego/share/go.c @@ -22,12 +22,12 @@ #include "go.h" #include "files.h" -STATIC bool report_flag = FALSE; /* report #optimizations found? */ +static bool report_flag = FALSE; /* report #optimizations found? */ #ifdef DEBUG -STATIC bool core_flag = FALSE; /* report core usage? */ +static bool core_flag = FALSE; /* report core usage? */ #endif -STATIC void mach_init(char* machfile, void (*phase_machinit)(void*)) +static void mach_init(char* machfile, void (*phase_machinit)(void*)) { /* Read target machine dependent information */ diff --git a/util/ego/share/locals.c b/util/ego/share/locals.c index 1b04cb0527..7ee72c7b43 100644 --- a/util/ego/share/locals.c +++ b/util/ego/share/locals.c @@ -28,7 +28,7 @@ short nrglobals; short nrlocals; local_p* locals; /* dynamic array */ -STATIC void localvar(offset off, short size, local_p* locs, bool reg, offset score) +static void localvar(offset off, short size, local_p* locs, bool reg, offset score) { /* process a reference to a local variable. * A local is characterized by a (offset,size) pair. @@ -69,7 +69,7 @@ STATIC void localvar(offset off, short size, local_p* locs, bool reg, offset sco } } -STATIC void check_message(line_p l, local_p* locs) +static void check_message(line_p l, local_p* locs) { /* See if l is a register message */ @@ -82,7 +82,7 @@ STATIC void check_message(line_p l, local_p* locs) } } -STATIC void check_local_use(line_p l, local_p* locs) +static void check_local_use(line_p l, local_p* locs) { short sz; @@ -131,8 +131,8 @@ void make_localtab(proc_p p) local_p locallist = (local_p)0; short cnt = 0; offset x, ill_zone = 0; - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; /* first make a list of all locals used */ for (b = p->p_start; b != (bblock_p)0; b = b->b_next) diff --git a/util/ego/share/lset.c b/util/ego/share/lset.c index 749e80e133..c1e4927842 100644 --- a/util/ego/share/lset.c +++ b/util/ego/share/lset.c @@ -70,7 +70,7 @@ void Lremove(Lelem_t x, lset* s_p) * the set, nothing happens. */ - register elem_p *epp, ep; + elem_p *epp, ep; lset s; s = *s_p; @@ -129,7 +129,7 @@ void Ljoin(lset s1, lset* s2_p) * first set becomes undefined). */ - register elem_p *epp, ep; + elem_p *epp, ep; lset s2; /* First all elements of s1 that are also an element of s2 @@ -162,7 +162,7 @@ void Ljoin(lset s1, lset* s2_p) void Ldeleteset(lset s) { - register elem_p ep, next; + elem_p ep, next; for (ep = s; ep != (elem_p)0; ep = next) { @@ -175,7 +175,7 @@ bool Lis_subset(lset s1, lset s2) { /* See if s1 is a subset of s2 */ - register Lindex i; + Lindex i; for (i = Lfirst(s1); i != (Lindex)0; i = Lnext(i, s1)) { @@ -189,8 +189,8 @@ short Lnrelems(lset s) { /* Compute the number of elements of a set */ - register elem_p ep; - register short cnt; + elem_p ep; + short cnt; cnt = 0; for (ep = s; ep != (elem_p)0; ep = ep->e_next) diff --git a/util/ego/share/parser.c b/util/ego/share/parser.c index a5aa6de925..bc5d1cd953 100644 --- a/util/ego/share/parser.c +++ b/util/ego/share/parser.c @@ -41,7 +41,7 @@ typedef struct class* class_p; * generated automatically from the file classdefs.src. */ -STATIC bool classes(int instr, int* src_out, int* res_out) +static bool classes(int instr, int* src_out, int* res_out) { /* Determine the classes of the given instruction */ @@ -57,7 +57,7 @@ STATIC bool classes(int instr, int* src_out, int* res_out) return TRUE; } -STATIC bool uses_arg(int class) +static bool uses_arg(int class) { /* See if a member of the given class uses * an argument. @@ -78,7 +78,7 @@ STATIC bool uses_arg(int class) UNREACHABLE_CODE; } -STATIC bool uses_2args(int class) +static bool uses_2args(int class) { /* See if a member of the given class uses * 2 arguments. @@ -87,7 +87,7 @@ STATIC bool uses_2args(int class) return class == CLASS10; } -STATIC bool parse_locs(line_p l, offset* c1_out, offset* c2_out) +static bool parse_locs(line_p l, offset* c1_out, offset* c2_out) { if (INSTR(l) == op_loc && INSTR(PREV(l)) == op_loc) { @@ -98,7 +98,7 @@ STATIC bool parse_locs(line_p l, offset* c1_out, offset* c2_out) return FALSE; } -STATIC bool check_args(line_p l, int src_class, int res_class, offset* arg1_out, offset* arg2_out) +static bool check_args(line_p l, int src_class, int res_class, offset* arg1_out, offset* arg2_out) { /* Several EM instructions have an argument * giving the size of the operand(s) of @@ -138,7 +138,7 @@ STATIC bool check_args(line_p l, int src_class, int res_class, offset* arg1_out, return TRUE; /* no argument needed */ } -STATIC offset nrbytes(int class, offset arg1, offset arg2) +static offset nrbytes(int class, offset arg1, offset arg2) { /* Determine the number of bytes of the given * arguments and class. @@ -176,7 +176,7 @@ STATIC offset nrbytes(int class, offset arg1, offset arg2) return 0; } -STATIC void attrib(line_p l, offset* expect_out, offset* srcb_out, offset* resb_out) +static void attrib(line_p l, offset* expect_out, offset* srcb_out, offset* resb_out) { /* Determine a number of attributes of an EM * instruction appearing in an expression. diff --git a/util/ego/share/put.c b/util/ego/share/put.c index bd7f401f41..67718ded44 100644 --- a/util/ego/share/put.c +++ b/util/ego/share/put.c @@ -31,11 +31,11 @@ FILE* curoutp; /* putlines */ -STATIC void putstr(argb_p); -STATIC void outlab(lab_id); -STATIC void outobject(obj_p); +static void putstr(argb_p); +static void outlab(lab_id); +static void outobject(obj_p); -STATIC void putargs(arg_p ap) +static void putargs(arg_p ap) { while (ap != (arg_p)0) { @@ -69,7 +69,7 @@ STATIC void putargs(arg_p ap) outbyte((byte)ARGCEND); } -STATIC void putstr(argb_p abp) +static void putstr(argb_p abp) { argb_p tbp; int length; @@ -104,7 +104,7 @@ void outshort(short i) outbyte((byte)(i >> 8)); } -STATIC void outint(int i) +static void outint(int i) { /* Write an integer to the output file. This routine is * only used when outputting a bitvector-set. We expect an @@ -123,12 +123,12 @@ STATIC void outint(int i) } } -STATIC void outlab(lab_id lid) +static void outlab(lab_id lid) { outshort((short)lid); } -STATIC void outobject(obj_p obj) +static void outobject(obj_p obj) { outshort((short)obj->o_id); } @@ -144,7 +144,7 @@ short putlines(line_p l, FILE* lf) * Return the number of instruction written. */ - register line_p lnp; + line_p lnp; line_p next; short instr; short count = 0; @@ -188,7 +188,7 @@ short putlines(line_p l, FILE* lf) #define outmark(m) outbyte((byte)m) -STATIC void putobjects(obj_p obj) +static void putobjects(obj_p obj) { while (obj != (obj_p)0) { @@ -200,7 +200,7 @@ STATIC void putobjects(obj_p obj) } } -STATIC void putvalues(arg_p arg) +static void putvalues(arg_p arg) { while (arg != (arg_p)0) { @@ -214,10 +214,10 @@ void putdtable(dblock_p head, FILE* df) { /* Write the datablock table to the data block file df. */ - register dblock_p dbl; - register obj_p obj; + dblock_p dbl; + obj_p obj; dblock_p next; - register short n = 0; + short n = 0; curoutp = df; /* set f to the data block output file */ /* Count the number of objects */ @@ -251,13 +251,13 @@ void putdtable(dblock_p head, FILE* df) /* putptable */ -STATIC void outcset(cset s) +static void outcset(cset s) { /* A 'compact' set is represented externally as a row of words * (its bitvector) preceded by its length. */ - register short i; + short i; outshort(s->v_size); for (i = 0; i <= DIVWL(s->v_size - 1); i++) @@ -268,9 +268,9 @@ STATIC void outcset(cset s) void putptable(proc_p head, FILE* pf, bool all) { - register proc_p p; + proc_p p; proc_p next; - register short n = 0; + short n = 0; /* Write the proc table */ curoutp = pf; @@ -320,14 +320,14 @@ void putptable(proc_p head, FILE* pf, bool all) /* putunit */ -STATIC void outloop(void* vp) +static void outloop(void* vp) { loop_p l = vp; outshort((short)l->lp_id); } -STATIC void outblock(void* vp) +static void outblock(void* vp) { bblock_p b = vp; @@ -341,7 +341,7 @@ STATIC void outblock(void* vp) } } -STATIC void outlset(lset s, void (*p)(void*)) +static void outlset(lset s, void (*p)(void*)) { /* A 'long' set is represented externally as a * a sequence of elements terminated by a 0 word. @@ -349,7 +349,7 @@ STATIC void outlset(lset s, void (*p)(void*)) * prints an id (proc_id, obj_id etc.). */ - register Lindex i; + Lindex i; for (i = Lfirst(s); i != (Lindex)0; i = Lnext(i, s)) { @@ -360,8 +360,8 @@ STATIC void outlset(lset s, void (*p)(void*)) void putunit(short kind, proc_p p, line_p l, FILE* gf, FILE* lf) { - register bblock_p b; - register short n = 0; + bblock_p b; + short n = 0; Lindex pi; bblock_p nextb; loop_p lp; diff --git a/util/ego/share/show.c b/util/ego/share/show.c index a7649407d1..13ae9cae19 100644 --- a/util/ego/share/show.c +++ b/util/ego/share/show.c @@ -33,7 +33,7 @@ FILE* f; /* input file */ short getshort() { - register n; + n; n = getbyte(); n |= getbyte() << 8; @@ -42,7 +42,7 @@ short getshort() offset getoff() { - register offset n; + offset n; n = getshort() & 0xFFFF; n |= ((offset)getshort()) << 16; @@ -118,7 +118,7 @@ showcset() /* print a compact (bitvector) set */ short size; - register short i, j; + short i, j; int w, mask; size = getshort(); @@ -335,7 +335,7 @@ arglist() showlset() { - register short x; + short x; printf("{ "); while (x = getshort()) diff --git a/util/ego/share/stack_chg.c b/util/ego/share/stack_chg.c index 4a61992f09..7ae265ee1b 100644 --- a/util/ego/share/stack_chg.c +++ b/util/ego/share/stack_chg.c @@ -16,7 +16,7 @@ #define IS_LOC(l) (l != (line_p)0 && INSTR(l) == op_loc && TYPE(l) == OPSHORT) -STATIC int stack_change(line_p l, char sign) +static int stack_change(line_p l, char sign) { /* Interpret the string in the third column of the em_table file */ diff --git a/util/ego/share/utils.c b/util/ego/share/utils.c index aed2d6427b..0677f7dcb4 100644 --- a/util/ego/share/utils.c +++ b/util/ego/share/utils.c @@ -106,7 +106,7 @@ bool dom(bblock_p b1, bblock_p b2) * dominates itself. */ - register bblock_p b; + bblock_p b; for (b = b2; b != (bblock_p)0; b = b->b_idom) { @@ -190,7 +190,7 @@ line_p last_instr(bblock_p b) { /* Determine the last line of a list */ - register line_p l = b->b_start; + line_p l = b->b_start; if (l == (line_p)0) return (line_p)0; diff --git a/util/ego/sp/sp.c b/util/ego/sp/sp.c index c7b54408c8..e1c6761329 100644 --- a/util/ego/sp/sp.c +++ b/util/ego/sp/sp.c @@ -36,7 +36,7 @@ #define NOT_MARKED(b) (!(b->b_flags & BF_MARK)) #define IN_LOOP(b) (Lnrelems(b->b_loops) > 0) -STATIC int Ssp; /* number of optimizations */ +static int Ssp; /* number of optimizations */ /* According to the EM definition, the stack must be cleaned up * before any return. However, for some backends it causes no harm @@ -44,11 +44,11 @@ STATIC int Ssp; /* number of optimizations */ * more globally. */ -STATIC int globl_sp_allowed; +static int globl_sp_allowed; #define IS_ASP(l) (INSTR(l) == op_asp && TYPE(l) == OPSHORT && SHORT(l) > 0) -STATIC void sp_machinit(void* vp) +static void sp_machinit(void* vp) { /* Read target machine dependent information for this phase */ FILE* f = vp; @@ -65,7 +65,7 @@ STATIC void sp_machinit(void* vp) fscanf(f, "%d", &globl_sp_allowed); } -STATIC void comb_asps(line_p l1, line_p l2, bblock_p b) +static void comb_asps(line_p l1, line_p l2, bblock_p b) { assert(INSTR(l1) == op_asp); assert(INSTR(l2) == op_asp); @@ -76,13 +76,13 @@ STATIC void comb_asps(line_p l1, line_p l2, bblock_p b) rm_line(l1, b); } -STATIC void stack_pollution(bblock_p b) +static void stack_pollution(bblock_p b) { /* For every pair of successive ASP instructions in basic * block b, try to combine the two into one ASP. */ - register line_p l; + line_p l; line_p asp, next = b->b_start; bool asp_seen = FALSE; int stack_diff, pop, push; @@ -143,10 +143,10 @@ STATIC void stack_pollution(bblock_p b) } while (asp != (line_p)0); } -STATIC bool block_save(bblock_p b) +static bool block_save(bblock_p b) { - register line_p l; + line_p l; int stack_diff, pop, push; bool ok; @@ -172,7 +172,7 @@ STATIC bool block_save(bblock_p b) return stack_diff >= 0; } -STATIC void mark_pred(bblock_p b) +static void mark_pred(bblock_p b) { Lindex i; bblock_p x; @@ -188,9 +188,9 @@ STATIC void mark_pred(bblock_p b) } } -STATIC void mark_unsave_blocks(proc_p p) +static void mark_unsave_blocks(proc_p p) { - register bblock_p b; + bblock_p b; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -202,10 +202,10 @@ STATIC void mark_unsave_blocks(proc_p p) } } -STATIC void sp_optimize(void* vp) +static void sp_optimize(void* vp) { proc_p p = vp; - register bblock_p b; + bblock_p b; if (IS_ENTERED_WITH_GTO(p)) return; @@ -228,8 +228,8 @@ int main(int argc, char* argv[]) debug_stack_pollution(p) proc_p p; { - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; int lcnt,aspcnt,instr; for (b = p->p_start; b != 0; b = b->b_next) { diff --git a/util/ego/sr/sr.c b/util/ego/sr/sr.c index d7474cab86..b4c613bfc7 100644 --- a/util/ego/sr/sr.c +++ b/util/ego/sr/sr.c @@ -71,7 +71,7 @@ void sr_machinit(void* vp) fscanf(f, "%d", &sli_threshold); } -STATIC void del_ivs(lset ivs) +static void del_ivs(lset ivs) { /* Delete the set of iv structs */ @@ -84,7 +84,7 @@ STATIC void del_ivs(lset ivs) Ldeleteset(ivs); } -STATIC void do_loop(loop_p loop) +static void do_loop(loop_p loop) { lset ivs, vars; @@ -110,12 +110,12 @@ STATIC void do_loop(loop_p loop) Ldeleteset(vars); } -STATIC void loopblocks(proc_p p) +static void loopblocks(proc_p p) { /* Compute the LP_BLOCKS sets for all loops of p */ - register bblock_p b; - register Lindex i; + bblock_p b; + Lindex i; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -126,7 +126,7 @@ STATIC void loopblocks(proc_p p) } } -STATIC void opt_proc(proc_p p) +static void opt_proc(proc_p p) { /* Optimize all loops of one procedure. We first do all * outer loops at the lowest nesting level and proceed @@ -158,7 +158,7 @@ STATIC void opt_proc(proc_p p) } } -STATIC bblock_p header(loop_p lp) +static bblock_p header(loop_p lp) { /* Try to determine the 'header' block of loop lp. * If 'e' is the entry block of loop L, then block 'b' is @@ -177,12 +177,12 @@ STATIC bblock_p header(loop_p lp) return (bblock_p)0; } -STATIC void sr_extproc(proc_p p) +static void sr_extproc(proc_p p) { /* Allocate the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; + loop_p lp; + Lindex pi; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { @@ -196,12 +196,12 @@ STATIC void sr_extproc(proc_p p) } } -STATIC void sr_cleanproc(proc_p p) +static void sr_cleanproc(proc_p p) { /* Remove the extended data structures for procedure p */ - register loop_p lp; - register Lindex pi; + loop_p lp; + Lindex pi; for (pi = Lfirst(p->p_loops); pi != (Lindex)0; pi = Lnext(pi, p->p_loops)) { diff --git a/util/ego/sr/sr_aux.c b/util/ego/sr/sr_aux.c index 6fb4eef294..d59bf2f696 100644 --- a/util/ego/sr/sr_aux.c +++ b/util/ego/sr/sr_aux.c @@ -63,7 +63,7 @@ bool is_caddress(line_p lnp, lset vars) /* variables changed in loop */ UNREACHABLE_CODE; } -STATIC arg_p find_arg(int n, arg_p list) +static arg_p find_arg(int n, arg_p list) { /* Find the n-th element of the list */ @@ -104,7 +104,7 @@ void concatenate(line_p list1, line_p list2) { /* Append list2 to the end of list1. list1 may not be empty. */ - register line_p l; + line_p l; assert(list1 != (line_p)0); for (l = list1; l->l_next != (line_p)0; l = l->l_next) diff --git a/util/ego/sr/sr_cand.c b/util/ego/sr/sr_cand.c index 9b65b1e665..d1f022cb62 100644 --- a/util/ego/sr/sr_cand.c +++ b/util/ego/sr/sr_cand.c @@ -38,7 +38,7 @@ * Only local variables for which a register message is given are considered. */ -STATIC lset cand, /* set of candidates */ +static lset cand, /* set of candidates */ dism; /* set of dismissed variables */ #define ALL_LINES(lnp, list) \ @@ -46,7 +46,7 @@ STATIC lset cand, /* set of candidates */ lnp != (line_p)0; \ lnp = lnp->l_next -STATIC void un_cand(line_p lnp) +static void un_cand(line_p lnp) { /* remove the variable stored into by lnp from the list of * candidates (if it was there anyway). @@ -65,7 +65,7 @@ STATIC void un_cand(line_p lnp) } } -STATIC bool is_cand(line_p lnp) +static bool is_cand(line_p lnp) { /* see if the variable stored into by lnp is a candate */ @@ -81,7 +81,7 @@ STATIC bool is_cand(line_p lnp) return FALSE; } -STATIC void make_cand(line_p lnp) +static void make_cand(line_p lnp) { /* make the variable stored into by lnp a candidate */ @@ -89,12 +89,12 @@ STATIC void make_cand(line_p lnp) Ladd(lnp, &cand); } -STATIC void do_dismiss(line_p lnp) +static void do_dismiss(line_p lnp) { Ladd(lnp, &dism); } -STATIC void dismiss(line_p lnp) +static void dismiss(line_p lnp) { /* The variable referenced by lnp is turned definitely into * a non-candidate. @@ -106,7 +106,7 @@ STATIC void dismiss(line_p lnp) do_dismiss(lnp); /* add it to the set of dismissed variables */ } -STATIC bool not_dismissed(line_p lnp) +static bool not_dismissed(line_p lnp) { Lindex i; @@ -120,7 +120,7 @@ STATIC bool not_dismissed(line_p lnp) return TRUE; } -STATIC void try_cand(line_p lnp, bblock_p b) +static void try_cand(line_p lnp, bblock_p b) { /* If the variable stored into by lnp was not already a candidate * and was not dismissed, then it is made a candidate diff --git a/util/ego/sr/sr_expr.c b/util/ego/sr/sr_expr.c index 8bbd355034..6fbb026f7f 100644 --- a/util/ego/sr/sr_expr.c +++ b/util/ego/sr/sr_expr.c @@ -26,11 +26,11 @@ #define ME_LOOPCONST 3 #define ME_IV 4 -STATIC iv_p last_iv; -STATIC int iv_sign; -STATIC lset ivars, loopvars; +static iv_p last_iv; +static int iv_sign; +static lset ivars, loopvars; -STATIC bool is_loadiv(line_p lnp) +static bool is_loadiv(line_p lnp) { /* See if lnp is a LOL iv instruction, where iv is an * induction variable of the set ivars. If so, set the @@ -59,7 +59,7 @@ STATIC bool is_loadiv(line_p lnp) #define size_ok(l) (TYPE(l) == OPSHORT && SHORT(l) == ws) -STATIC int me_kind(line_p l, int sign_in, int* sign_out) +static int me_kind(line_p l, int sign_in, int* sign_out) { if (l != (line_p)0) { @@ -107,7 +107,7 @@ STATIC int me_kind(line_p l, int sign_in, int* sign_out) return ME_NONE; } -STATIC bool match_expr(line_p l, bool iv_allowed, line_p* lbegin, bool* iv_seen, int sign) +static bool match_expr(line_p l, bool iv_allowed, line_p* lbegin, bool* iv_seen, int sign) { /* This routine is a top down parser for simple * EM expressions. It recognizes expressions that diff --git a/util/ego/sr/sr_iv.c b/util/ego/sr/sr_iv.c index 8d10de3244..4b825c280c 100644 --- a/util/ego/sr/sr_iv.c +++ b/util/ego/sr/sr_iv.c @@ -23,9 +23,9 @@ #include "sr_cand.h" #include "sr_iv.h" -STATIC lset ivvars; /* set of induction variables */ +static lset ivvars; /* set of induction variables */ -STATIC short nature(line_p lnp) +static short nature(line_p lnp) { /* Auxiliary routine used by inc_or_dec, is_add and plus_or_min. * Determine if lnp had INCREMENT/DECREMENT-nature (1), @@ -56,7 +56,7 @@ STATIC short nature(line_p lnp) #define plus_or_min(l) (nature(l) > 1) #define inc_or_dec(l) (nature(l) == 1) -STATIC bool is_same(line_p l, line_p lnp) +static bool is_same(line_p l, line_p lnp) { /* lnp is a STL x , where x is a candidate * induction variable. See if l is a LOL x @@ -67,7 +67,7 @@ STATIC bool is_same(line_p l, line_p lnp) return l != (line_p)0 && INSTR(l) == op_lol && off_set(l) == off_set(lnp); } -STATIC void ivar(line_p lnp, int step) +static void ivar(line_p lnp, int step) { /* Record the fact that we've found a new induction variable. * lnp points to the last instruction of the code that @@ -83,7 +83,7 @@ STATIC void ivar(line_p lnp, int step) Ladd(i, &ivvars); } -STATIC int sign(line_p lnp) +static int sign(line_p lnp) { switch (INSTR(lnp)) { @@ -103,7 +103,7 @@ STATIC int sign(line_p lnp) UNREACHABLE_CODE; } -STATIC void try_patterns(line_p lnp) +static void try_patterns(line_p lnp) { /* lnp is a STL x; try to recognize * one of the patterns: diff --git a/util/ego/sr/sr_reduce.c b/util/ego/sr/sr_reduce.c index 2e9ac28211..1b6c8d7301 100644 --- a/util/ego/sr/sr_reduce.c +++ b/util/ego/sr/sr_reduce.c @@ -28,7 +28,7 @@ #include "sr_reduce.h" #include "sr_expr.h" -STATIC lset avail; +static lset avail; /* If an expression such as "iv * const" or "A[iv]" is * used more than once in a loop, we only use one temporary * local for it and reuse this local each time. @@ -36,7 +36,7 @@ STATIC lset avail; * be available. */ -STATIC int regtyp(code_p code) +static int regtyp(code_p code) { switch (code->co_instr) { @@ -51,7 +51,7 @@ STATIC int regtyp(code_p code) UNREACHABLE_CODE; } -STATIC void gen_regmes(offset tmp, int score, code_p code, proc_p p) +static void gen_regmes(offset tmp, int score, code_p code, proc_p p) { /* generate a register message for the temporary variable and * insert it at the start of the procedure. @@ -67,7 +67,7 @@ STATIC void gen_regmes(offset tmp, int score, code_p code, proc_p p) PREV(l) = pro; } -STATIC line_p newcode(code_p code, offset tmp) +static line_p newcode(code_p code, offset tmp) { /* Construct the EM code that will replace the reducible code, * e.g. iv * c -> tmp @@ -109,7 +109,7 @@ STATIC line_p newcode(code_p code, offset tmp) return l; } -STATIC void replcode(code_p code, line_p text) +static void replcode(code_p code, line_p text) { /* Replace old code (extending from code->co_lfirst to * code->co_llast) by new code (headed by 'text'). @@ -141,7 +141,7 @@ STATIC void replcode(code_p code, line_p text) /* Note that the old code is still accessible via code->co_lfirst */ } -STATIC line_p add_code(line_p pl, line_p l) +static line_p add_code(line_p pl, line_p l) { if (!pl) { @@ -163,7 +163,7 @@ STATIC line_p add_code(line_p pl, line_p l) return l; } -STATIC void init_code(code_p code, offset tmp) +static void init_code(code_p code, offset tmp) { /* Generate code to set up the temporary local. * For multiplication, its initial value is const*iv_expr, @@ -232,7 +232,7 @@ STATIC void init_code(code_p code, offset tmp) } } -STATIC void incr_code(code_p code, offset tmp) +static void incr_code(code_p code, offset tmp) { /* Generate code to increment the temporary local variable. * The variable is incremented by @@ -307,7 +307,7 @@ STATIC void incr_code(code_p code, offset tmp) DLINK(l, load_tmp); /* doubly link them */ } -STATIC void remcode(code_p c) +static void remcode(code_p c) { line_p l, next; @@ -319,7 +319,7 @@ STATIC void remcode(code_p c) oldcinfo(c); } -STATIC bool same_address(line_p l1, line_p l2, lset vars) +static bool same_address(line_p l1, line_p l2, lset vars) { /* See if l1 and l2 load the same address */ @@ -340,13 +340,13 @@ STATIC bool same_address(line_p l1, line_p l2, lset vars) } } -STATIC bool same_expr(line_p lb1, line_p le1, line_p lb2, line_p le2) +static bool same_expr(line_p lb1, line_p le1, line_p lb2, line_p le2) { /* See if the code from lb1 to le1 is the same * expression as the code from lb2 to le2. */ - register line_p l1, l2; + line_p l1, l2; l1 = lb1; l2 = lb2; @@ -378,7 +378,7 @@ STATIC bool same_expr(line_p lb1, line_p le1, line_p lb2, line_p le2) } } -STATIC bool same_code(code_p c1, code_p c2, lset vars) +static bool same_code(code_p c1, code_p c2, lset vars) { /* See if c1 and c2 compute the same expression. Two array * references can be the same even if one is e.g a fetch @@ -407,7 +407,7 @@ STATIC bool same_code(code_p c1, code_p c2, lset vars) UNREACHABLE_CODE; } -STATIC code_p available(code_p c, lset vars) +static code_p available(code_p c, lset vars) { /* See if the code is already available. * If so, return a pointer to the first occurrence @@ -428,7 +428,7 @@ STATIC code_p available(code_p c, lset vars) return (code_p)0; } -STATIC void reduce(code_p code, lset vars) +static void reduce(code_p code, lset vars) { /* Perform the actual transformations. The code on the left * gets transformed into the code on the right. Note that @@ -483,7 +483,7 @@ STATIC void reduce(code_p code, lset vars) } } -STATIC void try_multiply(loop_p lp, lset ivs, lset vars, bblock_p b, line_p mul) +static void try_multiply(loop_p lp, lset ivs, lset vars, bblock_p b, line_p mul) { /* See if we can reduce the strength of the multiply * instruction. If so, then set up the global common @@ -543,7 +543,7 @@ STATIC void try_multiply(loop_p lp, lset ivs, lset vars, bblock_p b, line_p mul) reduce(c, vars); } -STATIC void try_leftshift(loop_p lp, lset ivs, lset vars, bblock_p b, line_p shft) +static void try_leftshift(loop_p lp, lset ivs, lset vars, bblock_p b, line_p shft) { /* See if we can reduce the strength of the leftshift * instruction. If so, then set up the global common @@ -592,7 +592,7 @@ STATIC void try_leftshift(loop_p lp, lset ivs, lset vars, bblock_p b, line_p shf reduce(c, vars); } -STATIC void try_array(loop_p lp, lset ivs, lset vars, bblock_p b, line_p arr) +static void try_array(loop_p lp, lset ivs, lset vars, bblock_p b, line_p arr) { /* See if we can reduce the strength of the array reference * instruction 'arr'. @@ -641,7 +641,7 @@ STATIC void try_array(loop_p lp, lset ivs, lset vars, bblock_p b, line_p arr) } } -STATIC void clean_avail(void) +static void clean_avail(void) { Lindex i; diff --git a/util/ego/sr/sr_xform.c b/util/ego/sr/sr_xform.c index c990bd7c62..67bb065b36 100644 --- a/util/ego/sr/sr_xform.c +++ b/util/ego/sr/sr_xform.c @@ -65,7 +65,7 @@ line_p move_pointer(offset tmp, int dir) /* make_header */ -STATIC void copy_loops(bblock_p b1, bblock_p b2, loop_p except) +static void copy_loops(bblock_p b1, bblock_p b2, loop_p except) { /* Copy the loopset of b2 to b1, except for 'except' */ @@ -81,7 +81,7 @@ STATIC void copy_loops(bblock_p b1, bblock_p b2, loop_p except) } } -STATIC lab_id label(bblock_p b) +static lab_id label(bblock_p b) { /* Find the label at the head of block b. If there is * no such label yet, create one. @@ -105,7 +105,7 @@ STATIC lab_id label(bblock_p b) return INSTRLAB(l); } -STATIC void adjust_jump(bblock_p newtarg, bblock_p oldtarg, bblock_p c) +static void adjust_jump(bblock_p newtarg, bblock_p oldtarg, bblock_p c) { /* If the last instruction of c is a jump to the * old target, then change it into a jump to the diff --git a/util/ego/ud/ud.c b/util/ego/ud/ud.c index dc7ea599a8..26331f29aa 100644 --- a/util/ego/ud/ud.c +++ b/util/ego/ud/ud.c @@ -39,7 +39,7 @@ int Svalue, Svariable; cond_p globl_cond_tab, local_cond_tab; -STATIC cond_p getcondtab(FILE* f) +static cond_p getcondtab(FILE* f) { int l, i; cond_p tab; @@ -54,7 +54,7 @@ STATIC cond_p getcondtab(FILE* f) return tab; } -STATIC void ud_machinit(void* vp) +static void ud_machinit(void* vp) { FILE* f = vp; char s[100]; @@ -71,7 +71,7 @@ STATIC void ud_machinit(void* vp) local_cond_tab = getcondtab(f); } -STATIC bool test_cond(short cond, offset val) +static bool test_cond(short cond, offset val) { switch (cond) { @@ -84,7 +84,7 @@ STATIC bool test_cond(short cond, offset val) UNREACHABLE_CODE; } -STATIC short map_value(struct cond_tab tab[], offset val, bool time) +static short map_value(struct cond_tab tab[], offset val, bool time) { cond_p p; @@ -97,7 +97,7 @@ STATIC short map_value(struct cond_tab tab[], offset val, bool time) } } -STATIC void init_root(bblock_p root) +static void init_root(bblock_p root) { /* Initialise the IN OUT sets of the entry block of the * current procedure. Global variables and parameters @@ -126,7 +126,7 @@ STATIC void init_root(bblock_p root) Cjoin(GEN(root), &OUT(root)); } -STATIC void unite_outs(lset bbset, cset* setp) +static void unite_outs(lset bbset, cset* setp) { /* Take the union of OUT(b), for all b in bbset, * and put the result in setp. @@ -141,7 +141,7 @@ STATIC void unite_outs(lset bbset, cset* setp) } } -STATIC void solve_equations(proc_p p) +static void solve_equations(proc_p p) { /* Solve the data flow equations for reaching * definitions of procedure p. @@ -153,7 +153,7 @@ STATIC void solve_equations(proc_p p) * solve the equations. */ - register bblock_p b; + bblock_p b; bool change; cset newin; @@ -208,7 +208,7 @@ short local_addr_cost(offset off) map_value(local_cond_tab, off, TRUE), map_value(local_cond_tab, off, FALSE)); } -STATIC bool fold_is_desirable(line_p old, line_p new) +static bool fold_is_desirable(line_p old, line_p new) { /* See if it is desirable to replace the variable used by the * EM instruction 'old' by the variable used by 'new'. @@ -382,7 +382,7 @@ pr_cblocks(p) proc_p p; #endif -STATIC void ud_analysis(proc_p p) +static void ud_analysis(proc_p p) { /* Perform use-definition analysis on procedure p */ @@ -404,7 +404,7 @@ STATIC void ud_analysis(proc_p p) #endif } -STATIC void clean_maps(void) +static void clean_maps(void) { local_p* p; cset* v; @@ -422,7 +422,7 @@ STATIC void clean_maps(void) oldmap((void**)vardefs, nrvars); } -STATIC bool try_optim(line_p l, bblock_p b) +static bool try_optim(line_p l, bblock_p b) { /* Try copy propagation and constant propagation */ @@ -456,7 +456,7 @@ STATIC bool try_optim(line_p l, bblock_p b) return FALSE; } -STATIC void value_propagation(proc_p p) +static void value_propagation(proc_p p) { /* Apply value propagation to procedure p */ @@ -489,11 +489,11 @@ STATIC void value_propagation(proc_p p) oldtable(def_to_copynr, nrdefs); } -STATIC void ud_extend(proc_p p) +static void ud_extend(proc_p p) { /* Allocate extended data structures for Use Definition analysis */ - register bblock_p b; + bblock_p b; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { @@ -501,11 +501,11 @@ STATIC void ud_extend(proc_p p) } } -STATIC void ud_cleanup(proc_p p) +static void ud_cleanup(proc_p p) { /* Deallocate extended data structures for Use Definition analysis */ - register bblock_p b; + bblock_p b; for (b = p->p_start; b != (bblock_p)0; b = b->b_next) { diff --git a/util/ego/ud/ud_const.c b/util/ego/ud/ud_const.c index 18cd8dca85..f6b490cfde 100644 --- a/util/ego/ud/ud_const.c +++ b/util/ego/ud/ud_const.c @@ -119,7 +119,7 @@ bool affected(line_p use, short v, line_p l) return TYPE(use) == OPOBJECT || !IS_REG(v); } -STATIC void search_backwards(line_p use, short v, bool* found, line_p* def) +static void search_backwards(line_p use, short v, bool* found, line_p* def) { /* Search backwards in the current basic block, * starting at 'use', trying to find a definition @@ -128,7 +128,7 @@ STATIC void search_backwards(line_p use, short v, bool* found, line_p* def) * implicit one, return 0 as def. */ - register line_p l; + line_p l; for (l = PREV(use); l != (line_p)0; l = PREV(l)) { @@ -148,7 +148,7 @@ STATIC void search_backwards(line_p use, short v, bool* found, line_p* def) *found = FALSE; } -STATIC short outer_def(cset vdefs, cset in) +static short outer_def(cset vdefs, cset in) { /* See if there is a unique definition of variable * v reaching the beginning of block b. diff --git a/util/ego/ud/ud_copy.c b/util/ego/ud/ud_copy.c index 6ac6ab880d..a261997a5c 100644 --- a/util/ego/ud/ud_copy.c +++ b/util/ego/ud/ud_copy.c @@ -39,7 +39,7 @@ short nrcopies; /* number of copies in the current procedure #define COUNT 0 #define MAP 1 -STATIC void traverse_defs(proc_p p, int action) +static void traverse_defs(proc_p p, int action) { bblock_p b; line_p l; @@ -88,7 +88,7 @@ STATIC void traverse_defs(proc_p p, int action) } } -STATIC void make_copytab(proc_p p) +static void make_copytab(proc_p p) { /* Make a table of all copies appearing in procedure p. * We first count how many there are, because we @@ -99,13 +99,13 @@ STATIC void make_copytab(proc_p p) traverse_defs(p, MAP); } -STATIC bool is_changed(line_p varl, line_p start, line_p stop) +static bool is_changed(line_p varl, line_p start, line_p stop) { /* See if the variable used by instruction varl * is changed anywhere between 'start' and 'stop' */ - register line_p l; + line_p l; short v; bool found; @@ -124,14 +124,14 @@ STATIC bool is_changed(line_p varl, line_p start, line_p stop) return FALSE; } -STATIC void gen_kill_copies(proc_p p) +static void gen_kill_copies(proc_p p) { /* Compute C_GEN and C_KILL for every basic block * of p. */ - register line_p l; - register bblock_p b, n; + line_p l; + bblock_p b, n; short v; bool found; short copycnt = 1, defcnt = 1; @@ -175,7 +175,7 @@ STATIC void gen_kill_copies(proc_p p) } } -STATIC void intersect_outs(lset bbset, cset* setp, cset full_set) +static void intersect_outs(lset bbset, cset* setp, cset full_set) { /* Take the intersection of C_OUT(b), for all b in bbset, * and put the result in setp. @@ -190,7 +190,7 @@ STATIC void intersect_outs(lset bbset, cset* setp, cset full_set) } } -STATIC void init_cin(proc_p p, cset full_set) +static void init_cin(proc_p p, cset full_set) { /* Initialize C_IN(b) and C_OUT(b), for every basic block b. * C_IN of the root of the CFG (i.e. the procedure entry block) @@ -222,7 +222,7 @@ STATIC void init_cin(proc_p p, cset full_set) } } -STATIC void solve_cin(proc_p p) +static void solve_cin(proc_p p) { /* Solve the data flow equations for reaching * definitions of procedure p. @@ -236,7 +236,7 @@ STATIC void solve_cin(proc_p p) * solve the equations. */ - register bblock_p b; + bblock_p b; bool change; cset newin, full_set; short n; diff --git a/util/ego/ud/ud_defs.c b/util/ego/ud/ud_defs.c index f6c216bdc0..ae188e97ef 100644 --- a/util/ego/ud/ud_defs.c +++ b/util/ego/ud/ud_defs.c @@ -27,7 +27,7 @@ short nrexpldefs; /* number of explicit definitions */ line_p* defs; cset* vardefs; -STATIC cset all_globl_defs, all_indir_defs; +static cset all_globl_defs, all_indir_defs; /* auxiliary sets, used by gen_sets */ bool does_expl_def(line_p l) @@ -88,8 +88,8 @@ void make_defs(proc_p p) * explicit definition. */ - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; short v, i, cnt = 0; bool found; @@ -136,7 +136,7 @@ void make_defs(proc_p p) } } -STATIC void init_gen(short nrdefs) +static void init_gen(short nrdefs) { /* Initializing routine of gen_sets. Compute the set * of all implicit definitions to global variables @@ -163,13 +163,13 @@ STATIC void init_gen(short nrdefs) } } -STATIC void clean_gen(void) +static void clean_gen(void) { Cdeleteset(all_globl_defs); Cdeleteset(all_indir_defs); } -STATIC bool same_target(line_p l, short defnr) +static bool same_target(line_p l, short defnr) { /* See if l defines the same variable as def */ @@ -201,7 +201,7 @@ STATIC bool same_target(line_p l, short defnr) } } -STATIC void rem_prev_defs(line_p l, cset* gen_p) +static void rem_prev_defs(line_p l, cset* gen_p) { /* Remove all definitions in gen that define the * same variable as l. @@ -221,7 +221,7 @@ STATIC void rem_prev_defs(line_p l, cset* gen_p) } } -STATIC void impl_globl_defs(proc_p p, cset* gen_p) +static void impl_globl_defs(proc_p p, cset* gen_p) { /* Add all definitions of global variables * that are generated implicitly by a call @@ -245,7 +245,7 @@ STATIC void impl_globl_defs(proc_p p, cset* gen_p) } } -STATIC void impl_gen_defs(line_p l, cset* gen_p) +static void impl_gen_defs(line_p l, cset* gen_p) { /* Add all definitions generated implicitly by instruction l * to gen_p. l may be a call or some kind of indirect @@ -288,8 +288,8 @@ void gen_sets(proc_p p) * well as implicit) that reach the end of b. */ - register bblock_p b; - register line_p l; + bblock_p b; + line_p l; short defnr = 1; init_gen(nrdefs); /* compute all_globl_defs and all_indir_defs */ @@ -326,7 +326,7 @@ void gen_sets(proc_p p) clean_gen(); /* clean up */ } -STATIC void killed_defs(short v, bblock_p b) +static void killed_defs(short v, bblock_p b) { /* Put all definitions of v occurring outside b * in KILL(b). In fact, we also put explicit @@ -358,7 +358,7 @@ void kill_sets(proc_p p) * definitions. */ - register bblock_p b; + bblock_p b; Cindex i; short v; diff --git a/util/grind/avl.cc b/util/grind/avl.cc index 31baa10f8d..ffef4ac9fb 100644 --- a/util/grind/avl.cc +++ b/util/grind/avl.cc @@ -41,10 +41,10 @@ struct avl_tree { static int balance_add(ppsc, n, cmp) struct avl_node **ppsc; /* address of root */ - register char *n; /* user-supplied information */ + char *n; /* user-supplied information */ int (*cmp)(); /* user-supplied comparison routine */ { - register struct avl_node *psc = *ppsc, *qsc, *ssc; + struct avl_node *psc = *ppsc, *qsc, *ssc; if (! psc) { *ppsc = new_avl_node(); @@ -157,7 +157,7 @@ struct avl_tree * create_avl_tree(cmp) int (*cmp)(); /* comparison routine */ { - register struct avl_tree *p = new_avl_tree(); + struct avl_tree *p = new_avl_tree(); p->cmp = cmp; return p; @@ -182,7 +182,7 @@ find_ngt(tree, n) struct avl_tree *tree; /* tree to be searched in */ char *n; /* information to be compared with */ { - register struct avl_node *nd = tree->root, *lastnd = 0; + struct avl_node *nd = tree->root, *lastnd = 0; for (;;) { while (nd && (*tree->cmp)(nd->info, n) > 0) { @@ -206,7 +206,7 @@ find_nlt(tree, n) struct avl_tree *tree; /* tree to be searched in */ char *n; /* information to be compared with */ { - register struct avl_node *nd = tree->root, *lastnd = 0; + struct avl_node *nd = tree->root, *lastnd = 0; for (;;) { while (nd && (*tree->cmp)(nd->info, n) < 0) { @@ -230,7 +230,7 @@ find_eq(tree, n) struct avl_tree *tree; /* tree to be searched in */ char *n; /* information to be compared with */ { - register struct avl_node *nd = tree->root; + struct avl_node *nd = tree->root; for (;;) { while (nd && (*tree->cmp)(nd->info, n) < 0) { diff --git a/util/grind/c.c b/util/grind/c.c index a1cdb8bed8..2e28083cf8 100644 --- a/util/grind/c.c +++ b/util/grind/c.c @@ -120,7 +120,7 @@ print_string(f, s, len) char *s; int len; { - register char *str = s; + char *str = s; putc('"', f); while (*str && len-- > 0) printchar(f, *str++, '"'); @@ -200,7 +200,7 @@ binop_prio(op) static int val_in_base(c, base) - register int c; + int c; { return is_dig(c) ? c - '0' @@ -213,13 +213,13 @@ val_in_base(c, base) static int get_number(c) - register int c; + int c; { char buf[512+1]; - register int base = 10; - register char *p = &buf[0]; - register long val = 0; - register int val_c; + int base = 10; + char *p = &buf[0]; + long val = 0; + int val_c; if (c == '0') { /* check if next char is an 'x' or an 'X' */ @@ -274,7 +274,7 @@ get_number(c) static int get_token(c) - register int c; + int c; { switch(c) { case '[': @@ -418,7 +418,7 @@ quoted(ch) } } else { /* a quoted octal */ - register int oct = 0, cnt = 0; + int oct = 0, cnt = 0; do { oct = oct*8 + (ch-'0'); @@ -435,9 +435,9 @@ static int getstring(c) int c; { - register int ch; + int ch; char buf[512]; - register int len = 0; + int len = 0; while (ch = getc(db_in), ch != c) { if (ch == '\n') { diff --git a/util/grind/commands.g b/util/grind/commands.g index eeb3332fae..7169017f5a 100644 --- a/util/grind/commands.g +++ b/util/grind/commands.g @@ -545,7 +545,7 @@ name(p_tree *p;) int LLlex() { - register int c; + int c; if (ASIDE) { tok = aside; @@ -597,11 +597,11 @@ LLlex() int get_name(c) - register int c; + int c; { char buf[512+1]; - register char *p = &buf[0]; - register struct idf *id; + char *p = &buf[0]; + struct idf *id; do { if (p - buf < 512) *p++ = c; @@ -670,12 +670,12 @@ ctch() static int shellescape() { - register char *p; /* walks through command */ + char *p; /* walks through command */ static char previous[SHBUFSIZ]; /* previous command */ char comm[SHBUFSIZ]; /* space for command */ - register int cnt; /* prevent array bound errors */ - register int c; /* current char */ - register int lastc = 0; /* will contain the previous char */ + int cnt; /* prevent array bound errors */ + int c; /* current char */ + int lastc = 0; /* will contain the previous char */ p = comm; cnt = SHBUFSIZ-2; diff --git a/util/grind/db_symtab.g b/util/grind/db_symtab.g index c16a9ed7d5..00fcc050a2 100644 --- a/util/grind/db_symtab.g +++ b/util/grind/db_symtab.g @@ -184,7 +184,7 @@ name(char **s;) const_name(p_symbol cst;) { int type_index[2]; long iconst; - register char *p; + char *p; } : '=' @@ -483,7 +483,7 @@ type(p_type *ptp; int *type_index; p_symbol sy;) } ; -structure_type(register p_type tp; p_symbol sy;) +structure_type(p_type tp; p_symbol sy;) { register struct fields *fldp; char *str; } @@ -503,10 +503,10 @@ structure_type(register p_type tp; p_symbol sy;) } ; -enum_type(register p_type tp;) +enum_type(p_type tp;) { register struct literal *litp; long maxval = 0; - register p_symbol s; + p_symbol s; } : [ { litp = get_literal_space(tp); } @@ -594,9 +594,9 @@ DBSonerror(tk, p) DBSlex() { - register char *cp = DbPtr; + char *cp = DbPtr; int allow_name = AllowName; - register int c; + int c; AllowName = 0; DbOldPtr = cp; @@ -674,10 +674,10 @@ DBSlex() static struct fields * get_field_space(tp, s) - register p_type tp; + p_type tp; char *s; { - register struct fields *p; + struct fields *p; p_symbol sy; if (! (tp->ty_nfields & 07)) { @@ -695,7 +695,7 @@ get_field_space(tp, s) static end_field(tp) - register p_type tp; + p_type tp; { tp->ty_fields = (struct fields *) Realloc((char *) tp->ty_fields, @@ -704,7 +704,7 @@ end_field(tp) static struct literal * get_literal_space(tp) - register p_type tp; + p_type tp; { if (! (tp->ty_nenums & 07)) { tp->ty_literals = (struct literal *) @@ -718,8 +718,8 @@ static char * string_val(s) char *s; { - register char *ns = s, *os = s; - register unsigned int i = 1; + char *ns = s, *os = s; + unsigned int i = 1; for (;;) { if (!*os) break; @@ -747,8 +747,8 @@ DbRead(f) char *f; { struct outhead h; - register struct outname *n; - register struct outname *line_file = 0; + struct outname *n; + struct outname *line_file = 0; long OffsetStrings; int lbrac_required = 0; int needs_newscope = 0; diff --git a/util/grind/do_comm.c b/util/grind/do_comm.c index a5aa42f917..bb092201c8 100644 --- a/util/grind/do_comm.c +++ b/util/grind/do_comm.c @@ -292,7 +292,7 @@ free_dump(p) free(d->stack); if (d == last_dump) last_dump = d->next; else { - register struct dump *d1 = last_dump; + struct dump *d1 = last_dump; while (d1->next != d) d1 = d1->next; d1->next = d->next; @@ -308,7 +308,7 @@ do_find(p) p_tree p; { /* Print all identifications of p->t_args[0]. */ - register p_symbol s; + p_symbol s; p_tree arg; p = p->t_args[0]; @@ -425,7 +425,7 @@ do_file(p) if (p->t_args[0]) { if (! strcmp(p->t_args[0]->t_str, "?")) { - register p_symbol sym = PervasiveScope->sc_symbs; + p_symbol sym = PervasiveScope->sc_symbs; while (sym) { if (sym->sy_class == FILESYM) { @@ -918,7 +918,7 @@ extern int in_wheninvoked; enterlog(p) p_tree p; { - register p_tree p1; + p_tree p1; if (logfd && ! in_wheninvoked) { switch(p->t_oper) { @@ -934,7 +934,7 @@ enterlog(p) */ p1 = p->t_args[0]; while (p1 && p1->t_oper == OP_LINK) { - register p_tree p2 = p1->t_args[0]; + p_tree p2 = p1->t_args[0]; if (p2->t_ival > 0 && p2->t_ival <= item_count) { p2->t_ival = p2->t_ival - item_count - 1; } diff --git a/util/grind/expr.c b/util/grind/expr.c index 336e4381d3..b549dc6f84 100644 --- a/util/grind/expr.c +++ b/util/grind/expr.c @@ -74,7 +74,7 @@ extern char *malloc(), *realloc(); */ static t_addr get_addr(sym, psize) - register p_symbol sym; + p_symbol sym; long *psize; { p_type tp = sym->sy_type; @@ -183,7 +183,7 @@ get_v(a, pbuf, size) */ static int get_value(sym, pbuf, psize) - register p_symbol sym; + p_symbol sym; char **pbuf; long *psize; { @@ -263,7 +263,7 @@ get_int(buf, size, class) long size; int class; { - register long l; + long l; switch((int)size) { case sizeof(char): @@ -337,8 +337,8 @@ int convert(pbuf, psize, ptp, tp, size) char **pbuf; long *psize; - register p_type *ptp; - register p_type tp; + p_type *ptp; + p_type tp; long size; { /* Convert the value in pbuf, of size psize and type ptp, to type @@ -1181,9 +1181,9 @@ select_addr(p, paddr, psize, ptp) long *psize; p_type *ptp; { - register p_type tp; - register struct fields *f; - register int nf; + p_type tp; + struct fields *f; + int nf; if (eval_desig(p->t_args[0], paddr, psize, ptp)) { tp = *ptp; @@ -1293,7 +1293,7 @@ eval_expr(p, pbuf, psize, ptp) long *psize; p_type *ptp; { - register p_symbol sym; + p_symbol sym; int retval = 0; *pbuf = 0; @@ -1374,7 +1374,7 @@ eval_desig(p, paddr, psize, ptp) long *psize; p_type *ptp; { - register p_symbol sym; + p_symbol sym; int retval = 0; t_addr a; diff --git a/util/grind/itemlist.cc b/util/grind/itemlist.cc index 0d4d5a5d59..e35238b0cc 100644 --- a/util/grind/itemlist.cc +++ b/util/grind/itemlist.cc @@ -33,7 +33,7 @@ static int in_item_list(p) p_tree p; { - register p_item i = item_list.il_first; + p_item i = item_list.il_first; while (i) { if (i->i_node == p) return 1; @@ -60,7 +60,7 @@ item_addr_actions(a, mess_type, may_stop) /* Perform actions associated with position 'a', and return stop_reason if we must stop there, and 0 if not. */ - register p_item i = item_list.il_first; + p_item i = item_list.il_first; stop_reason = 0; for (i = item_list.il_first; i != 0; i = i->i_next) { @@ -114,7 +114,7 @@ item_addr_actions(a, mess_type, may_stop) handle_displays() { - register p_item i = item_list.il_first; + p_item i = item_list.il_first; while (i) { register p_tree p = i->i_node; @@ -149,7 +149,7 @@ add_to_item_list(p) remove_from_item_list(n) int n; { - register p_item i = item_list.il_first, prev = 0; + p_item i = item_list.il_first, prev = 0; p_tree p; if (n == 0) { @@ -199,7 +199,7 @@ p_tree get_from_item_list(n) int n; { - register p_item i = item_list.il_first; + p_item i = item_list.il_first; if (n == 0) { n = stop_reason; @@ -216,8 +216,8 @@ get_from_item_list(n) able_item(n, kind) int n; { - register p_item i = item_list.il_first; - register p_tree p; + p_item i = item_list.il_first; + p_tree p; if (n == 0) { n = stop_reason; @@ -258,7 +258,7 @@ able_item(n, kind) print_items() { - register p_item i = item_list.il_first; + p_item i = item_list.il_first; for (; i; i = i->i_next) { pr_item(i); @@ -267,7 +267,7 @@ print_items() perform_items() { - register p_item i = item_list.il_first; + p_item i = item_list.il_first; for (; i; i = i->i_next) { if (! i->i_disabled && i->i_node->t_oper != OP_DUMP) eval(i->i_node); diff --git a/util/grind/langdep.cc b/util/grind/langdep.cc index b2e7b73bf2..0721fc737f 100644 --- a/util/grind/langdep.cc +++ b/util/grind/langdep.cc @@ -37,7 +37,7 @@ init_languages() find_language(suff) char *suff; { - register struct langlist *p = list; + struct langlist *p = list; if (! suff) { currlang = c_dep; diff --git a/util/grind/list.c b/util/grind/list.c index c0c0d28038..677f5547a5 100644 --- a/util/grind/list.c +++ b/util/grind/list.c @@ -22,7 +22,7 @@ mk_filnm(dir, file, newname) char *file; char **newname; { - register char *dst = Malloc((unsigned) (strlen(dir) + strlen(file) + 2)); + char *dst = Malloc((unsigned) (strlen(dir) + strlen(file) + 2)); *newname = dst; if (*dir) { @@ -57,13 +57,13 @@ open_file(fn, mode, ffn) } lines(file, l1, l2) - register p_file file; + p_file file; int l1, l2; { static p_file last_file; static FILE *last_f; - register FILE *f; - register int n; + FILE *f; + int n; if (last_file != file) { if (last_f) fclose(last_f); @@ -88,7 +88,7 @@ lines(file, l1, l2) fseek(f, *(file->f_linepos+(l1-1)), 0); for (n = l1; n < l1 + l2; n++) { - register int c; + int c; if (interrupted) return; fprintf(db_out, "%c%5d\t", currfile && file == currfile->sy_file && n == currline ? '>' : ' ', n); @@ -104,12 +104,12 @@ lines(file, l1, l2) static line_positions(file, f) p_file file; - register FILE *f; + FILE *f; { int nl; unsigned int n_alloc = 256; - register long cnt = 0; - register int c; + long cnt = 0; + int c; file->f_linepos = (long *) Malloc(n_alloc * sizeof(long)); file->f_linepos[0] = 0; diff --git a/util/grind/modula-2.c b/util/grind/modula-2.c index d0a2dd744a..d6ddb6ced2 100644 --- a/util/grind/modula-2.c +++ b/util/grind/modula-2.c @@ -83,7 +83,7 @@ print_string(f, s, len) char *s; int len; { - register char *str = s; + char *str = s; int delim = '\''; while (*str) { @@ -151,7 +151,7 @@ binop_prio(op) static int get_number(ch) - register int ch; + int ch; { /* The problem arising with the "parsing" of a number is that we don't know the base in advance so we @@ -159,10 +159,10 @@ get_number(ch) complex finite automaton. */ enum statetp {Oct,Hex,Dec,OctEndOrHex,End,Real}; - register enum statetp state; + enum statetp state; char buf[512+1]; - register int base = 10; - register char *np = &buf[0]; + int base = 10; + char *np = &buf[0]; *np++ = ch; state = is_oct(ch) ? Oct : Dec; @@ -300,11 +300,11 @@ get_number(ch) static int getname(c) - register int c; + int c; { char buf[512+1]; - register char *p = &buf[0]; - register struct idf *id; + char *p = &buf[0]; + struct idf *id; do { if (p - buf < 512) *p++ = c; @@ -359,7 +359,7 @@ getname(c) static int get_token(c) - register int c; + int c; { switch(c) { case '[': @@ -441,9 +441,9 @@ static int getstring(c) int c; { - register int ch; + int ch; char buf[512]; - register int len = 0; + int len = 0; while (ch = getc(db_in), ch != c) { if (ch == '\n') { diff --git a/util/grind/pascal.c b/util/grind/pascal.c index 87fb893fa3..9f2437c1db 100644 --- a/util/grind/pascal.c +++ b/util/grind/pascal.c @@ -87,7 +87,7 @@ print_string(f, s, len) char *s; int len; { - register char *str = s; + char *str = s; putc('\'', f); while (*str && len > 0) { @@ -157,10 +157,10 @@ binop_prio(op) static int get_number(ch) - register int ch; + int ch; { char buf[512+1]; - register char *np = &buf[0]; + char *np = &buf[0]; int real_mode = 0; while (is_dig(ch)) { @@ -226,11 +226,11 @@ get_number(ch) static int getname(c) - register int c; + int c; { char buf[512+1]; - register char *p = &buf[0]; - register struct idf *id; + char *p = &buf[0]; + struct idf *id; do { if (isupper(c)) c = tolower(c); @@ -286,7 +286,7 @@ getname(c) static int get_token(c) - register int c; + int c; { switch(c) { case '[': @@ -356,9 +356,9 @@ static int getstring(c) int c; { - register int ch; + int ch; char buf[512]; - register int len = 0; + int len = 0; for (;;) { ch = getc(db_in); diff --git a/util/grind/position.c b/util/grind/position.c index 565046bdea..7ec969ca30 100644 --- a/util/grind/position.c +++ b/util/grind/position.c @@ -26,8 +26,8 @@ get_position_from_addr(t) t_addr t; { static t_position retval; - register struct outname *p; - register int i,j; + struct outname *p; + int i,j; if (! f_start) return 0; i = 0; @@ -58,14 +58,14 @@ t_addr get_addr_from_position(p) p_position p; { - register p_symbol sym = Lookup(findidf(p->filename), PervasiveScope, FILESYM); + p_symbol sym = Lookup(findidf(p->filename), PervasiveScope, FILESYM); if (sym) { - register unsigned int i; - register p_file map = sym->sy_file; + unsigned int i; + p_file map = sym->sy_file; for (i = p->lineno; i > 0; i--) { - register struct outname *n = map->f_line_addr[HASH(i)]; + struct outname *n = map->f_line_addr[HASH(i)]; while (n) { if (n->on_desc == i) return (t_addr) n->on_valu; @@ -83,14 +83,14 @@ get_addr_from_position(p) */ add_position_addr(filename, n) char *filename; - register struct outname *n; + struct outname *n; { static char *lastfile = 0; static p_file lastmap = 0; - register p_file map = lastmap; + p_file map = lastmap; if (filename != lastfile) { /* new file ... */ - register p_symbol sym; + p_symbol sym; lastfile = filename; if (! filename) { /* last call */ @@ -123,10 +123,10 @@ print_position(a, print_function) t_addr a; int print_function; { - register p_position pos = get_position_from_addr(a); + p_position pos = get_position_from_addr(a); if (print_function) { - register p_scope sc = base_scope(get_scope_from_addr(a)); + p_scope sc = base_scope(get_scope_from_addr(a)); if (sc) fprintf(db_out, "in %s ", sc->sc_definedby->sy_idf->id_text); } if (pos) fprintf(db_out, "at \"%s\":%u", pos->filename, pos->lineno); diff --git a/util/grind/print.c b/util/grind/print.c index 13ef345062..ff53af6f8d 100644 --- a/util/grind/print.c +++ b/util/grind/print.c @@ -21,7 +21,7 @@ static print_unsigned(tp, v, format) p_type tp; long v; - register char *format; + char *format; { while (format && *format) { if (strchr("cdohx", *format)) break; @@ -60,8 +60,8 @@ print_literal(tp, v, compressed, format) int compressed; char *format; { - register struct literal *lit = tp->ty_literals; - register int i; + struct literal *lit = tp->ty_literals; + int i; if (format) { print_unsigned(tp, v, format); @@ -84,7 +84,7 @@ static print_integer(tp, v, format) p_type tp; long v; - register char *format; + char *format; { while (format && *format) { if (strchr("cdohx", *format)) break; @@ -121,9 +121,9 @@ print_params(tp, AB, static_link) t_addr AB; { char *param_bytes; - register char *p; - register int i; - register struct param *par; + char *p; + int i; + struct param *par; long size; if (! tp) return; @@ -185,9 +185,9 @@ print_val(tp, tp_sz, addr, compressed, indent, format) char *addr; /* address to get value from */ int compressed; /* for parameter lists */ int indent; /* indentation */ - register char *format; /* format given or 0 */ + char *format; /* format given or 0 */ { - register int i; + int i; long elsize; if (indent == 0) indent = 4; @@ -237,7 +237,7 @@ print_val(tp, tp_sz, addr, compressed, indent, format) indent -= 4; break; case T_STRUCT: { - register struct fields *fld = tp->ty_fields; + struct fields *fld = tp->ty_fields; if (compressed) { fprintf(db_out, currlang->open_struct_display); @@ -279,7 +279,7 @@ print_val(tp, tp_sz, addr, compressed, indent, format) print_literal(tp, get_int(addr, tp_sz, T_ENUM), compressed, format); break; case T_PROCEDURE: { - register p_scope sc = get_scope_from_addr((t_addr) get_int(addr, pointer_size, T_UNSIGNED)); + p_scope sc = get_scope_from_addr((t_addr) get_int(addr, pointer_size, T_UNSIGNED)); if (sc && sc->sc_definedby) { fprintf(db_out, sc->sc_definedby->sy_idf->id_text); diff --git a/util/grind/rd.c b/util/grind/rd.c index 301cfe68c1..3d6c243fb9 100644 --- a/util/grind/rd.c +++ b/util/grind/rd.c @@ -144,7 +144,7 @@ rd_ohead(h) /*ARGSUSED1*/ rd_name(names, count) - register struct outname *names; + struct outname *names; unsigned int count; /* ignored; complete namelist is read */ { names->on_valu = 0; names->on_foff = seg_strings + OFF_CHAR(hh); @@ -208,7 +208,7 @@ rd_name(names, count) extern char *strcpy(); rd_string(strings, count) - register char *strings; + char *strings; long count; { #if defined(sun) @@ -278,9 +278,9 @@ get_names(h, sz) struct outhead *h; long sz; { - register char *xnms = malloc((unsigned) sz); - register char *p; - register struct outname *onm = (struct outname *) malloc((((unsigned)sz+8)/9)*sizeof(struct outname)); + char *xnms = malloc((unsigned) sz); + char *p; + struct outname *onm = (struct outname *) malloc((((unsigned)sz+8)/9)*sizeof(struct outname)); struct xnm { unsigned short s_type, s_seg; long s_value; @@ -447,8 +447,8 @@ rd_ohead(h) Elf32_Shdr *shdr; Elf_Data *sectnames; Elf_Data *dt; - register struct nlist *dn; - register Elf32_Sym *n; + struct nlist *dn; + Elf32_Sym *n; long text_offset, data_offset, bss_offset, fun_offset; int fixnamoff = 0, newfixnamoff = 0; @@ -608,8 +608,8 @@ rd_name(nm, count) struct outname *nm; unsigned int count; { - register struct nlist *dn = dbtab; - register struct outname *n = nm; + struct nlist *dn = dbtab; + struct outname *n = nm; while (dn < maxdn) { if (dn->n_type & N_STAB) { n->on_type = dn->n_type << 8; diff --git a/util/grind/run.c b/util/grind/run.c index 2dab0f8ec8..fbf44affcd 100644 --- a/util/grind/run.c +++ b/util/grind/run.c @@ -54,11 +54,11 @@ p_tree run_command; static void ITOBUF(p, l, sz) - register char *p; + char *p; long l; int sz; { - register int i; + int i; p +=sz; for (i = sz; i > 0; i--) { @@ -69,11 +69,11 @@ ITOBUF(p, l, sz) static long BUFTOI(p, sz) - register char *p; + char *p; int sz; { - register long l = 0; - register int i; + long l = 0; + int i; for (i = sz; i>0; i--) { l = (l << 8) | (*p++ & 0377); @@ -109,7 +109,7 @@ start_child(p) /* start up the process to be debugged and set up communication */ char *argp[MAXARG]; /* argument list */ - register p_tree pt = p->t_args[0], pt1 = 0; + p_tree pt = p->t_args[0], pt1 = 0; unsigned int nargs = 1; /* #args */ char *in_redirect = 0; /* standard input redirected */ char *out_redirect = 0; /* standard output redirected */ @@ -640,7 +640,7 @@ get_EM_regs(level) { struct message_hdr m; static t_addr buf[5]; - register t_addr *to = &buf[0]; + t_addr *to = &buf[0]; m.m_type = M_GETEMREGS; ITOBUF(m.m_buf+1, (long) level, LS); diff --git a/util/grind/scope.cc b/util/grind/scope.cc index 33a3db235b..e98f9d8360 100644 --- a/util/grind/scope.cc +++ b/util/grind/scope.cc @@ -24,7 +24,7 @@ static int cmp_starts(s1, s2) char *s1, *s2; { - register p_scope c1 = (p_scope)s1, c2 = (p_scope)s2; + p_scope c1 = (p_scope)s1, c2 = (p_scope)s2; return c1->sc_start < c2->sc_start ? -1 @@ -38,7 +38,7 @@ open_scope(name, has_activation) p_symbol name; int has_activation; { - register p_scope sc = new_scope(); + p_scope sc = new_scope(); sc->sc_has_activation_record = has_activation; sc->sc_static_encl = CurrentScope; @@ -50,7 +50,7 @@ open_scope(name, has_activation) init_scope() { - register p_scope sc = new_scope(); + p_scope sc = new_scope(); PervasiveScope = sc; CurrentScope = sc; @@ -62,7 +62,7 @@ init_scope() close_scope() { - register p_scope sc = CurrentScope; + p_scope sc = CurrentScope; assert(sc != 0); CurrentScope = sc->sc_static_encl; @@ -112,7 +112,7 @@ get_next_scope_from_addr(a) */ int has_static_link(sc) - register p_scope sc; + p_scope sc; { return sc->sc_proclevel > 1; } @@ -122,7 +122,7 @@ has_static_link(sc) */ p_scope base_scope(sc) - register p_scope sc; + p_scope sc; { while (sc && ! sc->sc_has_activation_record) { sc = sc->sc_static_encl; @@ -137,7 +137,7 @@ int scope_encloses(scope, from_scope) p_scope scope, from_scope; { - register p_scope sc = from_scope; + p_scope sc = from_scope; while (sc) { if (sc == scope) return 1; diff --git a/util/grind/symbol.c b/util/grind/symbol.c index fa4041622c..23b94b0ae2 100644 --- a/util/grind/symbol.c +++ b/util/grind/symbol.c @@ -25,10 +25,10 @@ extern FILE *db_out; p_symbol NewSymbol(s, scope, class, nam) char *s; - register p_scope scope; + p_scope scope; struct outname *nam; { - register p_symbol sym; + p_symbol sym; sym = new_symbol(); sym->sy_idf = str2idf(s, 0); @@ -63,7 +63,7 @@ Lookup(id, scope, class) p_scope scope; int class; { - register p_symbol p = id ? id->id_def : 0; + p_symbol p = id ? id->id_def : 0; while (p) { if (p->sy_scope == scope && (p->sy_class & class)) { @@ -79,14 +79,14 @@ Lookup(id, scope, class) */ p_symbol Lookfromscope(id, class, sc) - register struct idf *id; + struct idf *id; int class; - register p_scope sc; + p_scope sc; { if (! id) return (p_symbol) 0; while (sc) { - register p_symbol sym = id->id_def; + p_symbol sym = id->id_def; while (sym) { if (sym->sy_scope == sc && (sym->sy_class & class)) { return sym; @@ -104,11 +104,11 @@ p_symbol add_file(s) char *s; { - register p_symbol sym = NewSymbol(s, + p_symbol sym = NewSymbol(s, PervasiveScope, FILESYM, (struct outname *) 0); - register char *p; + char *p; sym->sy_file = new_file(); sym->sy_file->f_sym = sym; @@ -216,7 +216,7 @@ identify(p, class_set) int class_set; { p_symbol sym = 0, sym1 = 0; - register p_symbol s; + p_symbol s; p_tree arg; int precise = 0; @@ -342,7 +342,7 @@ pr_sym(s) resolve_cross(tp) p_type tp; { - register p_symbol sym = tp->ty_sym->sy_idf->id_def; + p_symbol sym = tp->ty_sym->sy_idf->id_def; while (sym) { if (sym->sy_class == TAG && diff --git a/util/grind/tokenname.c b/util/grind/tokenname.c index d1e11e4518..d7ab33a5d9 100644 --- a/util/grind/tokenname.c +++ b/util/grind/tokenname.c @@ -81,12 +81,12 @@ struct tokenname tkstandard[] = { /* standard identifiers */ /* Some routines to handle tokennames */ reserve(resv) - register struct tokenname *resv; + struct tokenname *resv; { /* The names of the tokens described in resv are entered as reserved words. */ - register struct idf *p; + struct idf *p; while (resv->tn_symbol) { p = str2idf(resv->tn_name, 0); diff --git a/util/grind/tree.c b/util/grind/tree.c index ec80ab2adb..8762098ddd 100644 --- a/util/grind/tree.c +++ b/util/grind/tree.c @@ -34,11 +34,11 @@ p_tree mknode(int op, ...) { va_list ap; - register p_tree p = new_tree(); + p_tree p = new_tree(); va_start(ap, op); { - register int i, na; + int i, na; p->t_oper = op; #else @@ -48,11 +48,11 @@ mknode(va_alist) va_dcl { va_list ap; - register p_tree p = new_tree(); + p_tree p = new_tree(); va_start(ap); { - register int i, na; + int i, na; p->t_oper = va_arg(ap, int); #endif @@ -89,9 +89,9 @@ mknode(va_alist) } freenode(p) - register p_tree p; + p_tree p; { - register int na, i; + int na, i; if (! p) return; na = nargs(p->t_oper); @@ -107,7 +107,7 @@ get_addr_from_node(p) p_tree p; { t_addr a = ILL_ADDR; - register p_symbol sym; + p_symbol sym; if (! p) return NO_ADDR; if (p->t_address != 0) return p->t_address; @@ -173,8 +173,8 @@ get_addr_from_node(p) static int ommit_commas = 0; print_node(f, p, top_level) - register p_tree p; - register FILE *f; + p_tree p; + FILE *f; { if (!p) return; switch(p->t_oper) { @@ -454,9 +454,9 @@ eval(p) } newfile(id) - register struct idf *id; + struct idf *id; { - register p_symbol sym = Lookup(id, PervasiveScope, FILESYM); + p_symbol sym = Lookup(id, PervasiveScope, FILESYM); if (listfile != sym) listline = 1; listfile = sym; @@ -471,7 +471,7 @@ newfile(id) int in_wheninvoked; perform(p, a) - register p_tree p; + p_tree p; t_addr a; { switch(p->t_oper) { @@ -490,7 +490,7 @@ perform(p, a) break; case OP_TRACE: if (p->t_args[0] && p->t_args[0]->t_oper == OP_IN) { - register p_scope sc = base_scope(CurrentScope); + p_scope sc = base_scope(CurrentScope); if (sc != get_scope_from_addr(p->t_args[0]->t_address)) { break; diff --git a/util/grind/type.c b/util/grind/type.c index 969b0fa94d..6364de708c 100644 --- a/util/grind/type.c +++ b/util/grind/type.c @@ -63,7 +63,7 @@ subrange_type(A, base_index, c1, c2, result_index) long c1, c2; { int itself = 0; - register p_type p; + p_type p; p_type base_type; if (!A) { @@ -102,7 +102,7 @@ subrange_type(A, base_index, c1, c2, result_index) c1 = -c2 - 1 and base_index indicates int_type or itself -> integer */ if (itself || base_type == int_type) { - register struct integer_types *ip = 0; + struct integer_types *ip = 0; if (c1 == 0) { ip = &u_types[0]; } @@ -148,7 +148,7 @@ subrange_type(A, base_index, c1, c2, result_index) static long nel(tp) - register p_type tp; + p_type tp; { switch(tp->ty_class) { case T_SUBRANGE: @@ -174,7 +174,7 @@ p_type array_type(bound_type, el_type) p_type bound_type, el_type; { - register p_type tp = new_type(); + p_type tp = new_type(); tp->ty_class = T_ARRAY; tp->ty_index = bound_type; @@ -207,7 +207,7 @@ basic_type(fund, size) int fund; long size; { - register p_type p = new_type(); + p_type p = new_type(); p->ty_class = fund; p->ty_size = size; @@ -215,10 +215,10 @@ basic_type(fund, size) } set_bounds(tp) - register p_type tp; + p_type tp; { /* Determine the size and low of a set type */ - register p_type base = tp->ty_setbase; + p_type base = tp->ty_setbase; if (base->ty_class == T_SUBRANGE) { tp->ty_size = (base->ty_up - base->ty_low + 7) >> 3; @@ -237,8 +237,8 @@ set_bounds(tp) init_types() { - register int i = 0; - register long x = 0; + int i = 0; + long x = 0; while (x >= 0) { i++; @@ -285,8 +285,8 @@ p_type * tp_lookup(type_index) int *type_index; { - register int i; - register struct tp_index *p; + int i; + struct tp_index *p; while (type_index[0] >= list_len) { if (list_len) { @@ -319,10 +319,10 @@ tp_lookup(type_index) clean_tp_tab() { if (list_len) { - register int i = list_len; + int i = list_len; while (--i >= 0) { - register int j = list_row[i].len; + int j = list_row[i].len; if (j) { while (--j > 0) { p_type p = list_row[i].row[j/NINCR][j%NINCR]; @@ -348,7 +348,7 @@ clean_tp_tab() } end_literal(tp, maxval) - register p_type tp; + p_type tp; long maxval; { tp->ty_literals = (struct literal *) @@ -384,8 +384,8 @@ add_param_type(v, s) int v; /* 'v' or 'i' for address, 'p' for value */ p_symbol s; /* parameter itself */ { - register p_scope sc = base_scope(s->sy_scope); - register p_type prc_type; + p_scope sc = base_scope(s->sy_scope); + p_type prc_type; if (! sc) return; prc_type = sc->sc_definedby->sy_type; diff --git a/util/int/alloc.c b/util/int/alloc.c index f4765bf78b..ad6dd79f37 100644 --- a/util/int/alloc.c +++ b/util/int/alloc.c @@ -15,7 +15,7 @@ */ char* Malloc(size sz, char* descr) { - register char* new = malloc((unsigned int)(sz)); + char* new = malloc((unsigned int)(sz)); if (new == (char*)0 && descr != (char*)0) fatal("Cannot allocate %s", descr); @@ -23,9 +23,9 @@ char* Malloc(size sz, char* descr) #ifdef DB_MALLOC /* from debug.h */ /* fill area with recognizable garbage */ { - register char* p = new; - register size i = sz; - register char ch = 0252; + char* p = new; + size i = sz; + char ch = 0252; if (p) { @@ -48,7 +48,7 @@ char* Malloc(size sz, char* descr) */ char* Realloc(char* old, size sz, char* descr) { - register char* new = realloc(old, (unsigned int)(sz)); + char* new = realloc(old, (unsigned int)(sz)); if (new == (char*)0) fatal("Cannot reallocate %s", descr); diff --git a/util/int/data.c b/util/int/data.c index f4deef2889..0bc3cb480f 100644 --- a/util/int/data.c +++ b/util/int/data.c @@ -23,8 +23,8 @@ extern size maxheap; /* from main.c */ #ifdef LOGGING char* data_sh; /* shadowbytes */ -PRIVATE void warn_dtbits(ptr, size); -PRIVATE void dt_clear_area(ptr, ptr); +static void warn_dtbits(ptr, size); +static void dt_clear_area(ptr, ptr); #endif /* LOGGING */ /** Initialize the heap with "hb" address. */ @@ -52,7 +52,7 @@ void init_data(ptr hb) /** Grows the heap space with the new heap pointer. */ void newHP(ptr ap) { - register ptr p = ap; + ptr p = ap; if (in_gda(p)) { @@ -106,10 +106,10 @@ void newHP(ptr ap) ************************************************************************/ /** Store data pointer "ap" at address "addr". */ -void dt_stdp(register ptr addr, ptr ap) +void dt_stdp(ptr addr, ptr ap) { - register int i; - register long p = (long)ap; + int i; + long p = (long)ap; LOG(("@g6 dt_stdp(%lu, %lu)", addr, p)); ch_in_data(addr, psize); @@ -123,10 +123,10 @@ void dt_stdp(register ptr addr, ptr ap) } } -void dt_stip(register ptr addr, ptr ap) +void dt_stip(ptr addr, ptr ap) { - register int i; - register long p = (long)ap; + int i; + long p = (long)ap; LOG(("@g6 dt_stip(%lu, %lu)", addr, p)); ch_in_data(addr, psize); @@ -141,10 +141,10 @@ void dt_stip(register ptr addr, ptr ap) } /** Store "n" byte integer "al" at address "addr". */ -void dt_stn(register ptr addr, long al, size n) +void dt_stn(ptr addr, long al, size n) { - register int i; - register long l = al; + int i; + long l = al; #ifdef LOGGING /* a psize zero is ambiguous */ int sh_flags = (l == 0 && n == psize) ? (SH_INT | SH_DATAP) : SH_INT; @@ -165,10 +165,10 @@ void dt_stn(register ptr addr, long al, size n) } /** Store word sized integer "al" at address. */ -void dt_stw(register ptr addr, long al) +void dt_stw(ptr addr, long al) { - register int i; - register long l = al; + int i; + long l = al; #ifdef LOGGING /* a psize zero is ambiguous */ int sh_flags = (l == 0 && wsize == psize) ? (SH_INT | SH_DATAP) : SH_INT; @@ -190,10 +190,10 @@ void dt_stw(register ptr addr, long al) #ifndef NOFLOAT /** Store a real value "f" or size "n" bytes at address "addr". */ -void dt_stf(register ptr addr, double f, register size n) +void dt_stf(ptr addr, double f, size n) { - register char* cp = (char*)&f; - register int i; + char* cp = (char*)&f; + int i; float fl; LOG(("@g6 dt_stf(%lu, %g, %lu)", addr, f, n)); @@ -227,9 +227,9 @@ void dt_stf(register ptr addr, double f, register size n) ************************************************************************/ /** Load a data segment pointer located at address "addr". */ -ptr dt_lddp(register ptr addr) +ptr dt_lddp(ptr addr) { - register ptr p; + ptr p; LOG(("@g6 dt_lddp(%lu)", addr)); @@ -248,9 +248,9 @@ ptr dt_lddp(register ptr addr) return (p); } -ptr dt_ldip(register ptr addr) +ptr dt_ldip(ptr addr) { - register ptr p; + ptr p; LOG(("@g6 dt_ldip(%lu)", addr)); @@ -270,10 +270,10 @@ ptr dt_ldip(register ptr addr) } /** Load an unsigned integer of "n" bytes from address "addr". */ -unsigned long dt_ldu(register ptr addr, size n) +unsigned long dt_ldu(ptr addr, size n) { - register int i; - register unsigned long u = 0; + int i; + unsigned long u = 0; LOG(("@g6 dt_ldu(%lu, %lu)", addr, n)); @@ -297,10 +297,10 @@ unsigned long dt_ldu(register ptr addr, size n) } /** Load an unsigned integer of word size from address "addr". */ -unsigned long dt_lduw(register ptr addr) +unsigned long dt_lduw(ptr addr) { - register int i; - register unsigned long u = 0; + int i; + unsigned long u = 0; LOG(("@g6 dt_lduw(%lu)", addr)); @@ -324,10 +324,10 @@ unsigned long dt_lduw(register ptr addr) } /** Load an integer of size "n" bytes from address "addr". */ -long dt_lds(register ptr addr, size n) +long dt_lds(ptr addr, size n) { - register int i; - register long l; + int i; + long l; LOG(("@g6 dt_lds(%lu, %lu)", addr, n)); @@ -352,10 +352,10 @@ long dt_lds(register ptr addr, size n) } /** Load a word size integer from address "addr". */ -long dt_ldsw(register ptr addr) +long dt_ldsw(ptr addr) { - register int i; - register long l; + int i; + long l; LOG(("@g6 dt_ldsw(%lu)", addr)); @@ -393,7 +393,7 @@ long dt_ldsw(register ptr addr) /** Move "n" bytes from "d1" to "d2". */ void dt_mvd(ptr d2, ptr d1, size n) { - register int i; + int i; ch_in_data(d1, n); ch_wordaligned(d1); @@ -413,7 +413,7 @@ void dt_mvd(ptr d2, ptr d1, size n) /** Move "n" bytes from stack address "s" to data address "d". */ void dt_mvs(ptr d, ptr s, size n) /* s -> d */ { - register int i; + int i; ch_in_stack(s, n); ch_wordaligned(s); @@ -433,10 +433,10 @@ void dt_mvs(ptr d, ptr s, size n) /* s -> d */ #ifdef LOGGING -PRIVATE void warn_dtbits(ptr addr, size n) +static void warn_dtbits(ptr addr, size n) { - register int or_bits = 0; - register int and_bits = 0xff; + int or_bits = 0; + int and_bits = 0xff; while (n--) { @@ -466,7 +466,7 @@ PRIVATE void warn_dtbits(ptr addr, size n) void dt_clear_area(ptr from, ptr to) { /* includes *from but excludes *to */ - register ptr a; + ptr a; for (a = from; a < to; a++) { diff --git a/util/int/data.h b/util/int/data.h index 97c25450d6..312400f932 100644 --- a/util/int/data.h +++ b/util/int/data.h @@ -10,20 +10,20 @@ void init_data(ptr hb); void newHP(ptr ap); -void dt_stdp(register ptr addr, ptr ap); -void dt_stn(register ptr addr, long al, size n); -void dt_stw(register ptr addr, long al); -void dt_stip(register ptr addr, ptr ap); +void dt_stdp(ptr addr, ptr ap); +void dt_stn(ptr addr, long al, size n); +void dt_stw(ptr addr, long al); +void dt_stip(ptr addr, ptr ap); #ifndef NOFLOAT -void dt_stf(register ptr addr, double f, register size n); +void dt_stf(ptr addr, double f, size n); #endif ptr dt_ldip(ptr addr); -ptr dt_lddp(register ptr addr); -unsigned long dt_ldu(register ptr addr, size n); -unsigned long dt_lduw(register ptr addr); -long dt_lds(register ptr addr, size n); -long dt_ldsw(register ptr addr); +ptr dt_lddp(ptr addr); +unsigned long dt_ldu(ptr addr, size n); +unsigned long dt_lduw(ptr addr); +long dt_lds(ptr addr, size n); +long dt_ldsw(ptr addr); void dt_mvd(ptr d2, ptr d1, size n); void dt_mvs(ptr d, ptr s, size n); diff --git a/util/int/disassemble.c b/util/int/disassemble.c index 5ec7a93c45..ccd962f139 100644 --- a/util/int/disassemble.c +++ b/util/int/disassemble.c @@ -11,8 +11,8 @@ #include "alloc.h" #include "whatever.h" -PRIVATE ptr TC; -PRIVATE void do_pr_instr(unsigned int); +static ptr TC; +static void do_pr_instr(unsigned int); /* This text is copied and modified from text.h */ @@ -61,1702 +61,1702 @@ PRIVATE void do_pr_instr(unsigned int); /* This text was generated by mkswitch Pr and then modified */ -PRIVATE void PrAARl2(long arg) +static void PrAARl2(long arg) { printf(" AAR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrAARm(long arg) +static void PrAARm(long arg) { printf(" AAR %ld\n", arg); } -PRIVATE void PrAARz(void) +static void PrAARz(void) { printf(" AAR\n"); } -PRIVATE void PrADFl2(long arg) +static void PrADFl2(long arg) { printf(" ADF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrADFs(long hob, size wfac) +static void PrADFs(long hob, size wfac) { printf(" ADF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrADFz(void) +static void PrADFz(void) { printf(" ADF\n"); } -PRIVATE void PrADIl2(long arg) +static void PrADIl2(long arg) { printf(" ADI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrADIm(long arg) +static void PrADIm(long arg) { printf(" ADI %ld\n", arg); } -PRIVATE void PrADIz(void) +static void PrADIz(void) { printf(" ADI\n"); } -PRIVATE void PrADPl2(long arg) +static void PrADPl2(long arg) { printf(" ADP %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrADPl4(long arg) +static void PrADPl4(long arg) { printf(" ADP %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrADPm(long arg) +static void PrADPm(long arg) { printf(" ADP %ld\n", arg); } -PRIVATE void PrADPs(long hob, size wfac) +static void PrADPs(long hob, size wfac) { printf(" ADP %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrADSl2(long arg) +static void PrADSl2(long arg) { printf(" ADS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrADSm(long arg) +static void PrADSm(long arg) { printf(" ADS %ld\n", arg); } -PRIVATE void PrADSz(void) +static void PrADSz(void) { printf(" ADS\n"); } -PRIVATE void PrADUl2(long arg) +static void PrADUl2(long arg) { printf(" ADU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrADUz(void) +static void PrADUz(void) { printf(" ADU\n"); } -PRIVATE void PrANDl2(long arg) +static void PrANDl2(long arg) { printf(" AND %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrANDm(long arg) +static void PrANDm(long arg) { printf(" AND %ld\n", arg); } -PRIVATE void PrANDz(void) +static void PrANDz(void) { printf(" AND\n"); } -PRIVATE void PrASPl2(long arg) +static void PrASPl2(long arg) { printf(" ASP %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrASPl4(long arg) +static void PrASPl4(long arg) { printf(" ASP %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrASPm(long arg) +static void PrASPm(long arg) { printf(" ASP %ld\n", arg); } -PRIVATE void PrASPs(long hob, size wfac) +static void PrASPs(long hob, size wfac) { printf(" ASP %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrASSl2(long arg) +static void PrASSl2(long arg) { printf(" ASS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrASSz(void) +static void PrASSz(void) { printf(" ASS\n"); } -PRIVATE void PrBEQl2(long arg) +static void PrBEQl2(long arg) { printf(" BEQ %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBEQl4(long arg) +static void PrBEQl4(long arg) { printf(" BEQ %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBEQs(long hob, size wfac) +static void PrBEQs(long hob, size wfac) { printf(" BEQ %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBGEl2(long arg) +static void PrBGEl2(long arg) { printf(" BGE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBGEl4(long arg) +static void PrBGEl4(long arg) { printf(" BGE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBGEs(long hob, size wfac) +static void PrBGEs(long hob, size wfac) { printf(" BGE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBGTl2(long arg) +static void PrBGTl2(long arg) { printf(" BGT %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBGTl4(long arg) +static void PrBGTl4(long arg) { printf(" BGT %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBGTs(long hob, size wfac) +static void PrBGTs(long hob, size wfac) { printf(" BGT %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBLEl2(long arg) +static void PrBLEl2(long arg) { printf(" BLE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBLEl4(long arg) +static void PrBLEl4(long arg) { printf(" BLE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBLEs(long hob, size wfac) +static void PrBLEs(long hob, size wfac) { printf(" BLE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBLMl2(long arg) +static void PrBLMl2(long arg) { printf(" BLM %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBLMl4(long arg) +static void PrBLMl4(long arg) { printf(" BLM %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBLMs(long hob, size wfac) +static void PrBLMs(long hob, size wfac) { printf(" BLM %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBLSl2(long arg) +static void PrBLSl2(long arg) { printf(" BLS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBLSz(void) +static void PrBLSz(void) { printf(" BLS\n"); } -PRIVATE void PrBLTl2(long arg) +static void PrBLTl2(long arg) { printf(" BLT %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBLTl4(long arg) +static void PrBLTl4(long arg) { printf(" BLT %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBLTs(long hob, size wfac) +static void PrBLTs(long hob, size wfac) { printf(" BLT %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBNEl2(long arg) +static void PrBNEl2(long arg) { printf(" BNE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBNEl4(long arg) +static void PrBNEl4(long arg) { printf(" BNE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBNEs(long hob, size wfac) +static void PrBNEs(long hob, size wfac) { printf(" BNE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrBRAl2(long arg) +static void PrBRAl2(long arg) { printf(" BRA %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrBRAl4(long arg) +static void PrBRAl4(long arg) { printf(" BRA %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrBRAs(long hob, size wfac) +static void PrBRAs(long hob, size wfac) { printf(" BRA %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrCAIz(void) +static void PrCAIz(void) { printf(" CAI\n"); } -PRIVATE void PrCALl2(long arg) +static void PrCALl2(long arg) { printf(" CAL %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCALl4(long arg) +static void PrCALl4(long arg) { printf(" CAL %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrCALm(long arg) +static void PrCALm(long arg) { printf(" CAL %ld\n", arg); } -PRIVATE void PrCALs(long hob, size wfac) +static void PrCALs(long hob, size wfac) { printf(" CAL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrCFFz(void) +static void PrCFFz(void) { printf(" CFF\n"); } -PRIVATE void PrCFIz(void) +static void PrCFIz(void) { printf(" CFI\n"); } -PRIVATE void PrCFUz(void) +static void PrCFUz(void) { printf(" CFU\n"); } -PRIVATE void PrCIFz(void) +static void PrCIFz(void) { printf(" CIF\n"); } -PRIVATE void PrCIIz(void) +static void PrCIIz(void) { printf(" CII\n"); } -PRIVATE void PrCIUz(void) +static void PrCIUz(void) { printf(" CIU\n"); } -PRIVATE void PrCMFl2(long arg) +static void PrCMFl2(long arg) { printf(" CMF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCMFs(long hob, size wfac) +static void PrCMFs(long hob, size wfac) { printf(" CMF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrCMFz(void) +static void PrCMFz(void) { printf(" CMF\n"); } -PRIVATE void PrCMIl2(long arg) +static void PrCMIl2(long arg) { printf(" CMI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCMIm(long arg) +static void PrCMIm(long arg) { printf(" CMI %ld\n", arg); } -PRIVATE void PrCMIz(void) +static void PrCMIz(void) { printf(" CMI\n"); } -PRIVATE void PrCMPz(void) +static void PrCMPz(void) { printf(" CMP\n"); } -PRIVATE void PrCMSl2(long arg) +static void PrCMSl2(long arg) { printf(" CMS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCMSs(long hob, size wfac) +static void PrCMSs(long hob, size wfac) { printf(" CMS %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrCMSz(void) +static void PrCMSz(void) { printf(" CMS\n"); } -PRIVATE void PrCMUl2(long arg) +static void PrCMUl2(long arg) { printf(" CMU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCMUz(void) +static void PrCMUz(void) { printf(" CMU\n"); } -PRIVATE void PrCOMl2(long arg) +static void PrCOMl2(long arg) { printf(" COM %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCOMz(void) +static void PrCOMz(void) { printf(" COM\n"); } -PRIVATE void PrCSAl2(long arg) +static void PrCSAl2(long arg) { printf(" CSA %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCSAm(long arg) +static void PrCSAm(long arg) { printf(" CSA %ld\n", arg); } -PRIVATE void PrCSAz(void) +static void PrCSAz(void) { printf(" CSA\n"); } -PRIVATE void PrCSBl2(long arg) +static void PrCSBl2(long arg) { printf(" CSB %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrCSBm(long arg) +static void PrCSBm(long arg) { printf(" CSB %ld\n", arg); } -PRIVATE void PrCSBz(void) +static void PrCSBz(void) { printf(" CSB\n"); } -PRIVATE void PrCUFz(void) +static void PrCUFz(void) { printf(" CUF\n"); } -PRIVATE void PrCUIz(void) +static void PrCUIz(void) { printf(" CUI\n"); } -PRIVATE void PrCUUz(void) +static void PrCUUz(void) { printf(" CUU\n"); } -PRIVATE void PrDCHz(void) +static void PrDCHz(void) { printf(" DCH\n"); } -PRIVATE void PrDECz(void) +static void PrDECz(void) { printf(" DEC\n"); } -PRIVATE void PrDEEl2(long arg) +static void PrDEEl2(long arg) { printf(" DEE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDEEl4(long arg) +static void PrDEEl4(long arg) { printf(" DEE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrDEEs(long hob, size wfac) +static void PrDEEs(long hob, size wfac) { printf(" DEE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrDELn2(long arg) +static void PrDELn2(long arg) { printf(" DEL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrDELn4(long arg) +static void PrDELn4(long arg) { printf(" DEL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrDELp2(long arg) +static void PrDELp2(long arg) { printf(" DEL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrDELp4(long arg) +static void PrDELp4(long arg) { printf(" DEL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrDELs(long hob, size wfac) +static void PrDELs(long hob, size wfac) { printf(" DEL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrDUPl2(long arg) +static void PrDUPl2(long arg) { printf(" DUP %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDUPm(long arg) +static void PrDUPm(long arg) { printf(" DUP %ld\n", arg); } -PRIVATE void PrDUSl2(long arg) +static void PrDUSl2(long arg) { printf(" DUS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDUSz(void) +static void PrDUSz(void) { printf(" DUS\n"); } -PRIVATE void PrDVFl2(long arg) +static void PrDVFl2(long arg) { printf(" DVF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDVFs(long hob, size wfac) +static void PrDVFs(long hob, size wfac) { printf(" DVF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrDVFz(void) +static void PrDVFz(void) { printf(" DVF\n"); } -PRIVATE void PrDVIl2(long arg) +static void PrDVIl2(long arg) { printf(" DVI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDVIm(long arg) +static void PrDVIm(long arg) { printf(" DVI %ld\n", arg); } -PRIVATE void PrDVIz(void) +static void PrDVIz(void) { printf(" DVI\n"); } -PRIVATE void PrDVUl2(long arg) +static void PrDVUl2(long arg) { printf(" DVU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrDVUz(void) +static void PrDVUz(void) { printf(" DVU\n"); } -PRIVATE void PrEXGl2(long arg) +static void PrEXGl2(long arg) { printf(" EXG %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrEXGs(long hob, size wfac) +static void PrEXGs(long hob, size wfac) { printf(" EXG %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrEXGz(void) +static void PrEXGz(void) { printf(" EXG\n"); } -PRIVATE void PrFEFl2(long arg) +static void PrFEFl2(long arg) { printf(" FEF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrFEFz(void) +static void PrFEFz(void) { printf(" FEF\n"); } -PRIVATE void PrFIFl2(long arg) +static void PrFIFl2(long arg) { printf(" FIF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrFIFz(void) +static void PrFIFz(void) { printf(" FIF\n"); } -PRIVATE void PrFILu(long arg) +static void PrFILu(long arg) { printf(" FIL %ld\n", Ut_arg() * arg); } -PRIVATE void PrFILl4(long arg) +static void PrFILl4(long arg) { printf(" FIL %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrGTOu(long arg) +static void PrGTOu(long arg) { printf(" GTO %ld\n", Ut_arg() * arg); } -PRIVATE void PrGTOl4(long arg) +static void PrGTOl4(long arg) { printf(" GTO %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrINCz(void) +static void PrINCz(void) { printf(" INC\n"); } -PRIVATE void PrINEl2(long arg) +static void PrINEl2(long arg) { printf(" INE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrINEl4(long arg) +static void PrINEl4(long arg) { printf(" INE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrINEs(long hob, size wfac) +static void PrINEs(long hob, size wfac) { printf(" INE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrINLm(long arg) +static void PrINLm(long arg) { printf(" INL %ld\n", arg); } -PRIVATE void PrINLn2(long arg) +static void PrINLn2(long arg) { printf(" INL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrINLn4(long arg) +static void PrINLn4(long arg) { printf(" INL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrINLp2(long arg) +static void PrINLp2(long arg) { printf(" INL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrINLp4(long arg) +static void PrINLp4(long arg) { printf(" INL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrINLs(long hob, size wfac) +static void PrINLs(long hob, size wfac) { printf(" INL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrINNl2(long arg) +static void PrINNl2(long arg) { printf(" INN %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrINNs(long hob, size wfac) +static void PrINNs(long hob, size wfac) { printf(" INN %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrINNz(void) +static void PrINNz(void) { printf(" INN\n"); } -PRIVATE void PrIORl2(long arg) +static void PrIORl2(long arg) { printf(" IOR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrIORm(long arg) +static void PrIORm(long arg) { printf(" IOR %ld\n", arg); } -PRIVATE void PrIORs(long hob, size wfac) +static void PrIORs(long hob, size wfac) { printf(" IOR %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrIORz(void) +static void PrIORz(void) { printf(" IOR\n"); } -PRIVATE void PrLAEu(long arg) +static void PrLAEu(long arg) { printf(" LAE %ld\n", Ut_arg() * arg); } -PRIVATE void PrLAEl4(long arg) +static void PrLAEl4(long arg) { printf(" LAE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLAEs(long hob, size wfac) +static void PrLAEs(long hob, size wfac) { printf(" LAE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLALm(long arg) +static void PrLALm(long arg) { printf(" LAL %ld\n", arg); } -PRIVATE void PrLALn2(long arg) +static void PrLALn2(long arg) { printf(" LAL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrLALn4(long arg) +static void PrLALn4(long arg) { printf(" LAL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrLALp2(long arg) +static void PrLALp2(long arg) { printf(" LAL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrLALp4(long arg) +static void PrLALp4(long arg) { printf(" LAL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrLALs(long hob, size wfac) +static void PrLALs(long hob, size wfac) { printf(" LAL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLARl2(long arg) +static void PrLARl2(long arg) { printf(" LAR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLARm(long arg) +static void PrLARm(long arg) { printf(" LAR %ld\n", arg); } -PRIVATE void PrLARz(void) +static void PrLARz(void) { printf(" LAR\n"); } -PRIVATE void PrLDCl2(long arg) +static void PrLDCl2(long arg) { printf(" LDC %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLDCl4(long arg) +static void PrLDCl4(long arg) { printf(" LDC %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLDCm(long arg) +static void PrLDCm(long arg) { printf(" LDC %ld\n", arg); } -PRIVATE void PrLDEl2(long arg) +static void PrLDEl2(long arg) { printf(" LDE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLDEl4(long arg) +static void PrLDEl4(long arg) { printf(" LDE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLDEs(long hob, size wfac) +static void PrLDEs(long hob, size wfac) { printf(" LDE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLDFl2(long arg) +static void PrLDFl2(long arg) { printf(" LDF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLDFl4(long arg) +static void PrLDFl4(long arg) { printf(" LDF %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLDLm(long arg) +static void PrLDLm(long arg) { printf(" LDL %ld\n", arg); } -PRIVATE void PrLDLn2(long arg) +static void PrLDLn2(long arg) { printf(" LDL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrLDLn4(long arg) +static void PrLDLn4(long arg) { printf(" LDL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrLDLp2(long arg) +static void PrLDLp2(long arg) { printf(" LDL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrLDLp4(long arg) +static void PrLDLp4(long arg) { printf(" LDL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrLDLs(long hob, size wfac) +static void PrLDLs(long hob, size wfac) { printf(" LDL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLFRl2(long arg) +static void PrLFRl2(long arg) { printf(" LFR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLFRm(long arg) +static void PrLFRm(long arg) { printf(" LFR %ld\n", arg); } -PRIVATE void PrLFRs(long hob, size wfac) +static void PrLFRs(long hob, size wfac) { printf(" LFR %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLILm(long arg) +static void PrLILm(long arg) { printf(" LIL %ld\n", arg); } -PRIVATE void PrLILn2(long arg) +static void PrLILn2(long arg) { printf(" LIL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrLILn4(long arg) +static void PrLILn4(long arg) { printf(" LIL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrLILp2(long arg) +static void PrLILp2(long arg) { printf(" LIL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrLILp4(long arg) +static void PrLILp4(long arg) { printf(" LIL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrLILs(long hob, size wfac) +static void PrLILs(long hob, size wfac) { printf(" LIL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLIMz(void) +static void PrLIMz(void) { printf(" LIM\n"); } -PRIVATE void PrLINl2(long arg) +static void PrLINl2(long arg) { printf(" LIN %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLINl4(long arg) +static void PrLINl4(long arg) { printf(" LIN %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLINs(long hob, size wfac) +static void PrLINs(long hob, size wfac) { printf(" LIN %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLNIz(void) +static void PrLNIz(void) { printf(" LNI\n"); } -PRIVATE void PrLOCl2(long arg) +static void PrLOCl2(long arg) { printf(" LOC %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLOCl4(long arg) +static void PrLOCl4(long arg) { printf(" LOC %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLOCm(long arg) +static void PrLOCm(long arg) { printf(" LOC %ld\n", arg); } -PRIVATE void PrLOCs(long hob, size wfac) +static void PrLOCs(long hob, size wfac) { printf(" LOC %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLOEl2(long arg) +static void PrLOEl2(long arg) { printf(" LOE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLOEl4(long arg) +static void PrLOEl4(long arg) { printf(" LOE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLOEs(long hob, size wfac) +static void PrLOEs(long hob, size wfac) { printf(" LOE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLOFl2(long arg) +static void PrLOFl2(long arg) { printf(" LOF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLOFl4(long arg) +static void PrLOFl4(long arg) { printf(" LOF %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLOFm(long arg) +static void PrLOFm(long arg) { printf(" LOF %ld\n", arg); } -PRIVATE void PrLOFs(long hob, size wfac) +static void PrLOFs(long hob, size wfac) { printf(" LOF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLOIl2(long arg) +static void PrLOIl2(long arg) { printf(" LOI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLOIl4(long arg) +static void PrLOIl4(long arg) { printf(" LOI %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLOIm(long arg) +static void PrLOIm(long arg) { printf(" LOI %ld\n", arg); } -PRIVATE void PrLOIs(long hob, size wfac) +static void PrLOIs(long hob, size wfac) { printf(" LOI %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLOLm(long arg) +static void PrLOLm(long arg) { printf(" LOL %ld\n", arg); } -PRIVATE void PrLOLn2(long arg) +static void PrLOLn2(long arg) { printf(" LOL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrLOLn4(long arg) +static void PrLOLn4(long arg) { printf(" LOL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrLOLp2(long arg) +static void PrLOLp2(long arg) { printf(" LOL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrLOLp4(long arg) +static void PrLOLp4(long arg) { printf(" LOL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrLOLs(long hob, size wfac) +static void PrLOLs(long hob, size wfac) { printf(" LOL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLORs(long hob, size wfac) +static void PrLORs(long hob, size wfac) { printf(" LOR %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrLOSl2(long arg) +static void PrLOSl2(long arg) { printf(" LOS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLOSz(void) +static void PrLOSz(void) { printf(" LOS\n"); } -PRIVATE void PrLPBz(void) +static void PrLPBz(void) { printf(" LPB\n"); } -PRIVATE void PrLPIl2(long arg) +static void PrLPIl2(long arg) { printf(" LPI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLPIl4(long arg) +static void PrLPIl4(long arg) { printf(" LPI %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrLXAl2(long arg) +static void PrLXAl2(long arg) { printf(" LXA %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLXAm(long arg) +static void PrLXAm(long arg) { printf(" LXA %ld\n", arg); } -PRIVATE void PrLXLl2(long arg) +static void PrLXLl2(long arg) { printf(" LXL %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrLXLm(long arg) +static void PrLXLm(long arg) { printf(" LXL %ld\n", arg); } -PRIVATE void PrMLFl2(long arg) +static void PrMLFl2(long arg) { printf(" MLF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrMLFs(long hob, size wfac) +static void PrMLFs(long hob, size wfac) { printf(" MLF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrMLFz(void) +static void PrMLFz(void) { printf(" MLF\n"); } -PRIVATE void PrMLIl2(long arg) +static void PrMLIl2(long arg) { printf(" MLI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrMLIm(long arg) +static void PrMLIm(long arg) { printf(" MLI %ld\n", arg); } -PRIVATE void PrMLIz(void) +static void PrMLIz(void) { printf(" MLI\n"); } -PRIVATE void PrMLUl2(long arg) +static void PrMLUl2(long arg) { printf(" MLU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrMLUz(void) +static void PrMLUz(void) { printf(" MLU\n"); } -PRIVATE void PrMONz(void) +static void PrMONz(void) { printf(" MON\n"); } -PRIVATE void PrNGFl2(long arg) +static void PrNGFl2(long arg) { printf(" NGF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrNGFz(void) +static void PrNGFz(void) { printf(" NGF\n"); } -PRIVATE void PrNGIl2(long arg) +static void PrNGIl2(long arg) { printf(" NGI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrNGIz(void) +static void PrNGIz(void) { printf(" NGI\n"); } -PRIVATE void PrNOPz(void) +static void PrNOPz(void) { printf(" NOP\n"); } -PRIVATE void PrRCKl2(long arg) +static void PrRCKl2(long arg) { printf(" RCK %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrRCKm(long arg) +static void PrRCKm(long arg) { printf(" RCK %ld\n", arg); } -PRIVATE void PrRCKz(void) +static void PrRCKz(void) { printf(" RCK\n"); } -PRIVATE void PrRETl2(long arg) +static void PrRETl2(long arg) { printf(" RET %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrRETm(long arg) +static void PrRETm(long arg) { printf(" RET %ld\n", arg); } -PRIVATE void PrRETs(long hob, size wfac) +static void PrRETs(long hob, size wfac) { printf(" RET %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrRMIl2(long arg) +static void PrRMIl2(long arg) { printf(" RMI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrRMIm(long arg) +static void PrRMIm(long arg) { printf(" RMI %ld\n", arg); } -PRIVATE void PrRMIz(void) +static void PrRMIz(void) { printf(" RMI\n"); } -PRIVATE void PrRMUl2(long arg) +static void PrRMUl2(long arg) { printf(" RMU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrRMUz(void) +static void PrRMUz(void) { printf(" RMU\n"); } -PRIVATE void PrROLl2(long arg) +static void PrROLl2(long arg) { printf(" ROL %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrROLz(void) +static void PrROLz(void) { printf(" ROL\n"); } -PRIVATE void PrRORl2(long arg) +static void PrRORl2(long arg) { printf(" ROR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrRORz(void) +static void PrRORz(void) { printf(" ROR\n"); } -PRIVATE void PrRTTz(void) +static void PrRTTz(void) { printf(" RTT\n"); } -PRIVATE void PrSARl2(long arg) +static void PrSARl2(long arg) { printf(" SAR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSARm(long arg) +static void PrSARm(long arg) { printf(" SAR %ld\n", arg); } -PRIVATE void PrSARz(void) +static void PrSARz(void) { printf(" SAR\n"); } -PRIVATE void PrSBFl2(long arg) +static void PrSBFl2(long arg) { printf(" SBF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSBFs(long hob, size wfac) +static void PrSBFs(long hob, size wfac) { printf(" SBF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSBFz(void) +static void PrSBFz(void) { printf(" SBF\n"); } -PRIVATE void PrSBIl2(long arg) +static void PrSBIl2(long arg) { printf(" SBI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSBIm(long arg) +static void PrSBIm(long arg) { printf(" SBI %ld\n", arg); } -PRIVATE void PrSBIz(void) +static void PrSBIz(void) { printf(" SBI\n"); } -PRIVATE void PrSBSl2(long arg) +static void PrSBSl2(long arg) { printf(" SBS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSBSz(void) +static void PrSBSz(void) { printf(" SBS\n"); } -PRIVATE void PrSBUl2(long arg) +static void PrSBUl2(long arg) { printf(" SBU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSBUz(void) +static void PrSBUz(void) { printf(" SBU\n"); } -PRIVATE void PrSDEu(long arg) +static void PrSDEu(long arg) { printf(" SDE %ld\n", Ut_arg() * arg); } -PRIVATE void PrSDEl4(long arg) +static void PrSDEl4(long arg) { printf(" SDE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrSDFl2(long arg) +static void PrSDFl2(long arg) { printf(" SDF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSDFl4(long arg) +static void PrSDFl4(long arg) { printf(" SDF %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrSDLn2(long arg) +static void PrSDLn2(long arg) { printf(" SDL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrSDLn4(long arg) +static void PrSDLn4(long arg) { printf(" SDL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrSDLp2(long arg) +static void PrSDLp2(long arg) { printf(" SDL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrSDLp4(long arg) +static void PrSDLp4(long arg) { printf(" SDL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrSDLs(long hob, size wfac) +static void PrSDLs(long hob, size wfac) { printf(" SDL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSETl2(long arg) +static void PrSETl2(long arg) { printf(" SET %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSETs(long hob, size wfac) +static void PrSETs(long hob, size wfac) { printf(" SET %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSETz(void) +static void PrSETz(void) { printf(" SET\n"); } -PRIVATE void PrSIGz(void) +static void PrSIGz(void) { printf(" SIG\n"); } -PRIVATE void PrSILn2(long arg) +static void PrSILn2(long arg) { printf(" SIL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrSILn4(long arg) +static void PrSILn4(long arg) { printf(" SIL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrSILp2(long arg) +static void PrSILp2(long arg) { printf(" SIL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrSILp4(long arg) +static void PrSILp4(long arg) { printf(" SIL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrSILs(long hob, size wfac) +static void PrSILs(long hob, size wfac) { printf(" SIL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSIMz(void) +static void PrSIMz(void) { printf(" SIM\n"); } -PRIVATE void PrSLIl2(long arg) +static void PrSLIl2(long arg) { printf(" SLI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSLIm(long arg) +static void PrSLIm(long arg) { printf(" SLI %ld\n", arg); } -PRIVATE void PrSLIz(void) +static void PrSLIz(void) { printf(" SLI\n"); } -PRIVATE void PrSLUl2(long arg) +static void PrSLUl2(long arg) { printf(" SLU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSLUz(void) +static void PrSLUz(void) { printf(" SLU\n"); } -PRIVATE void PrSRIl2(long arg) +static void PrSRIl2(long arg) { printf(" SRI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSRIz(void) +static void PrSRIz(void) { printf(" SRI\n"); } -PRIVATE void PrSRUl2(long arg) +static void PrSRUl2(long arg) { printf(" SRU %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSRUz(void) +static void PrSRUz(void) { printf(" SRU\n"); } -PRIVATE void PrSTEl2(long arg) +static void PrSTEl2(long arg) { printf(" STE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSTEl4(long arg) +static void PrSTEl4(long arg) { printf(" STE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrSTEs(long hob, size wfac) +static void PrSTEs(long hob, size wfac) { printf(" STE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSTFl2(long arg) +static void PrSTFl2(long arg) { printf(" STF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSTFl4(long arg) +static void PrSTFl4(long arg) { printf(" STF %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrSTFm(long arg) +static void PrSTFm(long arg) { printf(" STF %ld\n", arg); } -PRIVATE void PrSTFs(long hob, size wfac) +static void PrSTFs(long hob, size wfac) { printf(" STF %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSTIl2(long arg) +static void PrSTIl2(long arg) { printf(" STI %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSTIl4(long arg) +static void PrSTIl4(long arg) { printf(" STI %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrSTIm(long arg) +static void PrSTIm(long arg) { printf(" STI %ld\n", arg); } -PRIVATE void PrSTIs(long hob, size wfac) +static void PrSTIs(long hob, size wfac) { printf(" STI %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSTLm(long arg) +static void PrSTLm(long arg) { printf(" STL %ld\n", arg); } -PRIVATE void PrSTLn2(long arg) +static void PrSTLn2(long arg) { printf(" STL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrSTLn4(long arg) +static void PrSTLn4(long arg) { printf(" STL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrSTLp2(long arg) +static void PrSTLp2(long arg) { printf(" STL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrSTLp4(long arg) +static void PrSTLp4(long arg) { printf(" STL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrSTLs(long hob, size wfac) +static void PrSTLs(long hob, size wfac) { printf(" STL %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSTRs(long hob, size wfac) +static void PrSTRs(long hob, size wfac) { printf(" STR %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrSTSl2(long arg) +static void PrSTSl2(long arg) { printf(" STS %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrSTSz(void) +static void PrSTSz(void) { printf(" STS\n"); } -PRIVATE void PrTEQz(void) +static void PrTEQz(void) { printf(" TEQ\n"); } -PRIVATE void PrTGEz(void) +static void PrTGEz(void) { printf(" TGE\n"); } -PRIVATE void PrTGTz(void) +static void PrTGTz(void) { printf(" TGT\n"); } -PRIVATE void PrTLEz(void) +static void PrTLEz(void) { printf(" TLE\n"); } -PRIVATE void PrTLTz(void) +static void PrTLTz(void) { printf(" TLT\n"); } -PRIVATE void PrTNEz(void) +static void PrTNEz(void) { printf(" TNE\n"); } -PRIVATE void PrTRPz(void) +static void PrTRPz(void) { printf(" TRP\n"); } -PRIVATE void PrXORl2(long arg) +static void PrXORl2(long arg) { printf(" XOR %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrXORz(void) +static void PrXORz(void) { printf(" XOR\n"); } -PRIVATE void PrZEQl2(long arg) +static void PrZEQl2(long arg) { printf(" ZEQ %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZEQl4(long arg) +static void PrZEQl4(long arg) { printf(" ZEQ %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZEQs(long hob, size wfac) +static void PrZEQs(long hob, size wfac) { printf(" ZEQ %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZERl2(long arg) +static void PrZERl2(long arg) { printf(" ZER %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZERs(long hob, size wfac) +static void PrZERs(long hob, size wfac) { printf(" ZER %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZERz(void) +static void PrZERz(void) { printf(" ZER\n"); } -PRIVATE void PrZGEl2(long arg) +static void PrZGEl2(long arg) { printf(" ZGE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZGEl4(long arg) +static void PrZGEl4(long arg) { printf(" ZGE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZGEs(long hob, size wfac) +static void PrZGEs(long hob, size wfac) { printf(" ZGE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZGTl2(long arg) +static void PrZGTl2(long arg) { printf(" ZGT %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZGTl4(long arg) +static void PrZGTl4(long arg) { printf(" ZGT %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZGTs(long hob, size wfac) +static void PrZGTs(long hob, size wfac) { printf(" ZGT %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZLEl2(long arg) +static void PrZLEl2(long arg) { printf(" ZLE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZLEl4(long arg) +static void PrZLEl4(long arg) { printf(" ZLE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZLEs(long hob, size wfac) +static void PrZLEs(long hob, size wfac) { printf(" ZLE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZLTl2(long arg) +static void PrZLTl2(long arg) { printf(" ZLT %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZLTl4(long arg) +static void PrZLTl4(long arg) { printf(" ZLT %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZLTs(long hob, size wfac) +static void PrZLTs(long hob, size wfac) { printf(" ZLT %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZNEl2(long arg) +static void PrZNEl2(long arg) { printf(" ZNE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZNEl4(long arg) +static void PrZNEl4(long arg) { printf(" ZNE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZNEs(long hob, size wfac) +static void PrZNEs(long hob, size wfac) { printf(" ZNE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZREl2(long arg) +static void PrZREl2(long arg) { printf(" ZRE %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZREl4(long arg) +static void PrZREl4(long arg) { printf(" ZRE %ld\n", Lt_arg_4() * arg); } -PRIVATE void PrZREs(long hob, size wfac) +static void PrZREs(long hob, size wfac) { printf(" ZRE %ld\n", St_arg(hob) * wfac); } -PRIVATE void PrZRFl2(long arg) +static void PrZRFl2(long arg) { printf(" ZRF %ld\n", Lt_arg_2() * arg); } -PRIVATE void PrZRFz(void) +static void PrZRFz(void) { printf(" ZRF\n"); } -PRIVATE void PrZRLm(long arg) +static void PrZRLm(long arg) { printf(" ZRL %ld\n", arg); } -PRIVATE void PrZRLn2(long arg) +static void PrZRLn2(long arg) { printf(" ZRL %ld\n", Nt_arg_2() * arg); } -PRIVATE void PrZRLn4(long arg) +static void PrZRLn4(long arg) { printf(" ZRL %ld\n", Nt_arg_4() * arg); } -PRIVATE void PrZRLp2(long arg) +static void PrZRLp2(long arg) { printf(" ZRL %ld\n", Pt_arg_2() * arg); } -PRIVATE void PrZRLp4(long arg) +static void PrZRLp4(long arg) { printf(" ZRL %ld\n", Pt_arg_4() * arg); } -PRIVATE void PrZRLs(long hob, size wfac) +static void PrZRLs(long hob, size wfac) { printf(" ZRL %ld\n", St_arg(hob) * wfac); } @@ -1774,17 +1774,17 @@ struct ep void disassemble(void) { - register ptr low = 0; - register ptr high = DB; - register int idf; - register int cnt; + ptr low = 0; + ptr high = DB; + int idf; + int cnt; struct ep* ep; /* list of entry points */ /* collect the entry points */ ep = (struct ep*)Malloc((size)(NProc * sizeof(struct ep)), "entry points"); for (idf = 0; idf < NProc; idf++) { - register struct proc* pr = &proctab[idf]; + struct proc* pr = &proctab[idf]; ep[idf].ep_idf = idf; ep[idf].ep_ep = pr->pr_ep; @@ -1794,7 +1794,7 @@ void disassemble(void) /* a very naive sorting algorithm */ for (idf = 0; idf < NProc; idf++) { - register int jdf; + int jdf; for (jdf = 0; jdf < NProc; jdf++) { @@ -1821,7 +1821,7 @@ void disassemble(void) if (idf < NProc && TC >= ep[idf].ep_ep) { - register struct ep* p = &ep[idf]; + struct ep* p = &ep[idf]; printf( "P[%d]+%lu: ; %ld %s\n", p->ep_idf, TC - p->ep_ep, p->ep_nloc, @@ -1835,7 +1835,7 @@ void disassemble(void) /* See switch.c */ -PRIVATE void do_pr_instr(unsigned int opcode) +static void do_pr_instr(unsigned int opcode) { switch (opcode) { diff --git a/util/int/do_array.c b/util/int/do_array.c index 312ab61e8b..b32f37fcf4 100644 --- a/util/int/do_array.c +++ b/util/int/do_array.c @@ -17,7 +17,7 @@ #define SAR 2 #define AAR 3 -PRIVATE void arr(int, size); +static void arr(int, size); void DoLAR(size arg) { @@ -51,17 +51,17 @@ void DoAAR(size arg) * 6. Perform the correct function. * *********************************************************/ -PRIVATE void +static void arr(int type, /* operation TYPE */ size elm_size /* ELeMent SIZE */ ) { - register ptr desc = dppop(); /* array DESCriptor */ - register size obj_size; /* OBJect SIZE */ + ptr desc = dppop(); /* array DESCriptor */ + size obj_size; /* OBJect SIZE */ long index = spop(elm_size); long diff = /* between index and lower bound */ index - mem_lds(desc, elm_size); - register ptr arr_addr = dppop(); /* ARRay ADDRess */ + ptr arr_addr = dppop(); /* ARRay ADDRess */ if (must_test && !(IgnMask & BIT(EARRAY))) { diff --git a/util/int/do_branch.c b/util/int/do_branch.c index 5f0742b818..a976751b19 100644 --- a/util/int/do_branch.c +++ b/util/int/do_branch.c @@ -25,7 +25,7 @@ newPC(PC + (j)); \ } -void DoBRA(register long jump) +void DoBRA(long jump) { /* BRA b: Branch unconditionally to label b */ @@ -33,10 +33,10 @@ void DoBRA(register long jump) do_jump(arg_c(jump)); } -void DoBLT(register long jump) +void DoBLT(long jump) { /* BLT b: Branch less (pop 2 words, branch if top > second) */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBLT(%ld)", jump)); spoilFRA(); @@ -44,10 +44,10 @@ void DoBLT(register long jump) do_jump(arg_c(jump)); } -void DoBLE(register long jump) +void DoBLE(long jump) { /* BLE b: Branch less or equal */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBLE(%ld)", jump)); spoilFRA(); @@ -55,10 +55,10 @@ void DoBLE(register long jump) do_jump(arg_c(jump)); } -void DoBEQ(register long jump) +void DoBEQ(long jump) { /* BEQ b: Branch equal */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBEQ(%ld)", jump)); spoilFRA(); @@ -66,10 +66,10 @@ void DoBEQ(register long jump) do_jump(arg_c(jump)); } -void DoBNE(register long jump) +void DoBNE(long jump) { /* BNE b: Branch not equal */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBNE(%ld)", jump)); spoilFRA(); @@ -77,10 +77,10 @@ void DoBNE(register long jump) do_jump(arg_c(jump)); } -void DoBGE(register long jump) +void DoBGE(long jump) { /* BGE b: Branch greater or equal */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBGE(%ld)", jump)); spoilFRA(); @@ -88,10 +88,10 @@ void DoBGE(register long jump) do_jump(arg_c(jump)); } -void DoBGT(register long jump) +void DoBGT(long jump) { /* BGT b: Branch greater */ - register long t = wpop(); + long t = wpop(); LOG(("@B6 DoBGT(%ld)", jump)); spoilFRA(); @@ -99,7 +99,7 @@ void DoBGT(register long jump) do_jump(arg_c(jump)); } -void DoZLT(register long jump) +void DoZLT(long jump) { /* ZLT b: Branch less than zero (pop 1 word, branch negative) */ @@ -109,7 +109,7 @@ void DoZLT(register long jump) do_jump(arg_c(jump)); } -void DoZLE(register long jump) +void DoZLE(long jump) { /* ZLE b: Branch less or equal to zero */ @@ -119,7 +119,7 @@ void DoZLE(register long jump) do_jump(arg_c(jump)); } -void DoZEQ(register long jump) +void DoZEQ(long jump) { /* ZEQ b: Branch equal zero */ @@ -129,7 +129,7 @@ void DoZEQ(register long jump) do_jump(arg_c(jump)); } -void DoZNE(register long jump) +void DoZNE(long jump) { /* ZNE b: Branch not zero */ @@ -139,7 +139,7 @@ void DoZNE(register long jump) do_jump(arg_c(jump)); } -void DoZGE(register long jump) +void DoZGE(long jump) { /* ZGE b: Branch greater or equal zero */ @@ -149,7 +149,7 @@ void DoZGE(register long jump) do_jump(arg_c(jump)); } -void DoZGT(register long jump) +void DoZGT(long jump) { /* ZGT b: Branch greater than zero */ diff --git a/util/int/do_comp.c b/util/int/do_comp.c index dd17d0298e..2042b4bba3 100644 --- a/util/int/do_comp.c +++ b/util/int/do_comp.c @@ -18,20 +18,20 @@ #include "stack.h" #include "switch.h" -PRIVATE void compare_obj(size); +static void compare_obj(size); -void DoCMI(register size l) +void DoCMI(size l) { /* CMI w: Compare w byte integers, Push negative, zero, positive for <, = or > */ - register long t = spop(arg_wi(l)); - register long s = spop(l); + long t = spop(arg_wi(l)); + long s = spop(l); LOG(("@T6 DoCMI(%ld)", l)); spoilFRA(); wpush((long)(t < s ? 1 : t > s ? -1 : 0)); } -void DoCMF(register size l) +void DoCMF(size l) { /* CMF w: Compare w byte reals */ #ifndef NOFLOAT @@ -46,18 +46,18 @@ void DoCMF(register size l) #endif /* NOFLOAT */ } -void DoCMU(register size l) +void DoCMU(size l) { /* CMU w: Compare w byte unsigneds */ - register unsigned long t = upop(arg_wi(l)); - register unsigned long s = upop(l); + unsigned long t = upop(arg_wi(l)); + unsigned long s = upop(l); LOG(("@T6 DoCMU(%ld)", l)); spoilFRA(); wpush((long)(t < s ? 1 : t > s ? -1 : 0)); } -void DoCMS(register size l) +void DoCMS(size l) { /* CMS w: Compare w byte values, can only be used for bit for bit equality test */ @@ -69,7 +69,7 @@ void DoCMS(register size l) void DoCMP(void) { /* CMP -: Compare pointers */ - register ptr t, s; + ptr t, s; LOG(("@T6 DoCMP()")); spoilFRA(); @@ -135,11 +135,11 @@ void DoTGT(void) * is performed. Checking for undefined bytes * is done when LOGGING is defined. ********************************************************/ -PRIVATE void compare_obj(size obj_size) +static void compare_obj(size obj_size) { - register ptr addr1; /* ADDRess in object highest on st. */ - register ptr addr2; /* ADDRess in object deeper in st. */ - register int comp_res = 0; /* COMPare RESult */ + ptr addr1; /* ADDRess in object highest on st. */ + ptr addr2; /* ADDRess in object deeper in st. */ + int comp_res = 0; /* COMPare RESult */ for (addr1 = SP, addr2 = SP + obj_size; addr1 < SP + obj_size; addr1++, addr2++) { diff --git a/util/int/do_conv.c b/util/int/do_conv.c index 01f79e84b4..c7a64a921d 100644 --- a/util/int/do_conv.c +++ b/util/int/do_conv.c @@ -19,8 +19,8 @@ void DoCII(void) { /* CII -: Convert integer to integer (*) */ - register int newsize = swpop(); - register long s; + int newsize = swpop(); + long s; LOG(("@C6 DoCII()")); spoilFRA(); @@ -68,8 +68,8 @@ void DoCII(void) void DoCUI(void) { /* CUI -: Convert unsigned to integer (*) */ - register int newsize = swpop(); - register unsigned long u; + int newsize = swpop(); + unsigned long u; LOG(("@C6 DoCUI()")); spoilFRA(); @@ -126,7 +126,7 @@ void DoCFI(void) { /* CFI -: Convert floating to integer (*) */ #ifndef NOFLOAT - register int newsize = swpop(); + int newsize = swpop(); double f; LOG(("@C6 DoCFI()")); @@ -189,7 +189,7 @@ void DoCIF(void) { /* CIF -: Convert integer to floating (*) */ #ifndef NOFLOAT - register int newsize = swpop(); + int newsize = swpop(); LOG(("@C6 DoCIF()")); spoilFRA(); @@ -227,8 +227,8 @@ void DoCUF(void) { /* CUF -: Convert unsigned to floating (*) */ #ifndef NOFLOAT - register int newsize = swpop(); - register unsigned long u; + int newsize = swpop(); + unsigned long u; LOG(("@C6 DoCUF()")); spoilFRA(); @@ -280,7 +280,7 @@ void DoCFF(void) { /* CFF -: Convert floating to floating (*) */ #ifndef NOFLOAT - register int newsize = swpop(); + int newsize = swpop(); LOG(("@C6 DoCFF()")); spoilFRA(); @@ -307,8 +307,8 @@ void DoCFF(void) void DoCIU(void) { /* CIU -: Convert integer to unsigned */ - register int newsize = swpop(); - register long u; + int newsize = swpop(); + long u; LOG(("@C6 DoCIU()")); spoilFRA(); @@ -345,7 +345,7 @@ void DoCIU(void) void DoCUU(void) { /* CUU -: Convert unsigned to unsigned */ - register int newsize = swpop(); + int newsize = swpop(); LOG(("@C6 DoCUU()")); spoilFRA(); @@ -382,7 +382,7 @@ void DoCFU(void) { /* CFU -: Convert floating to unsigned */ #ifndef NOFLOAT - register int newsize = swpop(); + int newsize = swpop(); double f; LOG(("@C6 DoCFU()")); diff --git a/util/int/do_fpar.c b/util/int/do_fpar.c index de39b5e3a8..b8a8f4c01c 100644 --- a/util/int/do_fpar.c +++ b/util/int/do_fpar.c @@ -30,14 +30,14 @@ #endif /* not __STDC__ */ #define SMALL (1.0 / MAXDOUBLE) -PRIVATE double adf(double, double), sbf(double, double), mlf(double, double), dvf(double, double); -PRIVATE double ttttp(double, int); -PRIVATE double floor(double), fabs(double); -PRIVATE void fef(double, size), fif(double, double, size); +static double adf(double, double), sbf(double, double), mlf(double, double), dvf(double, double); +static double ttttp(double, int); +static double floor(double), fabs(double); +static void fef(double, size), fif(double, double, size); #endif /* NOFLOAT */ -void DoADF(register size l) +void DoADF(size l) { /* ADF w: Floating add (*) */ #ifndef NOFLOAT @@ -51,7 +51,7 @@ void DoADF(register size l) #endif /* NOFLOAT */ } -void DoSBF(register size l) +void DoSBF(size l) { /* SBF w: Floating subtract (*) */ #ifndef NOFLOAT @@ -65,7 +65,7 @@ void DoSBF(register size l) #endif /* NOFLOAT */ } -void DoMLF(register size l) +void DoMLF(size l) { /* MLF w: Floating multiply (*) */ #ifndef NOFLOAT @@ -79,7 +79,7 @@ void DoMLF(register size l) #endif /* NOFLOAT */ } -void DoDVF(register size l) +void DoDVF(size l) { /* DVF w: Floating divide (*) */ #ifndef NOFLOAT @@ -93,7 +93,7 @@ void DoDVF(register size l) #endif /* NOFLOAT */ } -void DoNGF(register size l) +void DoNGF(size l) { /** NGF w: Floating negate (*) */ #ifndef NOFLOAT @@ -107,7 +107,7 @@ void DoNGF(register size l) #endif /* NOFLOAT */ } -void DoFIF(register size l) +void DoFIF(size l) { /* FIF w: Floating multiply and split integer and fraction part (*) */ #ifndef NOFLOAT @@ -121,7 +121,7 @@ void DoFIF(register size l) #endif /* NOFLOAT */ } -void DoFEF(register size l) +void DoFEF(size l) { /* FEF w: Split floating number in exponent and fraction part (*) */ #ifndef NOFLOAT @@ -138,7 +138,7 @@ void DoFEF(register size l) /* Service routines */ /** Returns "f1" + "f2" */ -PRIVATE double adf(double f1, double f2) +static double adf(double f1, double f2) { if (must_test && !(IgnMask & BIT(EFOVFL))) { @@ -163,7 +163,7 @@ PRIVATE double adf(double f1, double f2) } /** Returns "f1" - "f2" */ -PRIVATE double sbf(double f1, double f2) +static double sbf(double f1, double f2) { if (must_test && !(IgnMask & BIT(EFOVFL))) { @@ -188,7 +188,7 @@ PRIVATE double sbf(double f1, double f2) } /** Returns "f1" * "f2" */ -PRIVATE double mlf(double f1, double f2) +static double mlf(double f1, double f2) { double ff1 = fabs(f1), ff2 = fabs(f2); @@ -223,7 +223,7 @@ PRIVATE double mlf(double f1, double f2) } /** Returns "f1" / "f2" */ -PRIVATE double dvf(double f1, double f2) +static double dvf(double f1, double f2) { double ff1 = fabs(f1), ff2 = fabs(f2); @@ -267,7 +267,7 @@ PRIVATE double dvf(double f1, double f2) return (f1 / f2); } -PRIVATE void fif(double f1, double f2, size n) +static void fif(double f1, double f2, size n) { double f = mlf(f1, f2); double fl = floor(fabs(f)); @@ -276,9 +276,9 @@ PRIVATE void fif(double f1, double f2, size n) fpush((f < 0.0) ? -fl : fl, n); /* push integer-part */ } -PRIVATE void fef(double f, size n) +static void fef(double f, size n) { - register long exponent, sign = (long)(f < 0.0); + long exponent, sign = (long)(f < 0.0); if (f == 0.0) { @@ -299,15 +299,15 @@ PRIVATE void fef(double f, size n) /* floating point service routines, to avoid having to use -lm */ -PRIVATE double fabs(double f) +static double fabs(double f) { return (f < 0.0 ? -f : f); } -PRIVATE double floor(double f) +static double floor(double f) { double res, d; - register int sign = 1; + int sign = 1; /* eliminate the sign */ if (f < 0) @@ -343,7 +343,7 @@ PRIVATE double floor(double f) } /** Times ten to the power. */ -PRIVATE double ttttp(double f, int n) +static double ttttp(double f, int n) { while (n > 0) { @@ -364,10 +364,10 @@ PRIVATE double ttttp(double f, int n) */ double str2double(char* str) { - register char b; - register int sign = 1; /* either +1 or -1 */ - register int frac = 0; /* how far in fraction part ? */ - register int ex; /* to store exponent */ + char b; + int sign = 1; /* either +1 or -1 */ + int frac = 0; /* how far in fraction part ? */ + int ex; /* to store exponent */ double mantissa = 0.0; /* to store mantissa */ double d; /* double to be returned */ diff --git a/util/int/do_incdec.c b/util/int/do_incdec.c index e61e53586a..199e75aafb 100644 --- a/util/int/do_incdec.c +++ b/util/int/do_incdec.c @@ -17,7 +17,7 @@ #include "warn.h" #include "switch.h" -PRIVATE long inc(long), dec(long); +static long inc(long), dec(long); /** INC -: Increment word on top of stack by 1 (*) */ void DoINC(void) @@ -28,9 +28,9 @@ void DoINC(void) } /** INL l: Increment local or parameter (*) */ -void DoINL(register long l) +void DoINL(long l) { - register ptr p; + ptr p; LOG(("@Z6 DoINL(%ld)", l)); spoilFRA(); @@ -39,10 +39,10 @@ void DoINL(register long l) } /** INE g: Increment external (*) */ -void DoINE(register long arg) +void DoINE(long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@Z6 DoINE(%lu)", p)); spoilFRA(); @@ -60,10 +60,10 @@ void DoDEC(void) } /** DEL l: Decrement local or parameter (*) */ -void DoDEL(register long l) +void DoDEL(long l) { - register ptr p; + ptr p; LOG(("@Z6 DoDEL(%ld)", l)); spoilFRA(); @@ -73,10 +73,10 @@ void DoDEL(register long l) } /** DEE g: Decrement external (*) */ -void DoDEE(register long arg) +void DoDEE(long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@Z6 DoDEE(%lu)", p)); spoilFRA(); @@ -85,7 +85,7 @@ void DoDEE(register long arg) } /** ZRL l: Zero local or parameter */ -void DoZRL(register long l) +void DoZRL(long l) { LOG(("@Z6 DoZRL(%ld)", l)); @@ -95,10 +95,10 @@ void DoZRL(register long l) } /** ZRE g: Zero external */ -void DoZRE(register long arg) +void DoZRE(long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@Z6 DoZRE(%lu)", p)); spoilFRA(); @@ -106,7 +106,7 @@ void DoZRE(register long arg) } /** ZRF w: Load a floating zero of size w */ -void DoZRF(register size l) +void DoZRF(size l) { #ifndef NOFLOAT @@ -119,7 +119,7 @@ void DoZRF(register size l) #endif /* NOFLOAT */ } /** ZER w: Load w zero bytes */ -void DoZER(register size l) +void DoZER(size l) { LOG(("@Z6 DoZER(%ld)", l)); spoilFRA(); @@ -131,7 +131,7 @@ void DoZER(register size l) */ } -PRIVATE long inc(long l) +static long inc(long l) { if (must_test && !(IgnMask & BIT(EIOVFL))) { @@ -141,7 +141,7 @@ PRIVATE long inc(long l) return (l + 1); } -PRIVATE long dec(long l) +static long dec(long l) { if (must_test && !(IgnMask & BIT(EIOVFL))) { diff --git a/util/int/do_intar.c b/util/int/do_intar.c index e1f5367812..1f289e47da 100644 --- a/util/int/do_intar.c +++ b/util/int/do_intar.c @@ -15,14 +15,14 @@ #include "fra.h" #include "switch.h" -PRIVATE long adi(long, long, size), sbi(long, long, size), dvi(long, long, size); -PRIVATE long mli(long, long, size), rmi(long, long), ngi(long, size); -PRIVATE long sli(long, long, size), sri(long, long, size); +static long adi(long, long, size), sbi(long, long, size), dvi(long, long, size); +static long mli(long, long, size), rmi(long, long), ngi(long, size); +static long sli(long, long, size), sri(long, long, size); /** ADI w: Addition (*) */ -void DoADI(register size l) +void DoADI(size l) { - register long t = spop(arg_wi(l)); + long t = spop(arg_wi(l)); LOG(("@I6 DoADI(%ld)", l)); spoilFRA(); @@ -30,9 +30,9 @@ void DoADI(register size l) } /** SBI w: Subtraction (*) */ -void DoSBI(register size l) +void DoSBI(size l) { - register long t = spop(arg_wi(l)); + long t = spop(arg_wi(l)); LOG(("@I6 DoSBI(%ld)", l)); spoilFRA(); @@ -40,9 +40,9 @@ void DoSBI(register size l) } /** MLI w: Multiplication (*) */ -void DoMLI(register size l) +void DoMLI(size l) { - register long t = spop(arg_wi(l)); + long t = spop(arg_wi(l)); LOG(("@I6 DoMLI(%ld)", l)); spoilFRA(); @@ -50,9 +50,9 @@ void DoMLI(register size l) } /** DVI w: Division (*) */ -void DoDVI(register size l) +void DoDVI(size l) { - register long t = spop(arg_wi(l)); + long t = spop(arg_wi(l)); LOG(("@I6 DoDVI(%ld)", l)); spoilFRA(); @@ -60,9 +60,9 @@ void DoDVI(register size l) } /** RMI w: Remainder (*) */ -void DoRMI(register size l) +void DoRMI(size l) { - register long t = spop(arg_wi(l)); + long t = spop(arg_wi(l)); LOG(("@I6 DoRMI(%ld)", l)); spoilFRA(); @@ -70,7 +70,7 @@ void DoRMI(register size l) } /** NGI w: Negate (two's complement) (*) */ -void DoNGI(register size l) +void DoNGI(size l) { LOG(("@I6 DoNGI(%ld)", l)); spoilFRA(); @@ -79,9 +79,9 @@ void DoNGI(register size l) } /** SLI w: Shift left (*) */ -void DoSLI(register size l) +void DoSLI(size l) { - register long t = swpop(); + long t = swpop(); LOG(("@I6 DoSLI(%ld)", l)); spoilFRA(); @@ -90,9 +90,9 @@ void DoSLI(register size l) } /** SRI w: Shift right (*) */ -void DoSRI(register size l) +void DoSRI(size l) { - register long t = swpop(); + long t = swpop(); LOG(("@I6 DoSRI(%ld)", l)); spoilFRA(); @@ -104,7 +104,7 @@ void DoSRI(register size l) #define i_mins(n) ((n == 2) ? I_MINS2 : I_MINS4) /** Returns "w1" + "w2". */ -PRIVATE long adi(long w1, long w2, size nbytes) +static long adi(long w1, long w2, size nbytes) { if (must_test && !(IgnMask & BIT(EIOVFL))) { @@ -123,7 +123,7 @@ PRIVATE long adi(long w1, long w2, size nbytes) } /** Returns "w1" - "w2" */ -PRIVATE long sbi(long w1, long w2, size nbytes) +static long sbi(long w1, long w2, size nbytes) { if (must_test && !(IgnMask & BIT(EIOVFL))) { @@ -146,7 +146,7 @@ PRIVATE long sbi(long w1, long w2, size nbytes) #define labs(w) ((w < 0) ? (-w) : w) /** Returns "w1" * "w2" */ -PRIVATE long mli(long w1, long w2, size nbytes) +static long mli(long w1, long w2, size nbytes) { if (w1 == 0 || w2 == 0) return (0L); @@ -174,7 +174,7 @@ PRIVATE long mli(long w1, long w2, size nbytes) return (w1 * w2); } -PRIVATE long dvi(long w1, long w2, size nbytes) +static long dvi(long w1, long w2, size nbytes) { if (w2 == 0) { @@ -200,7 +200,7 @@ PRIVATE long dvi(long w1, long w2, size nbytes) return (w1 / w2); } -PRIVATE long rmi(long w1, long w2) +static long rmi(long w1, long w2) { if (w2 == 0) { @@ -214,7 +214,7 @@ PRIVATE long rmi(long w1, long w2) return (w1 % w2); } -PRIVATE long ngi(long w1, size nbytes) +static long ngi(long w1, size nbytes) { if (must_test && !(IgnMask & BIT(EIOVFL))) { @@ -227,7 +227,7 @@ PRIVATE long ngi(long w1, size nbytes) } /** "w1" << "w2" */ -PRIVATE long sli(long w1, long w2, size nbytes) +static long sli(long w1, long w2, size nbytes) { if (must_test) { @@ -269,7 +269,7 @@ PRIVATE long sli(long w1, long w2, size nbytes) } /*ARGSUSED*/ -PRIVATE long sri(long w1, long w2, size nbytes) /* w1 >> w2 */ +static long sri(long w1, long w2, size nbytes) /* w1 >> w2 */ { #ifdef LOGGING if (must_test) diff --git a/util/int/do_load.c b/util/int/do_load.c index b037c6588a..3389c31136 100644 --- a/util/int/do_load.c +++ b/util/int/do_load.c @@ -15,10 +15,10 @@ #include "warn.h" #include "switch.h" -PRIVATE ptr lexback_LB(unsigned long); +static ptr lexback_LB(unsigned long); /** LOC c: Load constant (i.e. push one word onto the stack) */ -void DoLOC(register long l) +void DoLOC(long l) { LOG(("@L6 DoLOC(%ld)", l)); spoilFRA(); @@ -26,7 +26,7 @@ void DoLOC(register long l) } /** LDC d: Load double constant ( push two words ) */ -void DoLDC(register long l) +void DoLDC(long l) { LOG(("@L6 DoLDC(%ld)", l)); spoilFRA(); @@ -35,7 +35,7 @@ void DoLDC(register long l) } /** LOL l: Load word at l-th local (l<0) or parameter (l>=0) */ -void DoLOL(register long l) +void DoLOL(long l) { LOG(("@L6 DoLOL(%ld)", l)); spoilFRA(); @@ -44,9 +44,9 @@ void DoLOL(register long l) } /** LOE g: Load external word g */ -void DoLOE(register long arg) +void DoLOE(long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@L6 DoLOE(%lu)", p)); spoilFRA(); @@ -54,7 +54,7 @@ void DoLOE(register long arg) } /** LIL l: Load word pointed to by l-th local or parameter */ -void DoLIL(register long l) +void DoLIL(long l) { LOG(("@L6 DoLIL(%ld)", l)); spoilFRA(); @@ -63,9 +63,9 @@ void DoLIL(register long l) } /** LOF f: Load offsetted (top of stack + f yield address) */ -void DoLOF(register long l) +void DoLOF(long l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@L6 DoLOF(%ld)", l)); spoilFRA(); @@ -73,7 +73,7 @@ void DoLOF(register long l) } /** LAL l: Load address of local or parameter */ -void DoLAL(register long l) +void DoLAL(long l) { LOG(("@L6 DoLAL(%ld)", l)); @@ -83,10 +83,10 @@ void DoLAL(register long l) } /** LAE g: Load address of external */ -void DoLAE(register unsigned long arg) +void DoLAE(unsigned long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@L6 DoLAE(%lu)", p)); spoilFRA(); @@ -94,9 +94,9 @@ void DoLAE(register unsigned long arg) } /** LXL n: Load lexical (address of LB n static levels back) */ -void DoLXL(register unsigned long l) +void DoLXL(unsigned long l) { - register ptr p; + ptr p; LOG(("@L6 DoLXL(%lu)", l)); spoilFRA(); @@ -106,9 +106,9 @@ void DoLXL(register unsigned long l) } /** LXA n: Load lexical (address of AB n static levels back) */ -void DoLXA(register unsigned long l) +void DoLXA(unsigned long l) { - register ptr p; + ptr p; LOG(("@L6 DoLXA(%lu)", l)); spoilFRA(); @@ -118,9 +118,9 @@ void DoLXA(register unsigned long l) } /** LOI o: Load indirect o bytes (address is popped from the stack) */ -void DoLOI(register size l) +void DoLOI(size l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@L6 DoLOI(%ld)", l)); spoilFRA(); @@ -130,9 +130,9 @@ void DoLOI(register size l) /** LOS w: Load indirect, w-byte integer on top of stack gives * object size */ -void DoLOS(register size l) +void DoLOS(size l) { - register ptr p; + ptr p; LOG(("@L6 DoLOS(%ld)", l)); spoilFRA(); @@ -143,7 +143,7 @@ void DoLOS(register size l) } /** LDL l: Load double local or parameter (two consecutive words are stacked) */ -void DoLDL(register long l) +void DoLDL(long l) { LOG(("@L6 DoLDL(%ld)", l)); spoilFRA(); @@ -152,9 +152,9 @@ void DoLDL(register long l) } /** LDE g: Load double external (two consecutive externals are stacked) */ -void DoLDE(register long arg) +void DoLDE(long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@L6 DoLDE(%lu)", p)); spoilFRA(); @@ -162,9 +162,9 @@ void DoLDE(register long arg) } /** LDF f: Load double offsetted (top of stack + f yield address) */ -void DoLDF(register long l) +void DoLDF(long l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@L6 DoLDF(%ld)", l)); spoilFRA(); @@ -172,17 +172,17 @@ void DoLDF(register long l) } /** LPI p: Load procedure identifier */ -void DoLPI(register long pi) +void DoLPI(long pi) { LOG(("@L6 DoLPI(%ld)", pi)); spoilFRA(); npush(arg_p(pi), psize); } -PRIVATE ptr lexback_LB(unsigned long n) +static ptr lexback_LB(unsigned long n) { /* LB n static levels back */ - register ptr lb = LB; + ptr lb = LB; while (n != 0) { diff --git a/util/int/do_logic.c b/util/int/do_logic.c index 94f7a87dcb..1cdf59abbd 100644 --- a/util/int/do_logic.c +++ b/util/int/do_logic.c @@ -33,9 +33,9 @@ extern int must_test; /** AND w: Boolean and on two groups of w bytes. Size of objects to be compared * (in bytes) on top of stack */ -void DoAND(register size l) +void DoAND(size l) { - register ptr p; + ptr p; LOG(("@X6 DoAND(%ld)", l)); spoilFRA(); @@ -49,9 +49,9 @@ void DoAND(register size l) } /** IOR w: Boolean inclusive or on two groups of w bytes */ -void DoIOR(register size l) +void DoIOR(size l) { - register ptr p; + ptr p; LOG(("@X6 DoIOR(%ld)", l)); spoilFRA(); @@ -65,9 +65,9 @@ void DoIOR(register size l) } /** XOR w: Boolean exclusive or on two groups of w bytes */ -void DoXOR(register size l) +void DoXOR(size l) { - register ptr p; + ptr p; LOG(("@X6 DoXOR(%ld)", l)); spoilFRA(); @@ -81,9 +81,9 @@ void DoXOR(register size l) } /** COM w: Complement (one's complement of top w bytes) */ -void DoCOM(register size l) +void DoCOM(size l) { - register ptr p; + ptr p; LOG(("@X6 DoCOM(%ld)", l)); spoilFRA(); @@ -96,10 +96,10 @@ void DoCOM(register size l) } /** ROL w: Rotate left a group of w bytes */ -void DoROL(register size l) +void DoROL(size l) { - register long s, t = uwpop(); - register long signbit; + long s, t = uwpop(); + long signbit; LOG(("@X6 DoROL(%ld)", l)); spoilFRA(); @@ -132,10 +132,10 @@ void DoROL(register size l) } /** ROR w: Rotate right a group of w bytes */ -void DoROR(register size l) +void DoROR(size l) { - register long s, t = uwpop(); - register long signbit; + long s, t = uwpop(); + long signbit; LOG(("@X6 DoROR(%ld)", l)); spoilFRA(); diff --git a/util/int/do_misc.c b/util/int/do_misc.c index b7ff4600be..8f53a22168 100644 --- a/util/int/do_misc.c +++ b/util/int/do_misc.c @@ -32,20 +32,20 @@ long LIN; /** Pointer to the filename. */ ptr FIL; -PRIVATE void index_jump(size), range_check(size), search_jump(size); -PRIVATE void gto(ptr); +static void index_jump(size), range_check(size), search_jump(size); +static void gto(ptr); #define asp(l) newSP(SP + arg_f(l)) /** ASP f: Adjust the stack pointer by f */ -void DoASP(register long l) +void DoASP(long l) { LOG(("@M6 DoASP(%ld)", l)); asp(l); } /** ASS w: Adjust the stack pointer by w-byte integer */ -void DoASS(register size l) +void DoASS(size l) { LOG(("@M6 DoASS(%ld)", l)); spoilFRA(); @@ -70,9 +70,9 @@ void DoASS(register size l) } /** BLM z: Block move z bytes; first pop destination addr, then source addr */ -void DoBLM(register size l) +void DoBLM(size l) { - register ptr dp1, dp2; /* Destination Pointers */ + ptr dp1, dp2; /* Destination Pointers */ LOG(("@M6 DoBLM(%ld)", l)); spoilFRA(); @@ -82,9 +82,9 @@ void DoBLM(register size l) } /** BLS w: Block move, size is in w-byte integer on top of stack */ -void DoBLS(register size l) +void DoBLS(size l) { - register ptr dp1, dp2; + ptr dp1, dp2; LOG(("@M6 DoBLS(%ld)", l)); spoilFRA(); @@ -95,7 +95,7 @@ void DoBLS(register size l) } /** CSA w: Case jump; address of jump table at top of stack */ -void DoCSA(register size l) +void DoCSA(size l) { LOG(("@M6 DoCSA(%ld)", l)); spoilFRA(); @@ -103,7 +103,7 @@ void DoCSA(register size l) } /** CSB w: Table lookup jump; address of jump table at top of stack */ -void DoCSB(register size l) +void DoCSB(size l) { LOG(("@M6 DoCSB(%ld)", l)); spoilFRA(); @@ -113,7 +113,7 @@ void DoCSB(register size l) /** DCH -: Follow dynamic chain, convert LB to LB of caller */ void DoDCH(void) { - register ptr lb; + ptr lb; LOG(("@M6 DoDCH()")); spoilFRA(); @@ -128,7 +128,7 @@ void DoDCH(void) /** DUP s: Duplicate top s bytes */ void DoDUP(size arg) { - register ptr oldSP = SP; + ptr oldSP = SP; LOG(("@M6 DoDUP(%ld)", arg)); spoilFRA(); @@ -137,9 +137,9 @@ void DoDUP(size arg) } /** DUS w: Duplicate top w bytes */ -void DoDUS(register size l) +void DoDUS(size l) { - register ptr oldSP; + ptr oldSP; LOG(("@M6 DoDUS(%ld)", l)); spoilFRA(); @@ -150,9 +150,9 @@ void DoDUS(register size l) } /** EXG w: Exchange top w bytes */ -void DoEXG(register size l) +void DoEXG(size l) { - register ptr oldSP = SP; + ptr oldSP = SP; LOG(("@M6 DoEXG(%ld)", l)); spoilFRA(); @@ -164,9 +164,9 @@ void DoEXG(register size l) } /** FIL g: File name (external 4 := g) */ -void DoFIL(register unsigned long arg) +void DoFIL(unsigned long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@M6 DoFIL(%lu)", p)); spoilFRA(); @@ -178,9 +178,9 @@ void DoFIL(register unsigned long arg) } /** GTO g: Non-local goto, descriptor at g */ -void DoGTO(register unsigned long arg) +void DoGTO(unsigned long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@M6 DoGTO(%lu)", p)); gto(arg_gto(p)); @@ -195,7 +195,7 @@ void DoLIM(void) } /** LIN n: Line number (external 0 := n) */ -void DoLIN(register unsigned long l) +void DoLIN(unsigned long l) { LOG(("@M6 DoLIN(%lu)", l)); spoilFRA(); @@ -211,7 +211,7 @@ void DoLNI(void) } /** LOR r: Load register (0=LB, 1=SP, 2=HP) */ -void DoLOR(register long l) +void DoLOR(long l) { LOG(("@M6 DoLOR(%ld)", l)); spoilFRA(); @@ -232,7 +232,7 @@ void DoLOR(register long l) /** LPB -: Convert local base to argument base */ void DoLPB(void) { - register ptr lb; + ptr lb; LOG(("@M6 DoLPB()")); spoilFRA(); @@ -261,7 +261,7 @@ void DoNOP(void) } /** RCK w: Range check; trap on error */ -void DoRCK(register size l) +void DoRCK(size l) { LOG(("@M6 DoRCK(%ld)", l)); spoilFRA(); @@ -306,7 +306,7 @@ void DoRTT(void) /** SIG -: Trap errors to proc identifier on top of stack, \-2 resets default */ void DoSIG(void) { - register long tpi = spop(psize); + long tpi = spop(psize); LOG(("@M6 DoSIG()")); spoilFRA(); @@ -338,7 +338,7 @@ void DoSIM(void) } /** STR r: Store register (0=LB, 1=SP, 2=HP) */ -void DoSTR(register long l) +void DoSTR(long l) { LOG(("@M6 DoSTR(%ld)", l)); spoilFRA(); @@ -360,7 +360,7 @@ void DoSTR(register long l) /** TRP -: Cause trap to occur (Error number on stack) */ void DoTRP(void) { - register unsigned int tr = (unsigned int)uwpop(); + unsigned int tr = (unsigned int)uwpop(); LOG(("@M6 DoTRP()")); spoilFRA(); @@ -372,12 +372,12 @@ void DoTRP(void) /* Service routines */ -PRIVATE void gto(ptr p) +static void gto(ptr p) { - register ptr old_LB = LB; - register ptr new_PC = dt_ldip(p); - register ptr new_SP = dt_lddp(p + psize); - register ptr new_LB = dt_lddp(p + (2 * psize)); + ptr old_LB = LB; + ptr new_PC = dt_ldip(p); + ptr new_SP = dt_lddp(p + psize); + ptr new_LB = dt_lddp(p + (2 * psize)); while (old_LB < new_LB) { @@ -428,12 +428,12 @@ void putFIL(ptr fil) * 6. Else: load default value. * ********************************************************/ -PRIVATE void index_jump(size nbytes) +static void index_jump(size nbytes) { - register ptr cdp = dppop(); /* Case Descriptor Pointer */ - register long t_index = /* Table INDEX */ + ptr cdp = dppop(); /* Case Descriptor Pointer */ + long t_index = /* Table INDEX */ spop(nbytes) - mem_lds(cdp + psize, nbytes); - register ptr nPC = 0; /* New Program Counter */ + ptr nPC = 0; /* New Program Counter */ if (t_index >= 0 && t_index <= mem_lds(cdp + nbytes + psize, nbytes)) { @@ -457,13 +457,13 @@ PRIVATE void index_jump(size nbytes) * 6. Else: load default value. * ********************************************************/ -PRIVATE void search_jump(size nbytes) +static void search_jump(size nbytes) { - register ptr cdp = dppop(); /* Case Descriptor Pointer */ - register long sv = spop(nbytes); /* Search Value */ - register long nt = /* Number of Table-entries */ + ptr cdp = dppop(); /* Case Descriptor Pointer */ + long sv = spop(nbytes); /* Search Value */ + long nt = /* Number of Table-entries */ mem_lds(cdp + psize, nbytes); - register ptr nPC; /* New Program Counter */ + ptr nPC; /* New Program Counter */ while (--nt >= 0) { @@ -490,10 +490,10 @@ PRIVATE void search_jump(size nbytes) * 3. Generate trap if necessary. * * 4. DON'T remove integer. * ********************************************************/ -PRIVATE void range_check(size nbytes) +static void range_check(size nbytes) { - register ptr rdp = dppop(); /* Range check Descriptor Pointer */ - register long cv = /* Check Value */ + ptr rdp = dppop(); /* Range check Descriptor Pointer */ + long cv = /* Check Value */ st_lds(SP, nbytes); if (must_test && !(IgnMask & BIT(ERANGE))) diff --git a/util/int/do_proc.c b/util/int/do_proc.c index c5afbe4161..bbe388deb5 100644 --- a/util/int/do_proc.c +++ b/util/int/do_proc.c @@ -25,33 +25,33 @@ extern int running; /* from main.c */ /* Forward declarations */ -PRIVATE void lfr(size), ret(size); +static void lfr(size), ret(size); /** CAI -: Call procedure (procedure identifier on stack) */ void DoCAI(void) /* proc identifier on top of stack */ { - register long pi = spop(psize); + long pi = spop(psize); LOG(("@P6 DoCAI(%lu)", pi)); call(arg_p(pi), RSB_CAL); } /** CAL p: Call procedure (with identifier p) */ -void DoCAL(register long pi) +void DoCAL(long pi) { LOG(("@P6 DoCAL(%lu)", pi)); call(arg_p(pi), RSB_CAL); } /** LFR s: Load function result */ -void DoLFR(register size l) +void DoLFR(size l) { LOG(("@P6 DoLFR(%ld)", l)); lfr(arg_s(l)); } /** RET z: Return (function result consists of top z bytes) */ -void DoRET(register size l) +void DoRET(size l) { LOG(("@P6 DoRET(%ld)", l)); ret(arg_z(l)); @@ -64,8 +64,8 @@ void DoRET(register size l) void call(long new_PI, int rsbcode) { /* legality of new_PI has already been checked */ - register size nloc = proctab[new_PI].pr_nloc; - register ptr ep = proctab[new_PI].pr_ep; + size nloc = proctab[new_PI].pr_nloc; + ptr ep = proctab[new_PI].pr_ep; push_frame(SP); /* remember AB */ pushrsb(rsbcode); @@ -82,7 +82,7 @@ void call(long new_PI, int rsbcode) * Loading a function result. * ************************************************************************/ -PRIVATE void lfr(size sz) +static void lfr(size sz) { if (sz > FRALimit) { @@ -110,7 +110,7 @@ PRIVATE void lfr(size sz) * Returning from a procedure. * ************************************************************************/ -PRIVATE void ret(size sz) +static void ret(size sz) { if (sz > FRALimit) { diff --git a/util/int/do_ptrar.c b/util/int/do_ptrar.c index 368a52c996..291baea4c0 100644 --- a/util/int/do_ptrar.c +++ b/util/int/do_ptrar.c @@ -34,10 +34,10 @@ #endif /* SEGCHECK */ /** ADP f: Add f to pointer on top of stack */ -void DoADP(register long l) +void DoADP(long l) { - register ptr p, t = st_lddp(SP); + ptr p, t = st_lddp(SP); LOG(("@R6 DoADP(%ld)", l)); spoilFRA(); @@ -52,10 +52,10 @@ void DoADP(register long l) } /** ADS w: Add w-byte value and pointer */ -void DoADS(register size l) +void DoADS(size l) { - register long t = spop(arg_wi(l)); - register ptr p, s = st_lddp(SP); + long t = spop(arg_wi(l)); + ptr p, s = st_lddp(SP); LOG(("@R6 DoADS(%ld)", l)); spoilFRA(); @@ -70,11 +70,11 @@ void DoADS(register size l) } /** SBS w: Subtract pointers in same fragment and push diff as size w integer */ -void DoSBS(register size l) +void DoSBS(size l) { - register ptr t = st_lddp(SP); - register ptr s = st_lddp(SP + psize); - register long w; + ptr t = st_lddp(SP); + ptr s = st_lddp(SP + psize); + long w; LOG(("@R6 DoSBS(%ld)", l)); spoilFRA(); diff --git a/util/int/do_sets.c b/util/int/do_sets.c index 25fcd65565..e7c0b4b598 100644 --- a/util/int/do_sets.c +++ b/util/int/do_sets.c @@ -13,10 +13,10 @@ #include "fra.h" #include "switch.h" -PRIVATE void bit_test(size), create_set(size); +static void bit_test(size), create_set(size); /** INN w: Bit test on w byte set (bit number on top of stack) */ -void DoINN(register size l) +void DoINN(size l) { LOG(("@Y6 DoINN(%ld)", l)); spoilFRA(); @@ -24,7 +24,7 @@ void DoINN(register size l) } /** SET w: Create singleton w byte set with bit n on (n is top of stack) */ -void DoSET(register size l) +void DoSET(size l) { LOG(("@Y6 DoSET(%ld)", l)); spoilFRA(); @@ -36,12 +36,12 @@ void DoSET(register size l) * ON --> push 1 on stack. * OFF -> push 0 on stack. **/ -PRIVATE void bit_test(size w) +static void bit_test(size w) { - register int bitno = (int)swpop(); /* bitno on TOS */ - register char test_byte = (char)0; /* default value to be tested */ - register int wordoff = bitno / 8; - register int bitoff = bitno % 8; + int bitno = (int)swpop(); /* bitno on TOS */ + char test_byte = (char)0; /* default value to be tested */ + int wordoff = bitno / 8; + int bitoff = bitno % 8; if (bitoff < 0) bitoff += 8; @@ -64,12 +64,12 @@ PRIVATE void bit_test(size w) * The w bytes constituting the set are * pushed on the stack. **/ -PRIVATE void create_set(size w) +static void create_set(size w) { - register int bitno = (int)swpop(); - register size nbytes = w; - register int wordoff = bitno / 8; - register int bitoff = bitno % 8; + int bitno = (int)swpop(); + size nbytes = w; + int wordoff = bitno / 8; + int bitoff = bitno % 8; if (bitoff < 0) bitoff += 8; diff --git a/util/int/do_store.c b/util/int/do_store.c index 4d5651720e..b2ea59ecc5 100644 --- a/util/int/do_store.c +++ b/util/int/do_store.c @@ -15,7 +15,7 @@ #include "switch.h" /** STL l: Store local or parameter */ -void DoSTL(register long l) +void DoSTL(long l) { LOG(("@S6 DoSTL(%ld)", l)); spoilFRA(); @@ -24,9 +24,9 @@ void DoSTL(register long l) } /** STE g: Store external */ -void DoSTE(register unsigned long arg) +void DoSTE(unsigned long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@S6 DoSTE(%lu)", p)); spoilFRA(); @@ -34,7 +34,7 @@ void DoSTE(register unsigned long arg) } /** SIL l: Store into word pointed to by l-th local or parameter */ -void DoSIL(register long l) +void DoSIL(long l) { LOG(("@S6 DoSIL(%ld)", l)); spoilFRA(); @@ -43,9 +43,9 @@ void DoSIL(register long l) } /** STF f: Store offsetted */ -void DoSTF(register long l) +void DoSTF(long l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@S6 DoSTF(%ld)", l)); spoilFRA(); @@ -53,9 +53,9 @@ void DoSTF(register long l) } /** STI o: Store indirect o bytes (pop address, then data) */ -void DoSTI(register size l) +void DoSTI(size l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@S6 DoSTI(%ld)", l)); spoilFRA(); @@ -63,9 +63,9 @@ void DoSTI(register size l) } /** STS w: Store indirect, w-byte integer on top of stack gives object size */ -void DoSTS(register size l) +void DoSTS(size l) { - register ptr p; + ptr p; LOG(("@S6 DoSTS(%ld)", l)); spoilFRA(); @@ -75,7 +75,7 @@ void DoSTS(register size l) } /** SDL l: Store double local or parameter */ -void DoSDL(register long l) +void DoSDL(long l) { LOG(("@S6 DoSDL(%ld)", l)); @@ -85,9 +85,9 @@ void DoSDL(register long l) } /** SDE g: Store double external */ -void DoSDE(register unsigned long arg) +void DoSDE(unsigned long arg) { - register ptr p = i2p(arg); + ptr p = i2p(arg); LOG(("@S6 DoSDE(%lu)", p)); spoilFRA(); @@ -95,9 +95,9 @@ void DoSDE(register unsigned long arg) } /** SDF f: Store double offsetted */ -void DoSDF(register long l) +void DoSDF(long l) { - register ptr p = dppop(); + ptr p = dppop(); LOG(("@S6 DoSDF(%ld)", l)); spoilFRA(); diff --git a/util/int/do_unsar.c b/util/int/do_unsar.c index 411e7a1c34..0e6f212366 100644 --- a/util/int/do_unsar.c +++ b/util/int/do_unsar.c @@ -32,7 +32,7 @@ extern int must_test; #define sbu(w1, w2) (unsigned long)(w1 - w2) #define mlu(w1, w2) (unsigned long)(w1 * w2) -PRIVATE unsigned long dvu(unsigned long w1, unsigned long w2) +static unsigned long dvu(unsigned long w1, unsigned long w2) { if (w2 == 0) { @@ -46,7 +46,7 @@ PRIVATE unsigned long dvu(unsigned long w1, unsigned long w2) return (w1 / w2); } -PRIVATE unsigned long rmu(unsigned long w1, unsigned long w2) +static unsigned long rmu(unsigned long w1, unsigned long w2) { if (w2 == 0) { @@ -61,7 +61,7 @@ PRIVATE unsigned long rmu(unsigned long w1, unsigned long w2) } /*ARGSUSED*/ -PRIVATE unsigned long slu(unsigned long w1, unsigned long w2, size nbytes) +static unsigned long slu(unsigned long w1, unsigned long w2, size nbytes) { /* w1 << w2 */ #ifdef LOGGING @@ -81,7 +81,7 @@ PRIVATE unsigned long slu(unsigned long w1, unsigned long w2, size nbytes) } /*ARGSUSED*/ -PRIVATE unsigned long sru(unsigned long w1, unsigned long w2, size nbytes) +static unsigned long sru(unsigned long w1, unsigned long w2, size nbytes) { /* w1 >> w2 */ #ifdef LOGGING @@ -101,9 +101,9 @@ PRIVATE unsigned long sru(unsigned long w1, unsigned long w2, size nbytes) } /** ADU w: Addition */ -void DoADU(register size l) +void DoADU(size l) { - register unsigned long t = upop(arg_wi(l)); + unsigned long t = upop(arg_wi(l)); LOG(("@U6 DoADU(%ld)", l)); spoilFRA(); @@ -111,9 +111,9 @@ void DoADU(register size l) } /** SBU w: Subtraction */ -void DoSBU(register size l) +void DoSBU(size l) { - register unsigned long t = upop(arg_wi(l)); + unsigned long t = upop(arg_wi(l)); LOG(("@U6 DoSBU(%ld)", l)); spoilFRA(); @@ -121,9 +121,9 @@ void DoSBU(register size l) } /** MLU w: Multiplication */ -void DoMLU(register size l) +void DoMLU(size l) { - register unsigned long t = upop(arg_wi(l)); + unsigned long t = upop(arg_wi(l)); LOG(("@U6 DoMLU(%ld)", l)); spoilFRA(); @@ -131,9 +131,9 @@ void DoMLU(register size l) } /** DVU w: Division */ -void DoDVU(register size l) +void DoDVU(size l) { - register unsigned long t = upop(arg_wi(l)); + unsigned long t = upop(arg_wi(l)); LOG(("@U6 DoDVU(%ld)", l)); spoilFRA(); @@ -141,9 +141,9 @@ void DoDVU(register size l) } /** RMU w: Remainder */ -void DoRMU(register size l) +void DoRMU(size l) { - register unsigned long t = upop(arg_wi(l)); + unsigned long t = upop(arg_wi(l)); LOG(("@U6 DoRMU(%ld)", l)); spoilFRA(); @@ -151,9 +151,9 @@ void DoRMU(register size l) } /** SLU w: Shift left */ -void DoSLU(register size l) +void DoSLU(size l) { - register unsigned long t = uwpop(); + unsigned long t = uwpop(); LOG(("@U6 DoSLU(%ld)", l)); spoilFRA(); @@ -162,9 +162,9 @@ void DoSLU(register size l) } /** SRU w: Shift right */ -void DoSRU(register size l) +void DoSRU(size l) { - register unsigned long t = uwpop(); + unsigned long t = uwpop(); LOG(("@U6 DoSRU(%ld)", l)); spoilFRA(); diff --git a/util/int/dump.c b/util/int/dump.c index 7dac0b2fec..9a0e99baf1 100644 --- a/util/int/dump.c +++ b/util/int/dump.c @@ -33,19 +33,19 @@ extern long inr; /* from log.c */ */ /* Forward declarations */ -PRIVATE char *displ_undefs(int, ptr), *displ_fil(ptr), *displ_sh(char, int), *displ_code(int); -PRIVATE ptr std_raw(ptr, int), std_rsb(ptr); -PRIVATE int std_bytes(ptr, ptr, int), dtd_bytes(ptr, ptr, int), FRAd_bytes(int, int, int); -PRIVATE void std_item(ptr), std_left_undefs(int, ptr); -PRIVATE void gdad_item(ptr), gdad_left_undefs(int, ptr); -PRIVATE void hpd_item(ptr), hpd_left_undefs(int, ptr); -PRIVATE void FRA_dump(void), FRA_item(int); +static char *displ_undefs(int, ptr), *displ_fil(ptr), *displ_sh(char, int), *displ_code(int); +static ptr std_raw(ptr, int), std_rsb(ptr); +static int std_bytes(ptr, ptr, int), dtd_bytes(ptr, ptr, int), FRAd_bytes(int, int, int); +static void std_item(ptr), std_left_undefs(int, ptr); +static void gdad_item(ptr), gdad_left_undefs(int, ptr); +static void hpd_item(ptr), hpd_left_undefs(int, ptr); +static void FRA_dump(void), FRA_item(int); /******** Stack Dump ********/ void std_all(long sz, int rawfl) { - register ptr addr; + ptr addr; if (!check_log(" d1 ")) return; @@ -84,13 +84,13 @@ void std_all(long sz, int rawfl) LOG((" d2 ")); } -PRIVATE ptr std_raw(ptr addr, int rawfl) +static ptr std_raw(ptr addr, int rawfl) { /* Produces a formatted dump of the stack segment starting at addr, up to the Return Status Block (identified by protection bits) */ - register int nundef = 0; + int nundef = 0; LOG((" d2 ADDRESS BYTE ITEM VALUE SHADOW")); @@ -117,7 +117,7 @@ PRIVATE ptr std_raw(ptr addr, int rawfl) return addr; } -PRIVATE void std_item(ptr addr) +static void std_item(ptr addr) { if (is_wordaligned(addr) && is_in_stack(addr, psize) && std_bytes(addr, addr + psize, SH_DATAP | SH_INSP)) @@ -144,7 +144,7 @@ PRIVATE void std_item(ptr addr) } /** Dumps the Return Status Block. */ -PRIVATE ptr std_rsb(ptr addr) +static ptr std_rsb(ptr addr) { ptr dmp_lb; int code; @@ -192,7 +192,7 @@ PRIVATE ptr std_rsb(ptr addr) return addr - rsbsize; } -PRIVATE char* displ_code(int rsbcode) +static char* displ_code(int rsbcode) { switch (rsbcode) { @@ -210,7 +210,7 @@ PRIVATE char* displ_code(int rsbcode) UNREACHABLE_CODE; } -PRIVATE void std_left_undefs(int nundef, ptr addr) +static void std_left_undefs(int nundef, ptr addr) { /* handle pending undefineds */ switch (nundef) @@ -227,9 +227,9 @@ PRIVATE void std_left_undefs(int nundef, ptr addr) } } -PRIVATE void FRA_dump(void) +static void FRA_dump(void) { - register int addr; + int addr; LOG((" d2 FRA: size = %d, %s", FRASize, FRA_def ? "defined" : "undefined")); @@ -239,7 +239,7 @@ PRIVATE void FRA_dump(void) } } -PRIVATE void FRA_item(int addr) +static void FRA_item(int addr) { if (is_wordaligned(addr) && is_in_FRA(addr, psize) && FRAd_bytes(addr, (int)(addr + psize), SH_DATAP | SH_INSP)) @@ -271,8 +271,8 @@ PRIVATE void FRA_item(int addr) void gdad_all(ptr low, ptr high) { - register ptr addr; - register int nundef = 0; + ptr addr; + int nundef = 0; if (!check_log(" +1 ")) return; @@ -311,7 +311,7 @@ void gdad_all(ptr low, ptr high) LOG((" +1 ")); } -PRIVATE void gdad_item(ptr addr) +static void gdad_item(ptr addr) { if (is_wordaligned(addr) && is_in_data(addr, psize) && dtd_bytes(addr, addr + psize, SH_DATAP | SH_INSP)) @@ -338,7 +338,7 @@ PRIVATE void gdad_item(ptr addr) } } -PRIVATE void gdad_left_undefs(int nundef, ptr addr) +static void gdad_left_undefs(int nundef, ptr addr) { /* handle pending undefineds */ switch (nundef) @@ -359,8 +359,8 @@ PRIVATE void gdad_left_undefs(int nundef, ptr addr) void hpd_all(void) { - register ptr addr; - register int nundef = 0; + ptr addr; + int nundef = 0; if (!check_log(" *1 ")) return; @@ -394,7 +394,7 @@ void hpd_all(void) LOG((" *1 ")); } -PRIVATE void hpd_item(ptr addr) +static void hpd_item(ptr addr) { if (is_wordaligned(addr) && is_in_data(addr, psize) && dtd_bytes(addr, addr + psize, SH_DATAP | SH_INSP)) @@ -421,7 +421,7 @@ PRIVATE void hpd_item(ptr addr) } } -PRIVATE void hpd_left_undefs(int nundef, ptr addr) +static void hpd_left_undefs(int nundef, ptr addr) { /* handle pending undefineds */ switch (nundef) @@ -440,7 +440,7 @@ PRIVATE void hpd_left_undefs(int nundef, ptr addr) /* Service routines */ -PRIVATE int std_bytes(ptr low, ptr high, int bits) +static int std_bytes(ptr low, ptr high, int bits) { /* True if all stack bytes from low to high-1 have one of the bits in bits on. @@ -456,7 +456,7 @@ PRIVATE int std_bytes(ptr low, ptr high, int bits) return byte & bits; } -PRIVATE int dtd_bytes(ptr low, ptr high, int bits) +static int dtd_bytes(ptr low, ptr high, int bits) { /* True if all data bytes from low to high-1 have one of the bits in bits on. @@ -472,7 +472,7 @@ PRIVATE int dtd_bytes(ptr low, ptr high, int bits) return byte & bits; } -PRIVATE int FRAd_bytes(int low, int high, int bits) +static int FRAd_bytes(int low, int high, int bits) { /* True if all data bytes from low to high-1 have one of the bits in bits on. @@ -488,7 +488,7 @@ PRIVATE int FRAd_bytes(int low, int high, int bits) return byte & bits; } -PRIVATE char* displ_undefs(int nundef, ptr addr) +static char* displ_undefs(int nundef, ptr addr) { /* Given the number of undefineds, we want to report the number of words with the left-over numbers of bytes on both sides: @@ -502,9 +502,9 @@ PRIVATE char* displ_undefs(int nundef, ptr addr) This takes some arithmetic. */ static char buf[30]; - register int left = wsize - 1 - p2i(addr - 1) % wsize; - register int wrds = (nundef - left) / wsize; - register int right = nundef - left - wrds * wsize; + int left = wsize - 1 - p2i(addr - 1) % wsize; + int wrds = (nundef - left) / wsize; + int right = nundef - left - wrds * wsize; if (wrds == 0) { @@ -533,7 +533,7 @@ PRIVATE char* displ_undefs(int nundef, ptr addr) return buf; } -PRIVATE char* displ_fil(ptr fil) +static char* displ_fil(ptr fil) { /* Returns a buffer containing a representation of the filename derived from FIL-value fil. */ @@ -561,12 +561,12 @@ PRIVATE char* displ_fil(ptr fil) return &buf[0]; } -PRIVATE char* displ_sh(char shadow, int byte) +static char* displ_sh(char shadow, int byte) { /* Returns a buffer containing a description of the shadow byte. */ static char buf[32]; - register char* bufp; + char* bufp; int check = 0; bufp = buf; diff --git a/util/int/fra.c b/util/int/fra.c index b8adc7d205..6372b7c052 100644 --- a/util/int/fra.c +++ b/util/int/fra.c @@ -22,7 +22,7 @@ void init_FRA(void) void pushFRA(size sz) { - register int i; + int i; if (sz == 0) return; @@ -39,7 +39,7 @@ void pushFRA(size sz) void popFRA(size sz) { - register int i; + int i; if (sz == 0) return; diff --git a/util/int/global.h b/util/int/global.h index 6d1f65fa45..f50f3d4648 100644 --- a/util/int/global.h +++ b/util/int/global.h @@ -8,9 +8,9 @@ #include #include -/********* PRIVATE/static *********/ +/********* static/static *********/ -#define PRIVATE static /* or not */ +#define static static /* or not */ /********* The internal data types ********/ diff --git a/util/int/init.c b/util/int/init.c index 5bf144e836..3239ab513c 100644 --- a/util/int/init.c +++ b/util/int/init.c @@ -46,18 +46,18 @@ extern char** environ; -PRIVATE size alignedstrlen(char* s); -PRIVATE ptr storestring(ptr addr, char* s); +static size alignedstrlen(char* s); +static ptr storestring(ptr addr, char* s); char* load_name; void init(int ac, char** av) { - register char** p; - register size env_vec_size; /* size of environ vector */ - register size arg_vec_size; /* size of argument vector */ - register size string_size = 0; /* total size arg, env, strings */ - register ptr ARGB, vecp, strp; + char** p; + size env_vec_size; /* size of environ vector */ + size arg_vec_size; /* size of argument vector */ + size string_size = 0; /* total size arg, env, strings */ + ptr ARGB, vecp, strp; init_ofiles(1); /* Initialize all output files */ init_signals(); @@ -149,21 +149,21 @@ void init(int ac, char** av) wpush((long)ac); /* push argc */ } -PRIVATE size alignedstrlen(char* s) +static size alignedstrlen(char* s) { - register size len = strlen(s) + 1; + size len = strlen(s) + 1; return (len + wsize - 1) / wsize * wsize; } -PRIVATE ptr storestring(ptr addr, char* s) +static ptr storestring(ptr addr, char* s) { /* Store string, aligned to a fit multiple of wsize bytes. Return first address on a wordsize boundary after string. */ - register size oldlen = strlen(s) + 1; - register size newlen = ((oldlen + wsize - 1) / wsize) * wsize; - register long i; + size oldlen = strlen(s) + 1; + size newlen = ((oldlen + wsize - 1) / wsize) * wsize; + long i; LOG(("@g6 storestring(%lu, %s), oldlen = %ld, newlen = %ld", addr, s, oldlen, newlen)); ch_in_data(addr, newlen); diff --git a/util/int/io.c b/util/int/io.c index aeef219323..74e9291b5a 100644 --- a/util/int/io.c +++ b/util/int/io.c @@ -30,7 +30,7 @@ extern char mess_file[64]; /* from main.c */ long mess_id; /* Id, to determine unique mess file */ FILE* mess_fp; /* Filepointer of message file */ -PRIVATE void do_fatal(FILE*, char*, va_list); +static void do_fatal(FILE*, char*, va_list); void incr_mess_id(void) { /* for a new child */ @@ -43,7 +43,7 @@ extern long inr; /* from log.c */ /******** General file handling ********/ -PRIVATE int highestfd(int fd); +static int highestfd(int fd); int fd_limit = 100; /* first non-available file descriptor */ @@ -52,8 +52,8 @@ int fd_limit = 100; /* first non-available file descriptor */ */ FILE* fcreat_high(char* fn) { - register int fd; - register FILE* fp; + int fd; + FILE* fp; if ((fd = creat(fn, 0644)) == -1) return NULL; @@ -69,10 +69,10 @@ FILE* fcreat_high(char* fn) * position and returns the new "fd". Does this without knowing * how many fd-s are available. */ -PRIVATE int highestfd(int fd) +static int highestfd(int fd) { - register int newfd, higherfd; + int newfd, higherfd; /* try to get a better fd */ newfd = dup(fd); @@ -158,7 +158,7 @@ void close_down(int rc) exit(rc); } -PRIVATE void do_fatal(FILE* fp, char* fmt, va_list ap) +static void do_fatal(FILE* fp, char* fmt, va_list ap) { fprintf(fp, "(Fatal error) "); if (load_name) @@ -186,7 +186,7 @@ void message(char* fmt, ...) char* position(void) /* transient */ { static char buff[300]; - register char* fn = dt_fname(getFIL()); + char* fn = dt_fname(getFIL()); #ifdef LOGGING sprintf(buff, "\"%s\", line %ld, INR = %ld", fn, getLIN(), inr); diff --git a/util/int/log.c b/util/int/log.c index 7e760606a9..d54e020f6d 100644 --- a/util/int/log.c +++ b/util/int/log.c @@ -30,27 +30,27 @@ int must_log; /* set if logging may be required */ long log_start; /* first instruction to be logged */ int logging; /* set as soon as logging starts */ -PRIVATE long stop; /* inr after which to stop */ -PRIVATE long gdump; /* inr at which to dump GDA */ -PRIVATE ptr gmin, gmax; /* GDA dump limits */ -PRIVATE long hdump; /* inr at which to dump the heap */ -PRIVATE long stdsize; /* optional size of stack dump */ -PRIVATE int stdrawflag; /* set if unformatted stack dump */ - -PRIVATE char log_file[64] = "int.log"; /* Name of log file */ -PRIVATE long at; /* patch to set log_start */ -PRIVATE char* lmask; /* patch to set logmask */ -PRIVATE char* logvar; /* Name of LOG variable */ -PRIVATE int log_level[128]; /* Holds the log levels */ -PRIVATE FILE* log_fp; /* Filepointer of log file */ +static long stop; /* inr after which to stop */ +static long gdump; /* inr at which to dump GDA */ +static ptr gmin, gmax; /* GDA dump limits */ +static long hdump; /* inr at which to dump the heap */ +static long stdsize; /* optional size of stack dump */ +static int stdrawflag; /* set if unformatted stack dump */ + +static char log_file[64] = "int.log"; /* Name of log file */ +static long at; /* patch to set log_start */ +static char* lmask; /* patch to set logmask */ +static char* logvar; /* Name of LOG variable */ +static int log_level[128]; /* Holds the log levels */ +static FILE* log_fp; /* Filepointer of log file */ /* arguments for the logging machine */ -PRIVATE int argcount; -PRIVATE char* arglist[20]; /* arbitrary size */ +static int argcount; +static char* arglist[20]; /* arbitrary size */ -PRIVATE void set_lmask(char* mask); -PRIVATE char* getpar(char*); -PRIVATE long longpar(char*, long); +static void set_lmask(char* mask); +static char* getpar(char*); +static long longpar(char*, long); int logarg(char* str) { @@ -60,8 +60,8 @@ int logarg(char* str) The string is interesting if it contains a '='. */ - register char* arg = str; - register char ch; + char* arg = str; + char ch; while ((ch = *arg) && (ch != '=')) { @@ -187,14 +187,14 @@ void close_log(void) #define inrange(c, l, h) (l <= c && c <= h) #define layout(c) (c == ' ' || c == '\t' || c == ',') -PRIVATE void set_lmask(char* mask) +static void set_lmask(char* mask) { - register char* mp = mask; + char* mp = mask; while (*mp != 0) { - register char* lvp; - register int lev; + char* lvp; + int lev; while (layout(*mp)) { @@ -210,7 +210,7 @@ PRIVATE void set_lmask(char* mask) /* find classes */ while (mp != lvp) { - register int mc = *mp; + int mc = *mp; if (inrange(mc, 'a', 'z') || inrange(mc, 'A', 'Z') || mc == '+' || mc == '*') { @@ -219,7 +219,7 @@ PRIVATE void set_lmask(char* mask) } else if (mc == '-') { - register char c; + char c; for (c = *(mp - 1) + 1; c <= *(mp + 1); c++) { @@ -311,16 +311,16 @@ void log_eoi(void) /******** Service routines ********/ -PRIVATE char* getpar(char* var) +static char* getpar(char* var) { /* Looks up the name in the argument list. */ - register int count; - register int ln = strlen(var); + int count; + int ln = strlen(var); for (count = 0; count < argcount; count++) { - register char* arg = arglist[count]; + char* arg = arglist[count]; if (strncmp(var, arg, ln) == 0 && arg[ln] == '=') { @@ -331,12 +331,12 @@ PRIVATE char* getpar(char* var) return 0; } -PRIVATE long longpar( +static long longpar( char* var, /* name of the variable */ long def /* default value */ ) { - register char* res = getpar(var); + char* res = getpar(var); return (res ? atol(res) : def); } diff --git a/util/int/m_ioctl.c b/util/int/m_ioctl.c index 3aa006e8f8..9bfd46930e 100644 --- a/util/int/m_ioctl.c +++ b/util/int/m_ioctl.c @@ -44,7 +44,7 @@ int do_ioctl(int fd, int req, ptr addr) { - register long e; + long e; #ifdef WANT_SGTTY struct sgttyb sg_buf; #endif diff --git a/util/int/m_sigtrp.c b/util/int/m_sigtrp.c index 67d37639a4..7c9e551f24 100644 --- a/util/int/m_sigtrp.c +++ b/util/int/m_sigtrp.c @@ -29,10 +29,10 @@ #ifndef NSIG #define NSIG _NSIG #endif -PRIVATE int sig_map[NSIG + 1]; /* maps signals onto trap numbers */ +static int sig_map[NSIG + 1]; /* maps signals onto trap numbers */ -PRIVATE void HndlIntSig(int); /* handle signal to interpreter */ -PRIVATE void HndlEmSig(int); /* handle signal to user program */ +static void HndlIntSig(int); /* handle signal to interpreter */ +static void HndlEmSig(int); /* handle signal to user program */ void init_signals(void) { @@ -74,7 +74,7 @@ int do_sigtrp( int sn /* UNIX signal number */ ) { - register int old_tn; + int old_tn; if (sn <= 0 || sn > NSIG) { @@ -121,13 +121,13 @@ int do_sigtrp( */ void trap_signal(void) { - register int old_sig = signalled; + int old_sig = signalled; signalled = 0; trap(sig_map[old_sig]); } -PRIVATE void HndlIntSig(int sn) +static void HndlIntSig(int sn) { /* The interpreter got the signal */ signal(sn, SIG_IGN); /* peace and quiet for close_down() */ @@ -136,7 +136,7 @@ PRIVATE void HndlIntSig(int sn) close_down(1); } -PRIVATE void HndlEmSig(int sn) +static void HndlEmSig(int sn) { /* The EM machine got the signal */ signal(sn, HndlIntSig); /* Revert to old situation */ diff --git a/util/int/main.c b/util/int/main.c index d1d8c6beb3..0e03876922 100644 --- a/util/int/main.c +++ b/util/int/main.c @@ -39,7 +39,7 @@ size maxheap; /* if set, max heap size */ extern long inr; /* from log.c */ #endif /* LOGGING */ -PRIVATE char* dflt_av[] = { "e.out", 0 }; /* default arguments */ +static char* dflt_av[] = { "e.out", 0 }; /* default arguments */ /** Check dynamically that the interpreter can run on the target machine. */ static void check_requirements(char* name) @@ -60,8 +60,8 @@ static void check_requirements(char* name) int main(int argc, char* argv[]) { - register int i; - register int nosetjmp = 1; + int i; + int nosetjmp = 1; int must_disassemble = 0; int must_tally = 0; diff --git a/util/int/moncalls.c b/util/int/moncalls.c index 19511e1e65..1812e76d1a 100644 --- a/util/int/moncalls.c +++ b/util/int/moncalls.c @@ -129,12 +129,12 @@ struct timeb * * ************************************************************************/ -PRIVATE size buf_cnt[5]; /* Current sizes of the buffers */ -PRIVATE char* buf[5]; /* Pointers to the buffers */ +static size buf_cnt[5]; /* Current sizes of the buffers */ +static char* buf[5]; /* Pointers to the buffers */ -PRIVATE void check_buf(int n, size sz); -PRIVATE int savestr(int n, ptr addr); -PRIVATE int vec(int n1, int n2, ptr addr, char*** vecvec); +static void check_buf(int n, size sz); +static int savestr(int n, ptr addr); +static int vec(int n1, int n2, ptr addr, char*** vecvec); void moncall(void) { @@ -255,7 +255,7 @@ void moncall(void) #ifdef LOGGING if (check_log("@m6")) { - register int i; + int i; for (i = 0; i < n; i++) { @@ -346,7 +346,7 @@ void moncall(void) #ifdef LOGGING if (check_log("@m6")) { - register int i; + int i; for (i = 0; i < nbytes; i++) { @@ -1064,7 +1064,7 @@ void moncall(void) /* Buffer administration */ -PRIVATE void check_buf(int n, size sz) +static void check_buf(int n, size sz) { if (buf_cnt[n] == 0) { @@ -1078,10 +1078,10 @@ PRIVATE void check_buf(int n, size sz) } } -PRIVATE int savestr(int n, ptr addr) +static int savestr(int n, ptr addr) { - register size len; - register char *cp, ch; + size len; + char *cp, ch; /* determine the length, carefully */ len = 0; @@ -1109,12 +1109,12 @@ PRIVATE int savestr(int n, ptr addr) return 1; } -PRIVATE int vec(int n1, int n2, ptr addr, char*** vecvec) +static int vec(int n1, int n2, ptr addr, char*** vecvec) { - register char *cp1, *cp2; + char *cp1, *cp2; ptr p, ldp; - register int n_ent = 0; /* number of entries */ - register size str = 0; /* total string length */ + int n_ent = 0; /* number of entries */ + size str = 0; /* total string length */ /* determine number of elements n_ent */ p = addr; diff --git a/util/int/monstruct.c b/util/int/monstruct.c index e38fbe72d0..d5f110a275 100644 --- a/util/int/monstruct.c +++ b/util/int/monstruct.c @@ -36,7 +36,7 @@ struct timeb /******** System to EM memory ********/ -PRIVATE void mem_stfld(ptr addr, size offset, size length, long val) +static void mem_stfld(ptr addr, size offset, size length, long val) { mem_stn(addr + offset, val, length); } @@ -129,7 +129,7 @@ int ltchars2mem(ptr addr, struct ltchars* ltcharsb) /******** EM memory to system ********/ -PRIVATE unsigned long mem_ldfld(ptr addr, size offset, size length) +static unsigned long mem_ldfld(ptr addr, size offset, size length) { return mem_ldu(addr + offset, length); } diff --git a/util/int/proctab.c b/util/int/proctab.c index 4a5e418643..26de8b0f9b 100644 --- a/util/int/proctab.c +++ b/util/int/proctab.c @@ -13,7 +13,7 @@ /** Procedure table */ struct proc* proctab; -PRIVATE long pr_cnt; +static long pr_cnt; /** Allocates and initializes the procedure table. */ void init_proctab(void) @@ -28,9 +28,9 @@ void init_proctab(void) */ void add_proc(size nloc, ptr ep) { - register struct proc* pr = &proctab[pr_cnt++]; - register struct proc* p; - register ptr ff = DB; + struct proc* pr = &proctab[pr_cnt++]; + struct proc* p; + ptr ff = DB; LOG((" r6 add_proc: pr_cnt = %ld, nloc = %lu, ep = %lu", pr_cnt - 1, nloc, ep)); if (ep > DB) @@ -60,14 +60,14 @@ void add_proc(size nloc, ptr ep) void end_init_proctab(void) { #ifdef LOGGING - register long p; + long p; if (!check_log(" r6")) return; for (p = 0; p < NProc; p++) { - register struct proc* pr = &proctab[p]; + struct proc* pr = &proctab[p]; LOG( (" r5: proctab[%ld]: nloc = %d, ep = %lu, ff = %lu", p, pr->pr_nloc, pr->pr_ep, diff --git a/util/int/read.c b/util/int/read.c index c2cc088c62..38a6382588 100644 --- a/util/int/read.c +++ b/util/int/read.c @@ -48,12 +48,12 @@ long ENTRY; long NLINE; size SZDATA; -PRIVATE FILE* load_fp; /* Filepointer of load file */ +static FILE* load_fp; /* Filepointer of load file */ -PRIVATE ptr rd_repeat(ptr, size, ptr); -PRIVATE ptr rd_descr(int, size, ptr); -PRIVATE int rd_byte(void); -PRIVATE long rd_int(size); +static ptr rd_repeat(ptr, size, ptr); +static ptr rd_descr(int, size, ptr); +static int rd_byte(void); +static long rd_int(size); void rd_open(char* fname) { /* Open loadfile */ @@ -123,9 +123,9 @@ void rd_text(void) void rd_gda(void) { - register int type, prev_type; - register ptr pos, prev_pos; /* prev_pos invalid if prev_type==0 */ - register long i; + int type, prev_type; + ptr pos, prev_pos; /* prev_pos invalid if prev_type==0 */ + long i; type = prev_type = 0; pos = prev_pos = i2p(0); @@ -136,7 +136,7 @@ void rd_gda(void) if (type == 0) { /* repetition descriptor */ - register size count = rd_int(psize); + size count = rd_int(psize); LOG((" r6 rd_gda(), case 0: count = %lu", count)); if (prev_type == 0) @@ -149,7 +149,7 @@ void rd_gda(void) else { /* filling descriptor */ - register size count = btol(rd_byte()); + size count = btol(rd_byte()); LOG((" r6 rd_gda(), case %d: count = %lu", type, count)); prev_pos = pos; @@ -165,13 +165,13 @@ void rd_gda(void) void rd_proctab(void) { - register long p; + long p; init_proctab(); for (p = 0; p < NPROC; p++) { - register long nloc = rd_int(psize); - register ptr ep = i2p(rd_int(psize)); + long nloc = rd_int(psize); + ptr ep = i2p(rd_int(psize)); add_proc(nloc, ep); } @@ -203,14 +203,14 @@ void rd_close(void) * number is also stored in a double. * ************************************************************************/ -PRIVATE ptr rd_repeat(ptr pos, size count, ptr prev_pos) +static ptr rd_repeat(ptr pos, size count, ptr prev_pos) { - register size diff = pos - prev_pos; - register size j; + size diff = pos - prev_pos; + size j; for (j = 0; j < count; j++) { - register long i; + long i; for (i = 0; i < diff; i++) { @@ -225,11 +225,11 @@ PRIVATE ptr rd_repeat(ptr pos, size count, ptr prev_pos) return pos; } -PRIVATE ptr rd_descr(int type, size count, ptr pos) +static ptr rd_descr(int type, size count, ptr pos) { - register size j; + size j; char fl_rep[128]; /* fp number representation */ - register int fl_cnt; + int fl_cnt; switch (type) { @@ -305,19 +305,19 @@ PRIVATE ptr rd_descr(int type, size count, ptr pos) return pos; } -PRIVATE int rd_byte(void) +static int rd_byte(void) { - register int i; + int i; if ((i = getc(load_fp)) == EOF) fatal("EOF reached during initialization"); return (i); } -PRIVATE long rd_int(size n) +static long rd_int(size n) { - register long l; - register int i; + long l; + int i; l = btol(rd_byte()); for (i = 1; i < n; i++) diff --git a/util/int/rsb.c b/util/int/rsb.c index e97a396df6..5f4e8349b2 100644 --- a/util/int/rsb.c +++ b/util/int/rsb.c @@ -66,12 +66,12 @@ void pushrsb(int rsbcode) int poprsb(int rtt) /* set to 1 if working for RTT */ { /* pops the RSB and returns the rsbcode, for further testing */ - register int rsbcode; + int rsbcode; #ifdef LOGGING { /* check SP */ - register ptr properSP = LB - proctab[PI].pr_nloc; + ptr properSP = LB - proctab[PI].pr_nloc; if (SP < properSP) warning(rtt ? WRTTSTL : WRETSTL); diff --git a/util/int/segment.c b/util/int/segment.c index b377774a00..f9e37fa127 100644 --- a/util/int/segment.c +++ b/util/int/segment.c @@ -23,9 +23,9 @@ #define DATA_SEGMENT -2 #define HEAP_SEGMENT -1 -PRIVATE ptr* AB_list; -PRIVATE size frame_limit; -PRIVATE size curr_frame; +static ptr* AB_list; +static size frame_limit; +static size curr_frame; /** Allocate space for AB_list & initialize frame variables */ void init_AB_list(void) @@ -56,7 +56,7 @@ void pop_frames(void) int ptr2seg(ptr p) { - register int s; + int s; if (in_gda(p)) { diff --git a/util/int/stack.c b/util/int/stack.c index 5e255b27ca..4dc130cc99 100644 --- a/util/int/stack.c +++ b/util/int/stack.c @@ -29,10 +29,10 @@ extern size maxstack; /* from main.c */ #ifdef LOGGING char* stack_sh; /* stadowbytes */ char* stackML_sh; /* speed up access of stadowbytes */ -PRIVATE void st_clear_area(ptr, ptr); +static void st_clear_area(ptr, ptr); #endif /* LOGGING */ -PRIVATE void warn_stbits(ptr, size); +static void warn_stbits(ptr, size); /** Initialize and allocate the operand stack space "stack". */ void init_stack(void) @@ -69,7 +69,7 @@ void init_stack(void) */ void newSP(ptr ap) { - register ptr p = ap; + ptr p = ap; LOG(("@s6 newSP(%lu), ML = %lu, SP = %lu", p, ML, SP)); if (LB < p) @@ -98,7 +98,7 @@ void newSP(ptr ap) if (p < SL) { /* extend stack space */ - register size stacksize = ML + 1 - p; + size stacksize = ML + 1 - p; stacksize = allocfrac(stacksize); SL = ML + 1 - stacksize; @@ -122,7 +122,7 @@ void newSP(ptr ap) */ void incSP(size n) { - register ptr p = SP - n; + ptr p = SP - n; if (p < HP || maxstack || p < SL) newSP(p); @@ -149,7 +149,7 @@ void incSP(size n) */ void decSP(size n) { - register ptr p = SP + n; + ptr p = SP + n; if (LB < p) newSP(p); @@ -193,10 +193,10 @@ void newLB(ptr p) /** Store data pointer "ap" in stack at address "addr". * Full validation is done on "addr" before storing into it. */ -void st_stdp(register ptr addr, ptr ap) +void st_stdp(ptr addr, ptr ap) { - register int i; - register long p = (long)ap; + int i; + long p = (long)ap; LOG(("@s6 st_stdp(%lu, %lu)", addr, p)); ch_in_stack(addr, psize); @@ -213,10 +213,10 @@ void st_stdp(register ptr addr, ptr ap) /** Store code pointer "ap" in stack address "addr". * Full validation is done on "addr" before storing into it. */ -void st_stip(register ptr addr, ptr ap) +void st_stip(ptr addr, ptr ap) { - register int i; - register long p = (long)ap; + int i; + long p = (long)ap; LOG(("@s6 st_stip(%lu, %lu)", addr, p)); ch_in_stack(addr, psize); @@ -233,10 +233,10 @@ void st_stip(register ptr addr, ptr ap) /** Store an integer value "al" of "n" bytes in size in stack at address "addr". * Full validation is done on "addr" before storing into it. */ -void st_stn(register ptr addr, long al, size n) +void st_stn(ptr addr, long al, size n) { - register int i; - register long l = al; + int i; + long l = al; #ifdef LOGGING /* a psize zero is ambiguous */ int sh_flags = (l == 0 && n == psize) ? (SH_INT | SH_DATAP) : SH_INT; @@ -261,10 +261,10 @@ void st_stn(register ptr addr, long al, size n) /** Store an integer value "al" of word size bytes in stack at address "addr". * Full validation is done on "addr" before storing into it. */ -void st_stw(register ptr addr, long al) +void st_stw(ptr addr, long al) { - register int i; - register long l = al; + int i; + long l = al; #ifdef LOGGING /* a psize zero is ambiguous */ int sh_flags = (l == 0 && wsize == psize) ? (SH_INT | SH_DATAP) : SH_INT; @@ -290,11 +290,11 @@ void st_stw(register ptr addr, long al) /** Store a real value "f" of "n" bytes in size in stack at address "addr". * Full validation is done on "addr" before storing into it. */ -void st_stf(register ptr addr, double f, size n) +void st_stf(ptr addr, double f, size n) { - register char* cp = (char*)&f; + char* cp = (char*)&f; float fl; - register int i; + int i; LOG(("@s6 st_stf(%lu, %g, %lu)", addr, f, n)); ch_in_stack(addr, n); @@ -330,9 +330,9 @@ void st_stf(register ptr addr, double f, size n) /** Loads and returns a data pointer stored on the stack * at address "addr". */ -ptr st_lddp(register ptr addr) +ptr st_lddp(ptr addr) { - register ptr p; + ptr p; LOG(("@s6 st_lddp(%lu)", addr)); @@ -354,9 +354,9 @@ ptr st_lddp(register ptr addr) /** Loads and returns a core pointer stored on the stack * at address "addr". */ -ptr st_ldip(register ptr addr) +ptr st_ldip(ptr addr) { - register ptr p; + ptr p; LOG(("@s6 st_ldip(%lu)", addr)); @@ -379,10 +379,10 @@ ptr st_ldip(register ptr addr) * "n" bytes in size stored in the stack at address * "addr". */ -unsigned long st_ldu(register ptr addr, size n) +unsigned long st_ldu(ptr addr, size n) { - register int i; - register unsigned long u = 0; + int i; + unsigned long u = 0; LOG(("@s6 st_ldu(%lu, %lu)", addr, n)); @@ -409,10 +409,10 @@ unsigned long st_ldu(register ptr addr, size n) * word size bytes stored in the stack at address * "addr". */ -unsigned long st_lduw(register ptr addr) +unsigned long st_lduw(ptr addr) { - register int i; - register unsigned long u = 0; + int i; + unsigned long u = 0; LOG(("@s6 st_lduw(%lu)", addr)); @@ -439,10 +439,10 @@ unsigned long st_lduw(register ptr addr) * "n" bytes in size stored in the stack at address * "addr". */ -long st_lds(register ptr addr, size n) +long st_lds(ptr addr, size n) { - register int i; - register long l; + int i; + long l; LOG(("@s6 st_lds(%lu, %lu)", addr, n)); @@ -470,10 +470,10 @@ long st_lds(register ptr addr, size n) * word size bytes stored in the stack at address * "addr". */ -long st_ldsw(register ptr addr) +long st_ldsw(ptr addr) { - register int i; - register long l; + int i; + long l; LOG(("@s6 st_ldsw(%lu)", addr)); @@ -501,12 +501,12 @@ long st_ldsw(register ptr addr) /** Loads and returns a real value of "n" bytes * stored in the stack at address "addr". */ -double st_ldf(register ptr addr, size n) +double st_ldf(ptr addr, size n) { double f; float fl; - register char* cp; - register int i; + char* cp; + int i; LOG(("@s6 st_ldf(%lu, %lu)", addr, n)); @@ -560,10 +560,10 @@ double st_ldf(register ptr addr, size n) /** Moves "n" bytes from stack address "s1" to * stack address "s2". */ -void st_mvs(register ptr s2, register ptr s1, size n) +void st_mvs(ptr s2, ptr s1, size n) /* s1 -> s2 */ { - register int i; + int i; ch_in_stack(s1, n); ch_wordaligned(s1); @@ -587,7 +587,7 @@ void st_mvs(register ptr s2, register ptr s1, size n) void st_mvd(ptr s, ptr d, size n) /* d -> s */ { - register int i; + int i; ch_in_data(d, n); ch_wordaligned(d); @@ -625,7 +625,7 @@ void st_mvd(ptr s, ptr d, size n) /** Pop and return as a data pointer from the stack. */ ptr dppop(void) { - register ptr p; + ptr p; p = st_lddp(SP); decSP(psize); @@ -636,7 +636,7 @@ ptr dppop(void) /** Pop and return as an unsigned integer "n" bytes from the stack. */ unsigned long upop(size n) { - register unsigned long l; + unsigned long l; l = st_ldu(SP, n); decSP(max(n, wsize)); @@ -647,7 +647,7 @@ unsigned long upop(size n) /** Pop and return a word size unsigned integer from the stack. */ unsigned long uwpop(void) { - register unsigned long l; + unsigned long l; l = st_lduw(SP); decSP(wsize); @@ -658,7 +658,7 @@ unsigned long uwpop(void) /** Pop and return as an integer "n" bytes from the stack. */ long spop(size n) { - register long l; + long l; l = st_lds(SP, n); decSP(max(n, wsize)); @@ -669,7 +669,7 @@ long spop(size n) /** Pop and return a word size signed integer from the stack. */ long swpop(void) { - register long l; + long l; l = st_ldsw(SP); decSP(wsize); @@ -736,7 +736,7 @@ double fpop(size n) /** Pop a word size value, independently of its type. */ long wpop(void) { - register long l; + long l; l = w_in_stack(SP); decSP(wsize); @@ -773,7 +773,7 @@ void wpush(long l) } /** Push "n" bytes from value "l" unto the stack. */ -void npush(register long l, register size n) +void npush(long l, size n) { if (n <= wsize) { @@ -852,10 +852,10 @@ void fpush(double f, size n) #ifdef LOGGING -PRIVATE void warn_stbits(ptr addr, size n) +static void warn_stbits(ptr addr, size n) { - register int or_bits = 0; - register int and_bits = 0xff; + int or_bits = 0; + int and_bits = 0xff; while (n--) { @@ -882,10 +882,10 @@ PRIVATE void warn_stbits(ptr addr, size n) warningcont(WWASINSP); } -PRIVATE void st_clear_area(ptr from, ptr to) +static void st_clear_area(ptr from, ptr to) { /* includes both *from and *to (since ML+1 is unexpressible) */ - register ptr a; + ptr a; for (a = from; a >= to; a--) { diff --git a/util/int/stack.h b/util/int/stack.h index 517edadd0b..5c700010cd 100644 --- a/util/int/stack.h +++ b/util/int/stack.h @@ -15,19 +15,19 @@ void newSP(ptr ap); void incSP(size n); void decSP(size n); void newLB(ptr p); -void st_stdp(register ptr addr, ptr ap); -void st_stip(register ptr addr, ptr ap); -void st_stn(register ptr addr, long al, size n); -void st_stw(register ptr addr, long al); -void st_stf(register ptr addr, double f, size n); -ptr st_lddp(register ptr addr); -ptr st_ldip(register ptr addr); -unsigned long st_ldu(register ptr addr, size n); -unsigned long st_lduw(register ptr addr); -long st_lds(register ptr addr, size n); -long st_ldsw(register ptr addr); -double st_ldf(register ptr addr, size n); -void st_mvs(register ptr s2, register ptr s1, size n); +void st_stdp(ptr addr, ptr ap); +void st_stip(ptr addr, ptr ap); +void st_stn(ptr addr, long al, size n); +void st_stw(ptr addr, long al); +void st_stf(ptr addr, double f, size n); +ptr st_lddp(ptr addr); +ptr st_ldip(ptr addr); +unsigned long st_ldu(ptr addr, size n); +unsigned long st_lduw(ptr addr); +long st_lds(ptr addr, size n); +long st_ldsw(ptr addr); +double st_ldf(ptr addr, size n); +void st_mvs(ptr s2, ptr s1, size n); void st_mvd(ptr s, ptr d, size n); ptr dppop(void); unsigned long upop(size n); @@ -42,7 +42,7 @@ double fpop(size n); long wpop(void); void dppush(ptr p); void wpush(long l); -void npush(register long l, register size n); +void npush(long l, size n); void push_dt(ptr d, size n); void pushw_dt(ptr d); void push_st(ptr s, size n); diff --git a/util/int/tally.c b/util/int/tally.c index bd4206f920..18c29089d8 100644 --- a/util/int/tally.c +++ b/util/int/tally.c @@ -25,16 +25,16 @@ struct file_tally struct line_tally* ft_line; /* pointer to line array */ }; -PRIVATE struct file_tally* first_tally; /* start of chain */ -PRIVATE struct file_tally* file; /* present file */ +static struct file_tally* first_tally; /* start of chain */ +static struct file_tally* file; /* present file */ -PRIVATE long lastLIN; +static long lastLIN; -PRIVATE FILE* tally_fp; +static FILE* tally_fp; /* Forward declarations. */ -PRIVATE void tally_newFIL(ptr); -PRIVATE void enlarge(struct file_tally*, long); +static void tally_newFIL(ptr); +static void enlarge(struct file_tally*, long); void tally(void) { @@ -59,7 +59,7 @@ void tally(void) file->ft_line[LIN].lt_instr++; } -PRIVATE void tally_newFIL(ptr f) +static void tally_newFIL(ptr f) { struct file_tally** hook = &first_tally; @@ -90,7 +90,7 @@ PRIVATE void tally_newFIL(ptr f) file = *hook; } -PRIVATE void enlarge(struct file_tally* ft, long l) +static void enlarge(struct file_tally* ft, long l) { long limit = allocfrac(l < 100 ? 100 : l); @@ -120,7 +120,7 @@ void out_tally(void) while (*hook) { struct file_tally* ft = *hook; - register long i; + long i; fprintf(tally_fp, "%s:\n", dt_fname(ft->ft_fil)); for (i = 0; i < ft->ft_limit; i++) diff --git a/util/int/test/ioc0.c b/util/int/test/ioc0.c index 2de4355eba..a594ede93f 100644 --- a/util/int/test/ioc0.c +++ b/util/int/test/ioc0.c @@ -8,7 +8,7 @@ struct sgttyb old, ttyb; main() { - register i = 0; + i = 0; char c; if( ioctl( 1, TIOCGETP, &old ) != 0 ) { diff --git a/util/int/text.c b/util/int/text.c index b70acf677c..998e6061ae 100644 --- a/util/int/text.c +++ b/util/int/text.c @@ -30,9 +30,9 @@ void init_text(void) * * ************************************************************************/ -void newPC(register ptr p) +void newPC(ptr p) { - register struct proc* pr = &proctab[PI]; + struct proc* pr = &proctab[PI]; if (p >= DB) { diff --git a/util/int/text.h b/util/int/text.h index b2ea623181..563a16edd5 100644 --- a/util/int/text.h +++ b/util/int/text.h @@ -107,4 +107,4 @@ void init_text(void); /* Sets the new value of the PC register to the specified * value "p". */ -void newPC(register ptr p); +void newPC(ptr p); diff --git a/util/int/trap.c b/util/int/trap.c index b313b4866f..9925ba7db2 100644 --- a/util/int/trap.c +++ b/util/int/trap.c @@ -25,9 +25,9 @@ extern jmp_buf trapbuf; /* from main.c */ int must_test; /* TEST-bit on in EM header word 2 */ int signalled; -PRIVATE int nonreturnable(int nr); +static int nonreturnable(int nr); -PRIVATE char* trap_msg[] = { +static char* trap_msg[] = { #include "trap_msg" /* generated from $(EM)/etc/traps */ "" }; @@ -60,7 +60,7 @@ void do_trap(int nr, int L, char* F) static int rec_nr; /* Recursive trap number */ static int rec_trap = 0; /* To detect traps inside do_trap() */ - register long tpi; /* Trap Procedure Identifier */ + long tpi; /* Trap Procedure Identifier */ LOG(("@t1 trap(%d) [%s: %d]", nr, F, L)); warning(WMSG + nr); @@ -102,7 +102,7 @@ void do_trap(int nr, int L, char* F) } } -PRIVATE int nonreturnable(int nr) +static int nonreturnable(int nr) { switch (nr) { diff --git a/util/int/warn.c b/util/int/warn.c index 047e97180c..0bdca38e97 100644 --- a/util/int/warn.c +++ b/util/int/warn.c @@ -26,17 +26,17 @@ struct warn_msg #define WMASK 0x5555 /* powers of 4 */ -PRIVATE struct warn_msg warn_msg[] = { +static struct warn_msg warn_msg[] = { #include "warn_msg" /* generated from $(EM)/doc/int */ { 0, 0 } /* sentinel */ }; -PRIVATE char* warn_text[WMSG + 1]; +static char* warn_text[WMSG + 1]; void init_wmsg(void) { - register int i; - register struct warn_msg* wmsg; + int i; + struct warn_msg* wmsg; for (i = 0; i <= WMSG; i++) { @@ -59,16 +59,16 @@ struct warn_cnt long wc_cnt; /* the counter */ }; -PRIVATE struct warn_cnt* warn_cnt[WMSG]; -PRIVATE char warnmask[WMSG]; +static struct warn_cnt* warn_cnt[WMSG]; +static char warnmask[WMSG]; -PRIVATE long count_wrn(int nr) +static long count_wrn(int nr) { /* returns the occurrence counter for the warning with number nr; keeps track of the warnings, sorted by warning number, file name and line number. */ - register struct warn_cnt** warn_hook = &warn_cnt[nr]; - register struct warn_cnt* wrn; + struct warn_cnt** warn_hook = &warn_cnt[nr]; + struct warn_cnt* wrn; while ((wrn = *warn_hook)) { @@ -97,7 +97,7 @@ PRIVATE long count_wrn(int nr) #define wmask_on(i) (warnmask[i]) -PRIVATE int latest_warning_printed; /* set if ... */ +static int latest_warning_printed; /* set if ... */ /*ARGSUSED*/ void do_warn(int nr, int L, const char* F) @@ -107,8 +107,8 @@ void do_warn(int nr, int L, const char* F) { if (!wmask_on(nr)) { - register long wrn_cnt = count_wrn(nr); - register char* wmsgtxt = warn_text[nr]; + long wrn_cnt = count_wrn(nr); + char* wmsgtxt = warn_text[nr]; LOG(("@w1 warning: %s [%s: %d]", wmsgtxt, F, L)); if (/* wrn_cnt is a power of two */ @@ -139,7 +139,7 @@ void warningcont(int nr) { if (!wmask_on(nr)) { - register char* wmsgtxt = warn_text[nr]; + char* wmsgtxt = warn_text[nr]; LOG(("@w1 warning cont.: %s", wmsgtxt)); fprintf(mess_fp, "(Warning %d, cont.): %s at %s\n", nr, wmsgtxt, position()); diff --git a/util/led/archive.c b/util/led/archive.c index 1937010b76..9608c6dbe0 100644 --- a/util/led/archive.c +++ b/util/led/archive.c @@ -41,10 +41,10 @@ void notelib(long pos); */ static long getsymdeftable(void) { - register ind_t off; - register struct ranlib* ran; - register long count; - register long nran, nchar; + ind_t off; + struct ranlib* ran; + long count; + long nran, nchar; extern FILE* infile; count = nran = rd_int4(infile); @@ -99,8 +99,8 @@ void arch(void) savemagic(); do { - register ind_t ranindex; - register long count; + ind_t ranindex; + long count; debug("(re)scan ranlib table\n", 0, 0, 0, 0); ranindex = (ind_t)0; @@ -108,10 +108,10 @@ void arch(void) resolved = FALSE; while (count > 0) { - register struct ranlib* ran; - register char* string; - register struct outname* name; - register long pos; + struct ranlib* ran; + char* string; + struct outname* name; + long pos; ran = (struct ranlib*)address(ALLORANL, ranindex); string = address(ALLORANL, (ind_t)ran->ran_off); @@ -156,7 +156,7 @@ void arch(void) */ void notelib(long pos) { - register ind_t off; + ind_t off; if ((off = hard_alloc(ALLOARCH, sizeof(long))) == BADOFF) fatal("no space for archive position"); @@ -177,8 +177,8 @@ static ind_t posindex = (ind_t)0; */ void arch2(void) { - register long* pos; - register ind_t localpos; + long* pos; + ind_t localpos; localpos = posindex; for (pos = (long*)address(ALLOARCH, localpos); *pos != ENDLIB; pos++, localpos += sizeof(long)) diff --git a/util/led/extract.c b/util/led/extract.c index 8fdcf9bb75..8d392ffbbf 100644 --- a/util/led/extract.c +++ b/util/led/extract.c @@ -22,12 +22,12 @@ static char rcsid[] = "$Id$"; #include "error.h" #include "extract.h" -static void getexternal(register struct outname*); -static void get_names(register struct outhead*); -static void process(register struct outhead*); -static void redefine(register struct outname*, register struct outname*); -static void transfer(register struct outname*, register struct outname*); -static void process(register struct outhead*); +static void getexternal(struct outname*); +static void get_names(struct outhead*); +static void process(struct outhead*); +static void redefine(struct outname*, struct outname*); +static void transfer(struct outname*, struct outname*); +static void process(struct outhead*); extern struct orig relorig[]; @@ -54,11 +54,11 @@ void extract(void) * appear in the final output file if this module is linked. * That number will be returned. */ -static void get_names(register struct outhead* head) +static void get_names(struct outhead* head) { - register int nnames; - register ind_t nameindex, charindex; - register ind_t charoff; + int nnames; + ind_t nameindex, charindex; + ind_t charoff; extern int flagword; nnames = head->oh_nname; @@ -113,12 +113,12 @@ static void get_names(register struct outhead* head) } } -static void process(register struct outhead* head) +static void process(struct outhead* head) { - register struct outsect* sects; - register struct outsect* outsp; - register int nsect; - register struct orig* orig = relorig; + struct outsect* sects; + struct outsect* outsp; + int nsect; + struct orig* orig = relorig; extern struct outhead outhead; extern struct outsect outsect[]; @@ -160,10 +160,10 @@ static void process(register struct outhead* head) * Otherwise we just add the accumulated size of all normal parts in preceding * sections with the same size. */ -void namerelocate(register struct outname* name) +void namerelocate(struct outname* name) { - register int type = name->on_type; - register int sct = type & S_TYP; + int type = name->on_type; + int sct = type & S_TYP; if (sct == S_UND || sct == S_ABS || sct == S_CRS) return; @@ -182,11 +182,11 @@ void namerelocate(register struct outname* name) * we might need it later on. Otherwise it must confirm to what we already * know about it, and eventually add to that knowledge. */ -static void getexternal(register struct outname* name) +static void getexternal(struct outname* name) { - register char* string; - register int h; - register struct outname* old; + char* string; + int h; + struct outname* old; string = modulptr((ind_t)name->on_foff); h = hash(string); @@ -227,7 +227,7 @@ static void getexternal(register struct outname* name) * greatest value so that the common declared name always has enough space. * If a common is defined as a not-common, the old definition is ignored. */ -static void redefine(register struct outname* new, register struct outname* old) +static void redefine(struct outname* new, struct outname* old) { if (!ISCOMMON(old)) { @@ -259,7 +259,7 @@ static void redefine(register struct outname* new, register struct outname* old) /* * Transfer things we want to know from `src' to `dst'. */ -static void transfer(register struct outname* src, register struct outname* dst) +static void transfer(struct outname* src, struct outname* dst) { debug("%s defined here\n", src->on_mptr, 0, 0, 0); dst->on_valu = src->on_valu; diff --git a/util/led/extract.h b/util/led/extract.h index 08d440582b..f126cfb594 100644 --- a/util/led/extract.h +++ b/util/led/extract.h @@ -18,6 +18,6 @@ void extract(void); * Otherwise we just add the accumulated size of all normal parts in preceding * sections with the same size. */ -void namerelocate(register struct outname* name); +void namerelocate(struct outname* name); #endif /* __EXTRACT_H_INCLUDED___ */ diff --git a/util/led/finish.c b/util/led/finish.c index 776c438fd2..4513adb2ae 100644 --- a/util/led/finish.c +++ b/util/led/finish.c @@ -28,10 +28,10 @@ extern bool incore; extern unsigned short NLocals; extern int flagword; -static void adjust_names(register struct outname*, struct outhead*, register char*); +static void adjust_names(struct outname*, struct outhead*, char*); static void handle_relos(struct outhead*, struct outsect*, struct outname*); -static void put_locals(struct outname*, register unsigned int); -static void compute_origins(register struct outsect*, register unsigned int); +static void put_locals(struct outname*, unsigned int); +static void compute_origins(struct outsect*, unsigned int); /* * We know all there is to know about the current module. @@ -67,11 +67,11 @@ void finish(void) /* * Adjust all local names for the move into core. */ -static void adjust_names(register struct outname* name, struct outhead* head, register char* chars) +static void adjust_names(struct outname* name, struct outhead* head, char* chars) { - register int cnt; - register long charoff; + int cnt; + long charoff; struct outname* base = name; cnt = head->oh_nname; @@ -90,7 +90,7 @@ static void adjust_names(register struct outname* name, struct outhead* head, re void do_crs(struct outname* base, unsigned int count) { - register struct outname* name = base; + struct outname* name = base; while (count--) { @@ -125,10 +125,10 @@ void do_crs(struct outname* base, unsigned int count) */ static void handle_relos(struct outhead* head, struct outsect* sects, struct outname* names) { - register struct outrelo* relo; - register int sectindex; - register int nrelo; - register char* emit; + struct outrelo* relo; + int sectindex; + int nrelo; + char* emit; static long zeros[MAXSECT]; if (incore) @@ -221,11 +221,11 @@ static void handle_relos(struct outhead* head, struct outsect* sects, struct out /* * Write out the local names that must be saved. */ -static void put_locals(struct outname* name, register unsigned int nnames) +static void put_locals(struct outname* name, unsigned int nnames) { - register struct outname* oname = name; - register struct outname* iname = oname; + struct outname* oname = name; + struct outname* iname = oname; while (nnames--) { @@ -245,10 +245,10 @@ static void put_locals(struct outname* name, register unsigned int nnames) * Add all flen's and all (size - flen == zero)'s of preceding sections * with the same number. */ -static void compute_origins(register struct outsect* sect, register unsigned int nsect) +static void compute_origins(struct outsect* sect, unsigned int nsect) { extern struct orig relorig[]; - register struct orig* orig = relorig; + struct orig* orig = relorig; while (nsect--) { @@ -267,8 +267,8 @@ static void compute_origins(register struct outsect* sect, register unsigned int static void put_dbug(long offdbug) { char buf[512]; - register int nbytes; - register long dbugsize; + int nbytes; + long dbugsize; extern long objectsize; dbugsize = objectsize - offdbug; diff --git a/util/led/main.c b/util/led/main.c index 7331efac68..8daf6633a0 100644 --- a/util/led/main.c +++ b/util/led/main.c @@ -80,7 +80,7 @@ int main(int argc, char** argv) #ifndef NOSTATISTICS static void do_statistics(void) { - register struct memory* m = mems; + struct memory* m = mems; while (m <= &mems[NMEMS - 1]) { @@ -126,9 +126,9 @@ int exitstatus = 0; * If the argument starts with a '-', it's a flag, else it is either * a plain file to be loaded, or an archive. */ -static void first_pass(register char** argv) +static void first_pass(char** argv) { - register char* argp; + char* argp; int sectno; int h; @@ -260,9 +260,9 @@ static void first_pass(register char** argv) */ static uint32_t number(const char* s) { - register int digit; - register uint32_t value = 0; - register int radix = 10; + int digit; + uint32_t value = 0; + int radix = 10; if (*s == '0') { @@ -412,9 +412,9 @@ long sect_comm[MAXSECT]; */ static void norm_commons(void) { - register struct outname* name; - register int cnt; - register int und = FALSE; + struct outname* name; + int cnt; + int und = FALSE; name = (struct outname*)address(ALLOGLOB, (ind_t)0); cnt = NGlobals; @@ -453,8 +453,8 @@ static void norm_commons(void) { if (!ISABSOLUTE(name) && ISCOMMON(name)) { - register long size; - register int sectindex; + long size; + int sectindex; size = name->on_valu; /* XXX rounding? */ sectindex = (name->on_type & S_TYP) - S_MIN; @@ -474,10 +474,10 @@ struct orig relorig[MAXSECT]; */ static void complete_sections(void) { - register uint32_t base = 0; - register uint32_t foff; - register struct outsect* sc; - register int sectindex; + uint32_t base = 0; + uint32_t foff; + struct outsect* sc; + int sectindex; foff = SZ_HEAD + outhead.oh_nsect * SZ_SECT; for (sectindex = 0; sectindex < outhead.oh_nsect; sectindex++) @@ -514,8 +514,8 @@ static void complete_sections(void) */ static void change_names(void) { - register int cnt; - register struct outname* name; + int cnt; + struct outname* name; name = (struct outname*)address(ALLOGLOB, (ind_t)0); cnt = NGlobals; @@ -546,8 +546,8 @@ static void change_names(void) */ bool setbit(int indx, char string[]) { - register int byte_index, bit_index; - register int byte; + int byte_index, bit_index; + int byte; byte_index = indx / WIDTH; /* Index of byte with bit we need. */ bit_index = indx % WIDTH; /* Index of bit we need. */ @@ -567,8 +567,8 @@ bool setbit(int indx, char string[]) */ static bool tstbit(int indx, char string[]) { - register int byte_index, bit_index; - register int byte; + int byte_index, bit_index; + int byte; byte_index = indx / WIDTH; /* Index of byte with bit we need. */ bit_index = indx % WIDTH; /* Index of bit we need. */ @@ -583,8 +583,8 @@ static bool tstbit(int indx, char string[]) */ void addbase(struct outname* name) { - register int type = name->on_type & S_TYP; - register int sectindex = type - S_MIN; + int type = name->on_type & S_TYP; + int sectindex = type - S_MIN; if (type == S_UND || type == S_ABS || type == S_CRS) return; diff --git a/util/led/memory.c b/util/led/memory.c index 5815b39216..fb573ff71f 100644 --- a/util/led/memory.c +++ b/util/led/memory.c @@ -141,9 +141,9 @@ void init_core(void) } } #else /* ifndef USEMALLOC */ - register char* base; - register ind_t total_size; - register struct memory* mem; + char* base; + ind_t total_size; + struct memory* mem; #include "mach.h" #define ALIGN 8 /* minimum alignment for pieces */ @@ -244,7 +244,7 @@ static ind_t move_up(int piece, ind_t incr) } return 0; #else /* ifndef USEMALLOC */ - register struct memory* mem; + struct memory* mem; #ifndef NOSTATISTICS extern int statistics; #endif @@ -356,8 +356,8 @@ static bool compact(int piece, ind_t incr, int flag) return TRUE; #else /* ifndef USEMALLOC */ - register ind_t gain, size; - register struct memory* mem; + ind_t gain, size; + struct memory* mem; int min = piece, max = piece; #define SHIFT_COUNT \ 2 /* let pieces only contribute if their free \ @@ -481,7 +481,7 @@ of its occupied memory if (gain < incr) { - register ind_t up = (ind_t)0; + ind_t up = (ind_t)0; for (mem = &mems[max]; mem > &mems[piece]; mem--) { @@ -527,9 +527,9 @@ of its occupied memory */ static void copy_down(struct memory* mem, ind_t dist) { - register char* old; - register char* new; - register ind_t size; + char* old; + char* new; + ind_t size; size = mem->mem_full; old = mem->mem_base; @@ -547,9 +547,9 @@ static void copy_down(struct memory* mem, ind_t dist) */ static void copy_up(struct memory* mem, ind_t dist) { - register char* old; - register char* new; - register ind_t size; + char* old; + char* new; + ind_t size; size = mem->mem_full; old = mem->mem_base + size; @@ -571,9 +571,9 @@ static int alloctype = NORMAL; */ ind_t alloc(int piece, size_t size) { - register ind_t incr = 0; + ind_t incr = 0; ind_t left = mems[piece].mem_left; - register ind_t full = mems[piece].mem_full; + ind_t full = mems[piece].mem_full; assert(passnumber == FIRST || (!incore && piece == ALLOMODL)); if (size == 0) @@ -616,8 +616,8 @@ ind_t alloc(int piece, size_t size) */ ind_t hard_alloc(int piece, size_t size) { - register ind_t ret; - register int i; + ind_t ret; + int i; if (size != (ind_t)size) return BADOFF; @@ -665,9 +665,9 @@ ind_t hard_alloc(int piece, size_t size) */ static void free_saved_moduls(void) { - register ind_t size; - register char *old, *new; - register struct memory* mem = &mems[ALLOMODL]; + ind_t size; + char *old, *new; + struct memory* mem = &mems[ALLOMODL]; size = mem->mem_full - core_position; new = mem->mem_base; @@ -698,7 +698,7 @@ void dealloc(int piece) char* core_alloc(int piece, size_t size) { - register ind_t off; + ind_t off; if ((off = alloc(piece, size)) == BADOFF) return (char*)0; @@ -720,7 +720,7 @@ void core_free(int piece, char* p) */ void freeze_core(void) { - register int i; + int i; core_position = (ind_t)0; @@ -754,7 +754,7 @@ void write_bytes(void) { unsigned short nsect; long offchar; - register struct memory* mem; + struct memory* mem; extern long NLChars, NGChars; extern int flagword; extern struct outhead outhead; diff --git a/util/led/output.c b/util/led/output.c index 5038a35fa1..719746aac2 100644 --- a/util/led/output.c +++ b/util/led/output.c @@ -65,9 +65,9 @@ void beginoutput(void) */ static void generate_section_names(void) { - register struct outname* name; - register int sectindex; - register size_t size; + struct outname* name; + int sectindex; + size_t size; extern struct outsect outsect[]; size = outhead.oh_nsect * sizeof(struct outname); diff --git a/util/led/relocate.c b/util/led/relocate.c index adf302b9ef..cc4cab0d0c 100644 --- a/util/led/relocate.c +++ b/util/led/relocate.c @@ -390,7 +390,7 @@ static void put_lis_valu(char* addr, uint32_t value, uint16_t type) uint16_t hi, lo; bool ha16; - /* ha16 flag in high bit, register in next 5 bits */ + /* ha16 flag in high bit, in next 5 bits */ opcode = read4(addr, type); ha16 = opcode >> 31; reg = (opcode >> 26) & 0x1f; @@ -501,13 +501,13 @@ static unsigned addrelo( struct outname* names, long* valu_out) { - register struct outname* local = &names[relo->or_nami]; - register unsigned short index = NLocals; - register long valu = *valu_out; + struct outname* local = &names[relo->or_nami]; + unsigned short index = NLocals; + long valu = *valu_out; if ((local->on_type & S_SCT)) { - register int sectindex = (local->on_type & S_TYP) - S_MIN; + int sectindex = (local->on_type & S_TYP) - S_MIN; valu += relorig[sectindex].org_size; valu += outsect[sectindex].os_base; @@ -515,7 +515,7 @@ static unsigned addrelo( } else { - register struct outname* name; + struct outname* name; extern struct outhead outhead; name = searchname(local->on_mptr, hash(local->on_mptr)); diff --git a/util/led/save.c b/util/led/save.c index 8eded97d33..4bcc03ae34 100644 --- a/util/led/save.c +++ b/util/led/save.c @@ -29,7 +29,7 @@ long NGChars = 0; /* Idem for global names. */ void savemagic(void) { - register char* p; + char* p; if (!incore) return; @@ -43,7 +43,7 @@ void savemagic(void) void savehdr(struct ar_hdr* hdr) { - register char* p; + char* p; if (!incore) return; @@ -60,10 +60,10 @@ void savehdr(struct ar_hdr* hdr) * Return its offset in this area. We don't use the first char of the string * area, so that empty strings can be distinguished from the first string. */ -ind_t savechar(register int piece, register ind_t off) +ind_t savechar(int piece, ind_t off) { - register size_t len; - register ind_t newoff; + size_t len; + ind_t newoff; if (off == (ind_t)0) return 0; diff --git a/util/led/scan.c b/util/led/scan.c index e0ef0e6ea5..3a098add89 100644 --- a/util/led/scan.c +++ b/util/led/scan.c @@ -220,7 +220,7 @@ static bool all_alloc(void) static bool direct_alloc(struct outhead* head) { ind_t sectindex = IND_SECT(*head); - register struct outsect* sects; + struct outsect* sects; unsigned short nsect = head->oh_nsect; size_t size, rest; @@ -256,7 +256,7 @@ static bool direct_alloc(struct outhead* head) */ static bool indirect_alloc(struct outhead* head) { - register int allopiece; + int allopiece; unsigned short nsect = head->oh_nsect; unsigned short nrelo = head->oh_nrelo; ind_t sectindex = IND_SECT(*head); @@ -294,7 +294,7 @@ static bool putemitindex(ind_t sectindex, ind_t emitoff, int allopiece) long flen; ind_t emitindex; static long zeros[MAXSECT]; - register long zero = zeros[allopiece - ALLOEMIT]; + long zero = zeros[allopiece - ALLOEMIT]; /* * Notice that "sectindex" is not a section number! @@ -310,7 +310,7 @@ static bool putemitindex(ind_t sectindex, ind_t emitoff, int allopiece) return FALSE; if ((emitindex = alloc(allopiece, zero)) != BADOFF) { - register char* p = address(allopiece, emitindex); + char* p = address(allopiece, emitindex); debug("Zeros %ld\n", zero, 0, 0, 0); while (zero--) @@ -369,9 +369,9 @@ static bool putdbugindex(ind_t dbugoff, size_t ndbugbytes) */ static void get_indirect(struct outhead* head, struct outsect* sect) { - register ind_t* emitindex; - register int nsect; - register int piece; + ind_t* emitindex; + int nsect; + int piece; ind_t* reloindex; emitindex = (ind_t*)modulptr(IND_EMIT(*head)); @@ -404,7 +404,7 @@ void seek(long pos) */ void skip_modul(struct outhead* head) { - register ind_t skip = modulsize(head); + ind_t skip = modulsize(head); if (incore) { @@ -425,7 +425,7 @@ void skip_modul(struct outhead* head) static void read_modul(void) { struct outhead* head; - register struct outsect* sects; + struct outsect* sects; struct outname* names; char* chars; ind_t sectindex, nameindex, charindex; diff --git a/util/led/sym.c b/util/led/sym.c index e73b1cb406..ce1f2677ec 100644 --- a/util/led/sym.c +++ b/util/led/sym.c @@ -46,7 +46,7 @@ unsigned short NGlobals = 0; /* Number of global names. */ */ void init_symboltable(void) { - register ind_t* rap; + ind_t* rap; for (rap = hashtable; rap < &hashtable[NHASH]; rap++) *rap = BADOFF; @@ -61,11 +61,11 @@ void init_symboltable(void) */ struct outname* searchname(char* string, int hashval) { - register char* rcp; - register char* namestring; - register ind_t symindex; - register struct outname* name; - register struct symbol* sym; + char* rcp; + char* namestring; + ind_t symindex; + struct outname* name; + struct symbol* sym; symindex = hashtable[hashval]; debug("looking for %s %d %z:", string, hashval, (size_t)hashtable[hashval], 0); @@ -102,7 +102,7 @@ void entername(struct outname* name, int hashval) ind_t savindex; ind_t symindex; ind_t namindex; - register struct symbol* sym; + struct symbol* sym; struct outname* newname; debug( @@ -138,10 +138,10 @@ unsigned int indexof(struct outname* name) * 0 <= hash(p) < NHASH, so it can - and will - be used * as index in a hash table. */ -int hash(register char* p) +int hash(char* p) { - register unsigned short h = 0; - register int c; + unsigned short h = 0; + int c; while ((c = *p++) != '\0') { diff --git a/util/led/sym.h b/util/led/sym.h index 8b03c15fd2..b680570449 100644 --- a/util/led/sym.h +++ b/util/led/sym.h @@ -10,7 +10,7 @@ void entername(struct outname* name, int hashval); /** Initialize the symbol table. All indices should be noticeably invalid. */ void init_symboltable(void); /** Return the hash value of the string represented in p. */ -int hash(register char* p); +int hash(char* p); /** Return the index of `name' in the symbol table. */ unsigned int indexof(struct outname* name); /* diff --git a/util/led/write.c b/util/led/write.c index a91c9d3bd7..34b869e977 100644 --- a/util/led/write.c +++ b/util/led/write.c @@ -39,7 +39,7 @@ void wr_fatal(void) */ void begin_write(void) { - register struct outhead* hd = &outhead; + struct outhead* hd = &outhead; assert(!incore); wr_ohead(hd); @@ -64,8 +64,8 @@ static struct outname* sectname(int sectindex) */ void end_write(void) { - register struct outname* name; - register int sectindex; + struct outname* name; + int sectindex; extern long NGChars; assert(!incore); @@ -87,26 +87,26 @@ void wrt_emit(char* emit, int sectindex, long cnt) wr_emit(emit, cnt); } -void wrt_nulls(int sectindex, register long cnt) +void wrt_nulls(int sectindex, long cnt) { static char nullbuf[BUFSIZ]; wr_outsect(sectindex); while (cnt) { - register int n = cnt >= BUFSIZ ? BUFSIZ : cnt; + int n = cnt >= BUFSIZ ? BUFSIZ : cnt; wr_emit(nullbuf, (long)n); cnt -= n; } } -void wrt_name(register struct outname* name, int writename) +void wrt_name(struct outname* name, int writename) { assert(!incore); assert(!(flagword & SFLAG)); if (name->on_mptr != (char*)0) { - register long len = strlen(name->on_mptr) + 1; + long len = strlen(name->on_mptr) + 1; wr_string(name->on_mptr, len); name->on_foff = off_char; diff --git a/util/make/check.c b/util/make/check.c index c588e624f5..765bd6d0f7 100644 --- a/util/make/check.c +++ b/util/make/check.c @@ -12,8 +12,8 @@ */ static void check(struct name *np) { - register struct depend * dp; - register struct line * lp; + struct depend * dp; + struct line * lp; if (np->n_flag & N_MARK) fatal("Circular dependency from %s", np->n_name); @@ -34,11 +34,11 @@ static void check(struct name *np) */ void prt(void) { - register struct name * np; - register struct depend * dp; - register struct line * lp; - register struct cmd * cp; - register struct macro * mp; + struct name * np; + struct depend * dp; + struct line * lp; + struct cmd * cp; + struct macro * mp; for (mp = macrohead; mp; mp = mp->m_next) fprintf(stderr, "%s = %s\n", mp->m_name, mp->m_val); @@ -78,7 +78,7 @@ void prt(void) */ void circh(void) { - register struct name * np; + struct name * np; for (np = namehead.n_next; np; np = np->n_next) check(np); @@ -89,9 +89,9 @@ void circh(void) */ void precious(void) { - register struct depend * dp; - register struct line * lp; - register struct name * np; + struct depend * dp; + struct line * lp; + struct name * np; if (!((np = newname(".PRECIOUS"))->n_flag & N_TARG)) return; diff --git a/util/make/input.c b/util/make/input.c index 613c33bad9..573fdb3480 100644 --- a/util/make/input.c +++ b/util/make/input.c @@ -22,9 +22,9 @@ char str2[LZ]; struct name *newname(char *name) { - register struct name * rp; - register struct name * rrp; - register char * cp; + struct name * rp; + struct name * rrp; + char * cp; for (rp = namehead.n_next, rrp = &namehead; rp; rp = rp->n_next, rrp = rrp->n_next) @@ -52,8 +52,8 @@ struct name *newname(char *name) */ struct depend *newdep(struct name *np, struct depend *dp) { - register struct depend * rp; - register struct depend * rrp; + struct depend * rp; + struct depend * rrp; if ((rp = (struct depend *) malloc(sizeof(struct depend))) == (struct depend *) 0) @@ -78,9 +78,9 @@ struct depend *newdep(struct name *np, struct depend *dp) */ struct cmd *newcmd(char *str, struct cmd *cp) { - register struct cmd * rp; - register struct cmd * rrp; - register char * rcp; + struct cmd * rp; + struct cmd * rrp; + char * rcp; if ((rcp = strrchr(str, '\n'))) *rcp = '\0'; /* Loose newline */ @@ -127,8 +127,8 @@ struct cmd *newcmd(char *str, struct cmd *cp) void newline(struct name *np, struct depend *dp, struct cmd *cp, int flag) { bool hascmds = FALSE; /* Target has commands */ - register struct line * rp; - register struct line * rrp; + struct line * rp; + struct line * rrp; /* Handle the .SUFFIXES case */ if (!strcmp(np->n_name, ".SUFFIXES") && !dp && !cp) @@ -207,7 +207,7 @@ void input(FILE *fd) while (((q = strchr(p, '=')) != (char *) 0) && (p != q) && (q[-1] == '\\')) /* Find value */ { - register char * a; + char * a; a = q - 1; /* Del \ chr; move rest back */ p = q; @@ -217,7 +217,7 @@ void input(FILE *fd) if (q != (char *) 0) { - register char * a; + char * a; *q++ = '\0'; /* Separate name and val */ while (isspace(*q)) @@ -242,7 +242,7 @@ void input(FILE *fd) while (((q = strchr(p, ':')) != (char *) 0) && (p != q) && (q[-1] == '\\')) /* Find dependents */ { - register char * a; + char * a; a = q - 1; /* Del \ chr; move rest back */ p = q; diff --git a/util/make/macro.c b/util/make/macro.c index 160996ed78..fafa6f715a 100644 --- a/util/make/macro.c +++ b/util/make/macro.c @@ -16,7 +16,7 @@ struct macro * macrohead; static struct macro *getmp(char *name) { - register struct macro * rp; + struct macro * rp; for (rp = macrohead; rp; rp = rp->m_next) if (strcmp(name, rp->m_name) == 0) @@ -38,8 +38,8 @@ char * getmacro(char* name) struct macro * setmacro(char* name, char* val, int prio) { - register struct macro * rp; - register char * cp; + struct macro * rp; + char * cp; /* Replace macro definition if it exists */ @@ -84,10 +84,10 @@ struct macro * setmacro(char* name, char* val, int prio) */ static void doexp(char **to, char* from, int* len, char* buf) { - register char * rp; - register char * p; - register char * q; - register struct macro * mp; + char * rp; + char * p; + char * q; + struct macro * mp; rp = from; diff --git a/util/make/main.c b/util/make/main.c index 88a1dcfa20..c878ce059d 100644 --- a/util/make/main.c +++ b/util/make/main.c @@ -42,9 +42,9 @@ static void usage(void); int main(int argc, char** argv) { - register char * p; /* For argument processing */ + char * p; /* For argument processing */ int estat = 0; /* For question */ - register struct name * np; + struct name * np; int nargc = 0; char **nargv; int fflag = 0; diff --git a/util/make/make.c b/util/make/make.c index f41901cf88..1b6ba4ff3b 100644 --- a/util/make/make.c +++ b/util/make/make.c @@ -59,10 +59,10 @@ static void docmds1(struct name *np, struct line *lp) bool ssilent; bool signore; int estat; - register char * q; - register char * p; + char * q; + char * p; char * shell; - register struct cmd * cp; + struct cmd * cp; if (*(shell = getmacro("SHELL")) == '\0') @@ -136,7 +136,7 @@ static void docmds1(struct name *np, struct line *lp) void docmds(struct name *np) { - register struct line * lp; + struct line * lp; for (lp = np->n_line; lp; lp = lp->l_next) @@ -188,8 +188,8 @@ void touch(struct name *np) static void make1(struct name *np, struct line *lp, struct depend *qdp) { - register struct depend * dp; - register char *p; + struct depend * dp; + char *p; if (dotouch) touch(np); @@ -223,9 +223,9 @@ static void make1(struct name *np, struct line *lp, struct depend *qdp) */ int make(struct name *np, int level) { - register struct depend * dp; - register struct line * lp; - register struct depend * qdp; + struct depend * dp; + struct line * lp; + struct depend * qdp; time_t dtime = 1; bool didsomething = 0; int dynamic = 0; diff --git a/util/make/reader.c b/util/make/reader.c index ce3d78c080..425a7ac343 100644 --- a/util/make/reader.c +++ b/util/make/reader.c @@ -44,7 +44,7 @@ void error(char *msg, char* a1) */ bool mgetline(char* str, FILE* fd) { - register char * p; + char * p; char * q; int pos = 0; @@ -101,7 +101,7 @@ bool mgetline(char* str, FILE* fd) */ char *gettok(char **ptr) { - register char * p; + char * p; while (isspace(**ptr)) /* Skip spaces */ diff --git a/util/make/rules.c b/util/make/rules.c index a434511c9c..c8cd658bd8 100644 --- a/util/make/rules.c +++ b/util/make/rules.c @@ -27,10 +27,10 @@ char *suffix(char *name) */ bool dyndep(struct name *np) { - register char * p; - register char * q; - register char * suff; /* Old suffix */ - register char * basename; /* Name without suffix */ + char * p; + char * q; + char * suff; /* Old suffix */ + char * basename; /* Name without suffix */ struct name * op; /* New dependent */ struct name * sp; /* Suffix */ struct line * lp; diff --git a/util/misc/convert.c b/util/misc/convert.c index 6b8c885a04..c204410bb2 100644 --- a/util/misc/convert.c +++ b/util/misc/convert.c @@ -30,7 +30,7 @@ static char rcsid[] = "$Id$"; char *filename; /* Name of input file */ int errors; /* Number of errors */ extern char *C_error; -extern int C_out(register struct e_instr *); +extern int C_out(struct e_instr *); void error(const char *, ...); void fatal(const char *, ...); @@ -38,7 +38,7 @@ void fatal(const char *, ...); int main(int argc, char **argv) { struct e_instr buf; - register struct e_instr *p = &buf; + struct e_instr *p = &buf; if (argc >= 2) { diff --git a/util/misc/esize.c b/util/misc/esize.c index af81ad0ce7..cd842502cb 100644 --- a/util/misc/esize.c +++ b/util/misc/esize.c @@ -122,7 +122,7 @@ static int rd_byte(void) static long rd_int(long n) { long l; - register int i; + int i; l = btol(rd_byte()); for (i = 1; i < n; i++) diff --git a/util/ncgg/coerc.c b/util/ncgg/coerc.c index 50265c59ed..189cb0f9fa 100644 --- a/util/ncgg/coerc.c +++ b/util/ncgg/coerc.c @@ -34,8 +34,8 @@ extern void dopattern(int stackcoerc, varinfo *kills, varinfo *allocates, void n_move(int s1, int e1, int s2, int e2, struct varinfo *vi) { - register move_p mp; - register int i, j; + move_p mp; + int i, j; NEXT(nmoves, MAXMOVES, "Moves"); mp = &l_moves[nmoves - 1]; @@ -55,7 +55,7 @@ void n_move(int s1, int e1, int s2, int e2, struct varinfo *vi) int existmove(iocc_t from, short *sp) { - register int i; + int i; for (i = 0; i < MAXREGS + MAXTOKENS; i++) if (BIT(from.in_set, i)) @@ -67,7 +67,7 @@ int existmove(iocc_t from, short *sp) int existalmove(iocc_t from, int prpno) { short s[SETSIZE]; - register int i; + int i; for (i = 0; i < SETSIZE; i++) s[i] = i < SZOFSET(MAXREGS) ? l_props[prpno].pr_regset[i] : 0; @@ -76,7 +76,7 @@ int existalmove(iocc_t from, int prpno) struct varinfo *gen_move(iocc_t from, iocc_t to) { - register struct varinfo *vp; + struct varinfo *vp; if (existmove(from, to.in_set) == 0) { @@ -96,8 +96,8 @@ short postests[SETSIZE]; void n_test(int s, int e, struct varinfo *vi) { - register test_p tp; - register int i; + test_p tp; + int i; NEXT(ntests, MAXTESTS, "Tests"); tp = &l_tests[ntests - 1]; @@ -113,7 +113,7 @@ void n_test(int s, int e, struct varinfo *vi) struct varinfo *gen_test(iocc_t from) { - register struct varinfo *vp; + struct varinfo *vp; if (!subset(from.in_set, postests, SETSIZE)) { @@ -128,7 +128,7 @@ struct varinfo *gen_test(iocc_t from) struct varinfo *gen_label(int arg) { - register struct varinfo *vp; + struct varinfo *vp; NEW(vp, struct varinfo); vp->vi_int[0] = INSLABDEF; @@ -138,7 +138,7 @@ struct varinfo *gen_label(int arg) struct varinfo *gen_preturn(void) { - register struct varinfo *vp; + struct varinfo *vp; NEW(vp, struct varinfo); vp->vi_int[0] = INSPRETURN; @@ -147,7 +147,7 @@ struct varinfo *gen_preturn(void) struct varinfo *gen_tlab(int n) { - register struct varinfo *vp; + struct varinfo *vp; assert(n >= 0 && n <= 9); NEW(vp, struct varinfo); @@ -162,9 +162,9 @@ set_t ustackset, cstackset; void n_stack(int s, int e, int p, struct varinfo *vi) { - register c1_p c1p; - register short *sp; - register int i; + c1_p c1p; + short *sp; + int i; NEXT(nstacks, MAXSTACKS, "Stacks"); c1p = &l_stacks[nstacks - 1]; @@ -182,10 +182,10 @@ void n_stack(int s, int e, int p, struct varinfo *vi) sp[i] |= l_sets[s].set_val[i]; } -void checkstacking(register short *sp) +void checkstacking(short *sp) { - register int i; - register short *chkset; + int i; + short *chkset; char *warn; if (subset(sp, ustackset.set_val, SETSIZE)) @@ -210,9 +210,9 @@ set_t unstackset; void n_coerc(int ti, int be, struct varinfo *al, struct varinfo *ge, struct varinfo *rp, iocc_p inp) { - register c3_p c3p; - register int i; - register struct varinfo *vi; + c3_p c3p; + int i; + struct varinfo *vi; if (ti != 0) { @@ -256,8 +256,8 @@ void n_coerc(int ti, int be, struct varinfo *al, struct varinfo *ge, struct vari void checkunstacking(int setno) { - register short *sp; - register int i; + short *sp; + int i; short hallset[SETSIZE]; sp = l_sets[setno].set_val; @@ -271,9 +271,9 @@ c2_t l_split[MAXSPLCOERC]; void n_split(int ti, int be, struct varinfo *al, struct varinfo *ge, struct varinfo *rp, int n) { - register c2_p c2p; - register int i; - register struct varinfo *vi; + c2_p c2p; + int i; + struct varinfo *vi; NEXT(nsplit, MAXSPLCOERC, "Splitting coercions"); c2p = &l_split[nsplit - 1]; diff --git a/util/ncgg/coerc.h b/util/ncgg/coerc.h index e45c757545..e1f8c1010b 100644 --- a/util/ncgg/coerc.h +++ b/util/ncgg/coerc.h @@ -22,7 +22,7 @@ struct varinfo *gen_label(int arg); struct varinfo *gen_preturn(void); struct varinfo *gen_tlab(int n); void n_stack(int s, int e, int p, struct varinfo *vi); -void checkstacking(register short *sp); +void checkstacking(short *sp); void n_coerc(int ti, int be, struct varinfo *al, struct varinfo *ge, struct varinfo *rp, iocc_p inp); void checkunstacking(int setno); diff --git a/util/ncgg/emlookup.c b/util/ncgg/emlookup.c index 13f5b892b6..c50cd66912 100644 --- a/util/ncgg/emlookup.c +++ b/util/ncgg/emlookup.c @@ -26,22 +26,22 @@ struct emhashmnem /* Forward declarations */ static void enter(char *, int); -static unsigned emhash(register char *); +static unsigned emhash(char *); void initemhash(void) { - register int i; + int i; for (i = 0; i <= sp_lmnem - sp_fmnem; i++) enter(em_mnem[i], i + sp_fmnem); enter("lab", op_lab); } -static unsigned emhash(register char *name) +static unsigned emhash(char *name) { - register unsigned int sum; - register int i; + unsigned int sum; + int i; for (sum = i = 0; *name; i += 3) sum ^= (*name++) << (i & 07); @@ -50,7 +50,7 @@ static unsigned emhash(register char *name) static void enter(char *name, int value) { - register unsigned h; + unsigned h; h = emhash(name) % HASHSIZE; while (emhashmnem[h].h_name[0] != 0) @@ -61,7 +61,7 @@ static void enter(char *name, int value) int mlookup(char *name) { - register unsigned h; + unsigned h; h = emhash(name) % HASHSIZE; while (strncmp(emhashmnem[h].h_name, name, 3) != 0 diff --git a/util/ncgg/expr.c b/util/ncgg/expr.c index 1a70e7e13f..b733bb4b58 100644 --- a/util/ncgg/expr.c +++ b/util/ncgg/expr.c @@ -51,7 +51,7 @@ expr_t make_expr(int type, int operator, int op1, int op2) expr_t regno_expr(int regno) { expr_t result; - register int i; + int i; result.ex_typ = TYPREG; result.ex_index = ex_lookup(EX_REG, regno, 0); @@ -63,7 +63,7 @@ expr_t regno_expr(int regno) expr_t ident_expr(char *name) { - register symbol *sy_p; + symbol *sy_p; sy_p = lookup(name, symany, mustexist); if (sy_p->sy_type == symconst) @@ -88,10 +88,10 @@ expr_t subreg_expr(int tokarg, int subreg) return (result); } -void subregset(register short *sp, int subreg, register short *regset) +void subregset(short *sp, int subreg, short *regset) { - register int i; - register reginfo *rp; + int i; + reginfo *rp; for (i = 0; i < SZOFSET(MAXREGS); i++) regset[i] = 0; @@ -117,9 +117,9 @@ void subregset(register short *sp, int subreg, register short *regset) int membset(int setno, char *name, short *regset, char *appearance, int restyp, int *typp) { - register short *sp; - register token_p tp; - register int i, j, k; + short *sp; + token_p tp; + int i, j, k; int thistyp; int typesdiffer = 0; int res_j = -1; @@ -220,8 +220,8 @@ expr_t perc_ident_expr(char *name) expr_t all_expr(int all_no, int subreg) { set_t localset; - register int i; - register short *sp; + int i; + short *sp; expr_t result; sp = l_props[allreg[all_no]].pr_regset; @@ -376,7 +376,7 @@ void initnodes(void) int ex_lookup(int operator, int lnode, int rnode) { - register node_p p; + node_p p; for (p = nodes + 1; p < &nodes[nnodes]; p++) { diff --git a/util/ncgg/expr.h b/util/ncgg/expr.h index 00f080d7a0..bc11d269d5 100644 --- a/util/ncgg/expr.h +++ b/util/ncgg/expr.h @@ -28,7 +28,7 @@ expr_t all_expr(int all_no, int subreg); expr_t perc_ident_expr(char *name); expr_t tokm_expr(int tokarg, char *name); int membset(int setno, char *name, short *regset, char *appearance, int restyp, int *typp); -void subregset(register short *sp, int subreg, register short *regset); +void subregset(short *sp, int subreg, short *regset); expr_t subreg_expr(int tokarg, int subreg); expr_t ident_expr(char *name); expr_t make_expr(int type, int operator, int op1, int op2); diff --git a/util/ncgg/hall.c b/util/ncgg/hall.c index 53d695be09..befc6edb3d 100644 --- a/util/ncgg/hall.c +++ b/util/ncgg/hall.c @@ -34,13 +34,13 @@ int nhallsets = -1; int hallfreq[MAXHALL][2]; int recurhall(int, short [][SETSIZE]); -void unite(register short *, short *); +void unite(short *, short *); void hallverbose(void) { - register int i; - register int max; + int i; + int max; fprintf(stderr, "Table of hall frequencies\n # pre post\n"); for (max = MAXHALL - 1; hallfreq[max][0] == 0 && hallfreq[max][1] == 0; @@ -57,9 +57,9 @@ void inithall(void) nhallsets = 0; } -void nexthall(register short *sp) +void nexthall(short *sp) { - register int i; + int i; assert(nhallsets >= 0); for (i = 0; i < SETSIZE; i++) @@ -67,9 +67,9 @@ void nexthall(register short *sp) nhallsets++; } -int card(register short *sp) +int card(short *sp) { - register int sum, i; + int sum, i; sum = 0; for (i = 0; i < 8 * sizeof(short) * SETSIZE; i++) @@ -87,7 +87,7 @@ void checkhall(void) int hall(void) { - register int i, j, k; + int i, j, k; int ok; hallfreq[nhallsets][0]++; @@ -126,7 +126,7 @@ int recurhall(int nhallsets, short hallsets[][SETSIZE]) { short copysets[MAXHALL][SETSIZE]; short setsum[SETSIZE]; - register int i, j, k, ncopys; + int i, j, k, ncopys; /* * First check cardinality of union of all @@ -158,9 +158,9 @@ int recurhall(int nhallsets, short hallsets[][SETSIZE]) return (1); } -void unite(register short *sp, short *into) +void unite(short *sp, short *into) { - register int i; + int i; for (i = 0; i < SETSIZE; i++) into[i] |= sp[i]; diff --git a/util/ncgg/hall.h b/util/ncgg/hall.h index 4e700d7a6f..ee05bdfcaf 100644 --- a/util/ncgg/hall.h +++ b/util/ncgg/hall.h @@ -12,6 +12,6 @@ void hallverbose(void); void inithall(void); int hall(void); void checkhall(void); -void nexthall(register short *sp); +void nexthall(short *sp); #endif /* HALL_H_ */ diff --git a/util/ncgg/instruct.c b/util/ncgg/instruct.c index cd5638f0f1..8a2ed89304 100644 --- a/util/ncgg/instruct.c +++ b/util/ncgg/instruct.c @@ -60,8 +60,8 @@ static struct varinfo * genremove(int n) static int onlyreg(int argno) { - register int bitno; - register short *sp; + int bitno; + short *sp; if (!argno) argno++; @@ -87,11 +87,11 @@ static void makescratch(int argno) struct varinfo *gen_inst(char *ident, int star) { - register struct varinfo *vi, *retval, *eravi; - register instr_p ip; - register struct operand *op; - register int i; - register inst_p insta; + struct varinfo *vi, *retval, *eravi; + instr_p ip; + struct operand *op; + int i; + inst_p insta; if (star && !inproc) error("Variable instruction only allowed inside proc"); diff --git a/util/ncgg/iocc.c b/util/ncgg/iocc.c index 8274c0d6df..bb426246df 100644 --- a/util/ncgg/iocc.c +++ b/util/ncgg/iocc.c @@ -34,7 +34,7 @@ iocc_t subr_iocc(int tokarg, int subreg) { inst_t insta; iocc_t result; - register int i; + int i; insta.in_which = IN_COPY; insta.in_info[0] = tokarg; @@ -58,7 +58,7 @@ iocc_t tokm_iocc(int tokarg, char *ident) { iocc_t result; inst_t insta; - register int i; + int i; char app[100]; int dummy; @@ -80,7 +80,7 @@ iocc_t percident_iocc(char *ident) { iocc_t result; inst_t insta; - register int i; + int i; char app[100]; int dummy; @@ -99,8 +99,8 @@ iocc_t ident_iocc(char *ident) { iocc_t result; inst_t insta; - register int i; - register symbol *sy_p; + int i; + symbol *sy_p; for (i = 0; i < SETSIZE; i++) result.in_set[i] = 0; @@ -116,9 +116,9 @@ iocc_t all_iocc(int all_no, int subreg) { iocc_t result; inst_t insta; - register int i; + int i; set_t localset; - register short *sp; + short *sp; sp = l_props[allreg[all_no]].pr_regset; for (i = 0; i < SETSIZE; i++) @@ -137,9 +137,9 @@ iocc_t descr_iocc(char *ident) { iocc_t result; inst_t insta; - register symbol *sy_p; - register token_p tp; - register int i; + symbol *sy_p; + token_p tp; + int i; int typerr; for (i = 0; i < SETSIZE; i++) @@ -211,7 +211,7 @@ inst_t l_instances[MAXINSTANCES]; static int instalookup(inst_t insta, int filled) { - register int i, j; + int i, j; for (j = filled; j <= MAXATT; j++) insta.in_info[j] = 0; diff --git a/util/ncgg/lookup.c b/util/ncgg/lookup.c index dadb2b16f6..b8ffbf0d69 100644 --- a/util/ncgg/lookup.c +++ b/util/ncgg/lookup.c @@ -18,7 +18,7 @@ static char rcsid[] = "$Id$"; symbol dumsym; /* dummy to return in case of error */ /* Forward declarations */ -static int hashvalue(register char *); +static int hashvalue(char *); symbol *lookup(char *name, symtype type, lookupstyle style) { @@ -65,10 +65,10 @@ symbol *lookup(char *name, symtype type, lookupstyle style) } } -static int hashvalue(register char *s) +static int hashvalue(char *s) { - register unsigned sum = 0; - register int i; + unsigned sum = 0; + int i; for (i = 0; *s; s++, i = (i + 3) & 07) sum += *s << i; diff --git a/util/ncgg/output.c b/util/ncgg/output.c index 84ce8dd7a6..f629254ba7 100644 --- a/util/ncgg/output.c +++ b/util/ncgg/output.c @@ -192,7 +192,7 @@ void codeint(int x) void outpatterns(void) { - register int i; + int i; if (!inproc) { @@ -250,8 +250,8 @@ static void patbyte(int n) void hashpatterns(void) { short index; - register char *bp, *tp; - register short i; + char *bp, *tp; + short i; unsigned short hashvalue; int patlen; @@ -300,7 +300,7 @@ void outincludes(void) void outregs(void) { - register int i, j, k; + int i, j, k; short rset[SZOFSET(MAXREGS)]; short clashlist[MAXREGS * MAXREGS]; int iclashlist = 0; @@ -387,7 +387,7 @@ void outregs(void) void outregvars(void) { - register int i, j; + int i, j; fprintf(htable, "#define REGVARS\n"); if (reglap != 0) @@ -447,9 +447,9 @@ static int is_ascii(int c) return 0; } -void outfmt(register char *p) +void outfmt(char *p) { - register int c; + int c; fprintf(ctable, "\""); while ((c = (*p++ & 0377)) != 0) { @@ -466,8 +466,8 @@ void outfmt(register char *p) void outtokens(void) { - register int tokno, i; - register token_p tp; + int tokno, i; + token_p tp; fprintf(ctable, "tkdef_t tokens[] = {{0},\n"); for (tokno = 1; tokno < ntokens; tokno++) @@ -489,7 +489,7 @@ void outtokens(void) void outenodes(void) { - register node_p np; + node_p np; fprintf(ctable, "node_t enodes[] = {\n"); for (np = nodes; np < &nodes[nnodes]; np++) @@ -500,10 +500,10 @@ void outenodes(void) void outstrings(void) { - register int i; + int i; #if 0 - register char *p; - register int c; + char *p; + int c; #endif if (tabledebug) @@ -535,8 +535,8 @@ extern set_t unstackset; void outsets(void) { - register int i; - register set_p sp; + int i; + set_p sp; fprintf(ctable, "set_t machsets[] = {\n"); for (sp = l_sets; sp < &l_sets[nsets]; sp++) @@ -557,8 +557,8 @@ void outsets(void) void outinstances(void) { - register inst_p ip; - register int i; + inst_p ip; + int i; fprintf(ctable, "inst_t tokeninstances[] = {\n"); for (ip = l_instances; ip < &l_instances[ninstances]; ip++) @@ -573,7 +573,7 @@ void outinstances(void) void outmoves(void) { - register move_p mp; + move_p mp; fprintf(ctable, "move_t moves[] = {\n"); for (mp = l_moves; mp < &l_moves[nmoves]; mp++) @@ -584,7 +584,7 @@ void outmoves(void) void outtests(void) { - register test_p tp; + test_p tp; fprintf(ctable, "test_t tests[] = {\n"); for (tp = l_tests; tp < &l_tests[ntests]; tp++) @@ -594,7 +594,7 @@ void outtests(void) void outstacks(void) { - register c1_p cp; + c1_p cp; fprintf(ctable, "c1_t c1coercs[] = {\n"); for (cp = l_stacks; cp < &l_stacks[nstacks]; cp++) @@ -605,8 +605,8 @@ void outstacks(void) void outsplits(void) { - register c2_p cp; - register int i; + c2_p cp; + int i; fprintf(ctable, "c2_t c2coercs[] = {\n"); for (cp = l_split; cp < &l_split[nsplit]; cp++) @@ -622,7 +622,7 @@ void outsplits(void) void outcoercs(void) { - register c3_p cp; + c3_p cp; fprintf(ctable, "c3_t c3coercs[] = {\n"); for (cp = l_coercs; cp < &l_coercs[ncoercs]; cp++) @@ -633,8 +633,8 @@ void outcoercs(void) void outproplists(void) { - register int propno; - register int regno; + int propno; + int regno; for (propno = 0; propno < nprops; propno++) { @@ -675,7 +675,7 @@ void passon(char *s) void outdefs(void) { - register symbol *sy_p; + symbol *sy_p; extern int maxempatlen, maxrule; char *wrdfmt; @@ -711,7 +711,7 @@ void outdefs(void) void outars(void) { - register int i; + int i; if (code_in_c) fprintf(htable, "#define CODEINC 1\n"); @@ -775,10 +775,10 @@ void codecoco(int cocono) void dopattern(int stackcoerc, varinfo *kills, varinfo *allocates, varinfo *generates, varinfo *yields, varinfo *leaving) { - register int i; + int i; int n, nops; - register struct varinfo *vp, *vivp; - register instr_p instp; + struct varinfo *vp, *vivp; + instr_p instp; int al, deal; int vil; int cocono = -1; diff --git a/util/ncgg/set.c b/util/ncgg/set.c index dd37590c23..a38052347d 100644 --- a/util/ncgg/set.c +++ b/util/ncgg/set.c @@ -22,8 +22,8 @@ set_t emptyset; int setlookup(set_t s) { - register set_p p; - register int i; + set_p p; + int i; int setno; for (p = l_sets; p < &l_sets[nsets]; p++) @@ -44,7 +44,7 @@ int setlookup(set_t s) void make_std_sets(void) { set_t s; - register int i; + int i; for (i = 0; i < SETSIZE; i++) s.set_val[i] = 0; @@ -57,9 +57,9 @@ void make_std_sets(void) set_t ident_to_set(char *name) { - register symbol *sy_p; - register int i; - register struct propinfo *pp; + symbol *sy_p; + int i; + struct propinfo *pp; int bitno; set_t result; @@ -91,17 +91,17 @@ set_t ident_to_set(char *name) return (result); } -static void checksize(register set_p s) +static void checksize(set_p s) { - register int i; - register int size = -1; + int i; + int size = -1; s->set_size = 0; for (i = 1; i <= nregs; i++) { if (BIT(s->set_val, i)) { - register int sz = l_regs[i].ri_size; + int sz = l_regs[i].ri_size; if (size == -1) size = sz; @@ -113,7 +113,7 @@ static void checksize(register set_p s) { if (BIT(s->set_val, i + nregs)) { - register int sz = l_tokens[i]->tk_size; + int sz = l_tokens[i]->tk_size; if (size == -1) size = sz; else if (size != sz) @@ -127,7 +127,7 @@ static void checksize(register set_p s) set_t setproduct(set_t s1, set_t s2) { set_t result; - register int i; + int i; for (i = 0; i < SETSIZE; i++) result.set_val[i] = s1.set_val[i] & s2.set_val[i]; @@ -138,7 +138,7 @@ set_t setproduct(set_t s1, set_t s2) set_t setsum(set_t s1, set_t s2) { set_t result; - register int i; + int i; if (s1.set_size == s2.set_size) result.set_size = s1.set_size; @@ -152,7 +152,7 @@ set_t setsum(set_t s1, set_t s2) set_t setdiff(set_t s1, set_t s2) { set_t result; - register int i; + int i; for (i = 0; i < SETSIZE; i++) result.set_val[i] = s1.set_val[i] & ~s2.set_val[i]; diff --git a/util/ncgg/strlookup.c b/util/ncgg/strlookup.c index 52eca7e74d..b5606d2ef6 100644 --- a/util/ncgg/strlookup.c +++ b/util/ncgg/strlookup.c @@ -16,7 +16,7 @@ char *l_strings[MAXSTRINGS]; int strlookup(char *str) { - register int i; + int i; for (i = 0; i < nstrings; i++) if (strcmp(str, l_strings[i]) == 0) diff --git a/util/ncgg/subr.c b/util/ncgg/subr.c index b81a23676d..00217e230c 100644 --- a/util/ncgg/subr.c +++ b/util/ncgg/subr.c @@ -30,7 +30,7 @@ extern set_t l_sets[]; void n_proc(char *name) { - register symbol *sy_p; + symbol *sy_p; sy_p = lookup(name, symproc, newsymbol); sy_p->sy_value.syv_procoff = npatbytes + 1; @@ -53,9 +53,9 @@ struct varinfo * make_erase(char *name) void n_instr(char *name, char *asname, operand *oplist, struct varinfo *eraselist, struct varinfo *cost) { - register int instrno; - register int cc_count; - register instr_p ip; + int instrno; + int cc_count; + instr_p ip; instrno = NEXT(ninstr, MAXINSTR, "Instructions"); ip = &l_instr[instrno]; @@ -92,7 +92,7 @@ void n_instr(char *name, char *asname, operand *oplist, struct varinfo *eraselis void n_set(char *name, int number) { - register symbol *sy_p; + symbol *sy_p; sy_p = lookup(name, symset, newsymbol); sy_p->sy_value.syv_setno = number; @@ -101,9 +101,9 @@ void n_set(char *name, int number) void n_tok(char *name, struct varinfo *atts, int size, struct varinfo *cost, struct varinfo *format) { - register symbol *sy_p; - register token_p tp; - register struct varinfo *vip; + symbol *sy_p; + token_p tp; + struct varinfo *vip; int i; int tokno; int thistokensize; @@ -170,8 +170,8 @@ void n_tok(char *name, struct varinfo *atts, int size, void checkprintformat(int n) { - register short *s; - register int i; + short *s; + int i; s = l_sets[n].set_val; for (i = nregs; i < nregs + ntokens; i++) @@ -183,7 +183,7 @@ void checkprintformat(int n) void n_prop(char *name, int size) { int propno; - register symbol *sp; + symbol *sp; propno = NEXT(nprops, MAXPROPS, "Properties"); sp = lookup(name, symprop, newsymbol); @@ -198,7 +198,7 @@ void n_prop(char *name, int size) void prophall(int n) { - register int i; + int i; short hallset[SETSIZE]; if (n < 0) @@ -210,8 +210,8 @@ void prophall(int n) int n_reg(char *name, char *printstring, int nmemb, int member1, int member2) { - register symbol *sy_p; - register reginfo *ri_p; + symbol *sy_p; + reginfo *ri_p; int regno; sy_p = lookup(name, symreg, newsymbol); @@ -242,7 +242,7 @@ int cmustbeset(char *ident) void n_const(char *ident, int val) { - register symbol *sy_p; + symbol *sy_p; sy_p = lookup(ident, symconst, newsymbol); sy_p->sy_value.syv_cstval = val; @@ -250,7 +250,7 @@ void n_const(char *ident, int val) void n_sconst(char *ident, char *val) { - register symbol *sy_p; + symbol *sy_p; sy_p = lookup(ident, symsconst, newsymbol); sy_p->sy_value.syv_stringno = strlookup(val); @@ -333,9 +333,9 @@ static void add_regvar(int rvnum, reginfo *regp, int rv) void regline(varinfo *rl, varinfo *pl, int rv) { - register varinfo *rrl, *rpl; - register short *sp; - register reginfo *regp; + varinfo *rrl, *rpl; + short *sp; + reginfo *regp; int thissize; int propno; @@ -392,9 +392,9 @@ void setallreg(struct varinfo *vi) } } -void freevi(register struct varinfo *vip) +void freevi(struct varinfo *vip) { - register int i; + int i; if (vip == 0) return; @@ -405,10 +405,10 @@ void freevi(register struct varinfo *vip) free(vip); } -int myatoi(register char *s) +int myatoi(char *s) { - register int base = 10; - register int sum = 0; + int base = 10; + int sum = 0; if (*s == '0') { @@ -466,16 +466,16 @@ int myatoi(register char *s) char *mystrcpy(char *s) { - register char *p; + char *p; p = myalloc(strlen(s) + 1); strcpy(p, s); return (p); } -char *myalloc(register int n) +char *myalloc(int n) { - register char *p, *result; + char *p, *result; result = p = malloc(n); if (p == (char *) 0) @@ -496,7 +496,7 @@ int chkincl(int value, int lwb, int upb) int subset(short *sp1, short *sp2, int setsize) { - register int i; + int i; for (i = 0; i < setsize; i++) if ((sp1[i] | sp2[i]) != sp2[i]) @@ -504,9 +504,9 @@ int subset(short *sp1, short *sp2, int setsize) return (1); } -int vilength(register struct varinfo *vip) +int vilength(struct varinfo *vip) { - register int l = 0; + int l = 0; while (vip != 0) { diff --git a/util/ncgg/subr.h b/util/ncgg/subr.h index dd5fa3ac22..111a5355ef 100644 --- a/util/ncgg/subr.h +++ b/util/ncgg/subr.h @@ -31,12 +31,12 @@ void n_sconst(char *ident, char *val); void regline(struct varinfo *rl, struct varinfo *pl, int rv); void check_reglap(void); void setallreg(struct varinfo *vi); -void freevi(register struct varinfo *vip); -int myatoi(register char *s); +void freevi(struct varinfo *vip); +int myatoi(char *s); char *mystrcpy(char *s); -char *myalloc(register int n); +char *myalloc(int n); int chkincl(int value, int lwb, int upb); int subset(short *sp1, short *sp2, int setsize); -int vilength(register struct varinfo *vip); +int vilength(struct varinfo *vip); #endif /* SUBR_H_ */ diff --git a/util/opt/alloc.c b/util/opt/alloc.c index 9bdb77caa1..581b9c2573 100644 --- a/util/opt/alloc.c +++ b/util/opt/alloc.c @@ -18,7 +18,7 @@ #ifdef USEMALLOC -short *myalloc(register unsigned int); +short *myalloc(unsigned int); #define newcore(size) myalloc(size) #define oldcore(p,size) free(p) @@ -92,8 +92,8 @@ int asizetab[] = { line_p newline(int optyp) { - register line_p lnp; - register int kind = optyp; + line_p lnp; + int kind = optyp; if (kind > OPMINI) kind = OPMINI; @@ -102,9 +102,9 @@ line_p newline(int optyp) return (lnp); } -void oldline(register line_p lnp) +void oldline(line_p lnp) { - register int kind = lnp->l_optyp & BMASK; + int kind = lnp->l_optyp & BMASK; if (kind > OPMINI) kind = OPMINI; @@ -115,16 +115,16 @@ void oldline(register line_p lnp) arg_p newarg(int kind) { - register arg_p ap; + arg_p ap; ap = (arg_p) newcore(asizetab[kind]); ap->a_typ = kind; return (ap); } -void oldargs(register arg_p ap) +void oldargs(arg_p ap) { - register arg_p next; + arg_p next; while (ap != (arg_p) 0) { @@ -145,9 +145,9 @@ void oldargs(register arg_p ap) } } -void oldargb(register argb_p abp) +void oldargb(argb_p abp) { - register argb_p next; + argb_p next; while (abp != (argb_p) 0) { @@ -217,9 +217,9 @@ typedef struct coreblock #ifdef COREDEBUG coreverbose() { - register size; - register short *p; - register sum; + size; + short *p; + sum; sum = 0; for(size=1;size= cend && cchunk>0) @@ -461,9 +461,9 @@ void coreinit(void) */ } -short *myalloc(register unsigned int size) +short *myalloc(unsigned int size) { - register short *p, *q; + short *p, *q; p = (short *) malloc(size); if (p == 0) diff --git a/util/opt/alloc.h b/util/opt/alloc.h index 9eb9b57734..737a3a5a89 100644 --- a/util/opt/alloc.h +++ b/util/opt/alloc.h @@ -15,10 +15,10 @@ extern arg_p newarg(int kind); extern argb_p newargb(void); extern reg_p newreg(void); -extern void oldline(register line_p lnp); +extern void oldline(line_p lnp); extern void oldreg(reg_p rp); -extern void oldargs(register arg_p ap); -extern void oldargb(register argb_p abp); +extern void oldargs(arg_p ap); +extern void oldargb(argb_p abp); extern void oldnum(num_p lp); extern void coreinit(void); diff --git a/util/opt/backward.c b/util/opt/backward.c index d20cb878e3..aed8d4511d 100644 --- a/util/opt/backward.c +++ b/util/opt/backward.c @@ -39,12 +39,12 @@ int rc; void backward(void) { - register line_p lnp; + line_p lnp; line_p next; - register arg_p ap; + arg_p ap; line_p i, p; int n; - register sym_p sp; + sym_p sp; i = p = (line_p) 0; curdtyp = 0; diff --git a/util/opt/cleanup.c b/util/opt/cleanup.c index f82cdc1c10..d66183f179 100644 --- a/util/opt/cleanup.c +++ b/util/opt/cleanup.c @@ -19,8 +19,8 @@ void cleanup(void) { FILE *infile; - register int c; - register sym_p *spp, sp; + int c; + sym_p *spp, sp; for (spp = symhash; spp < &symhash[NSYMHASH]; spp++) for (sp = *spp; sp != (sym_p) 0; sp = sp->s_next) diff --git a/util/opt/flow.c b/util/opt/flow.c index 08a04cf262..11e243c087 100644 --- a/util/opt/flow.c +++ b/util/opt/flow.c @@ -17,7 +17,7 @@ #include "ext.h" /* Forward declarations */ -static void reach(register line_p); +static void reach(line_p); static void findreach(void); static void cleaninstrs(void); @@ -29,7 +29,7 @@ void flow(void) static void findreach(void) { - register num_p *npp, np; + num_p *npp, np; reach(instrs); for (npp = curpro.numhash; npp < &curpro.numhash[NNUMHASH]; npp++) @@ -56,9 +56,9 @@ static void findreach(void) } } -static void reach(register line_p lnp) +static void reach(line_p lnp) { - register num_p np; + num_p np; for (; lnp != (line_p) 0; lnp = lnp->l_next) { @@ -102,7 +102,7 @@ static void reach(register line_p lnp) static void cleaninstrs(void) { - register line_p *lpp, lp, *lastbra; + line_p *lpp, lp, *lastbra; bool reachable, superfluous; int instr; diff --git a/util/opt/getline.c b/util/opt/getline.c index 734e08823b..2eeed984a8 100644 --- a/util/opt/getline.c +++ b/util/opt/getline.c @@ -55,7 +55,7 @@ static void tstinpro(void) short readshort(void) { - register int l_byte, h_byte; + int l_byte, h_byte; l_byte = readbyte(); h_byte = readbyte(); @@ -67,8 +67,8 @@ short readshort(void) #ifdef LONGOFF static offset readoffset(void) { - register long l; - register int h_byte; + long l; + int h_byte; l = readbyte(); l |= ((unsigned) readbyte()) * 256; @@ -137,9 +137,9 @@ static void make_string(int n) static void inident(void) { - register int n; - register char *p = string; - register int c; + int n; + char *p = string; + int c; n = getint(); while (n--) @@ -202,7 +202,7 @@ static int table3(int n) static int table1(void) { - register int n; + int n; n = readbyte(); if (n == EOF) @@ -227,7 +227,7 @@ static int table1(void) static int table2(void) { - register int n; + int n; n = readbyte(); if ((n < sp_fcst0 + sp_ncst0) && (n >= sp_fcst0)) @@ -238,7 +238,7 @@ static int table2(void) return (table3(n)); } -static void argstring(offset length, register argb_p abp) +static void argstring(offset length, argb_p abp) { while (length--) { @@ -251,7 +251,7 @@ static void argstring(offset length, register argb_p abp) static line_p arglist(int n) { line_p lnp; - register arg_p ap, *app; + arg_p ap, *app; bool moretocome; offset length; @@ -329,7 +329,7 @@ static line_p arglist(int n) return (lnp); } -offset aoff(register arg_p ap, int n) +offset aoff(arg_p ap, int n) { while (n > 0) @@ -347,7 +347,7 @@ offset aoff(register arg_p ap, int n) static int inpseudo(short n) { - register line_p lnp, head, tail; + line_p lnp, head, tail; short n1, n2; proinf savearea; #ifdef PSEUBETWEEN @@ -456,7 +456,7 @@ static int inpseudo(short n) curpro.gtoproc = 0; if (prodepth > 1) { - register int i; + int i; curpro.lastline = (line_p) 0; curpro.freg = (reg_p) 0; @@ -506,8 +506,8 @@ static int inpseudo(short n) void getlines(void) { - register line_p lnp; - register int instr; + line_p lnp; + int instr; for (;;) { diff --git a/util/opt/getline.h b/util/opt/getline.h index 6491e0f6c7..96660e2a4c 100644 --- a/util/opt/getline.h +++ b/util/opt/getline.h @@ -11,7 +11,7 @@ #include "types.h" void getlines(void); -offset aoff(register arg_p ap, int n); +offset aoff(arg_p ap, int n); short readshort(void); #endif /* GETLINE_H_ */ diff --git a/util/opt/lookup.c b/util/opt/lookup.c index 434e1d1987..3d06305b49 100644 --- a/util/opt/lookup.c +++ b/util/opt/lookup.c @@ -16,8 +16,8 @@ unsigned hash(char *string) { - register char *p; - register unsigned i, sum; + char *p; + unsigned i, sum; for (sum = i = 0, p = string; *p; i += 3) sum ^= (*p++) << (i & 07); @@ -26,8 +26,8 @@ unsigned hash(char *string) sym_p symlookup(char *name, int status, int flags) { - register sym_p *spp, sp; - register int i; + sym_p *spp, sp; + int i; static short genfrag = 32767; spp = &symhash[hash(name) % NSYMHASH]; @@ -68,7 +68,7 @@ sym_p symlookup(char *name, int status, int flags) num_p numlookup(unsigned number) { - register num_p *npp, np; + num_p *npp, np; npp = &curpro.numhash[number % NNUMHASH]; while (*npp != (num_p) 0) diff --git a/util/opt/main.c b/util/opt/main.c index 415435f11d..ac7ebcf1c7 100644 --- a/util/opt/main.c +++ b/util/opt/main.c @@ -20,7 +20,7 @@ /* Other external definitions */ extern void cleanup(void); -void flags(register char *s) +void flags(char *s) { for (s++; *s; s++) switch (*s) diff --git a/util/opt/peephole.c b/util/opt/peephole.c index ba310388ff..d8e1b49a3b 100644 --- a/util/opt/peephole.c +++ b/util/opt/peephole.c @@ -40,11 +40,11 @@ byte transl[op_plast - op_pfirst + 1][3] = { op_SEP, op_ste, op_sde } }; /* Forward declarations */ -static int repl_mul(register line_p, line_p *, line_p *); +static int repl_mul(line_p, line_p *, line_p *); static int optimize(void); static int basicblock(line_p *); -static void opcheck(register byte *bp) +static void opcheck(byte *bp) { if (((*bp) & BMASK) >= op_pfirst) *bp = transl[((*bp) & BMASK) - op_pfirst][opind]; @@ -62,8 +62,8 @@ static void opcheck(register byte *bp) static void hashpatterns(void) { short index; - register byte *bp, *tp; - register short i; + byte *bp, *tp; + short i; unsigned short hashvalue; byte *save; int patlen; @@ -146,8 +146,8 @@ int peephole(void) static int optimize(void) { - register num_p *npp, np; - register int instr; + num_p *npp, np; + int instr; bool madeopt; madeopt = basicblock(&instrs); @@ -175,9 +175,9 @@ static offset oabs(offset off) static line_p repline(eval_t ev, int patlen) { - register line_p lp; - register iarg_p iap; - register sym_p sp; + line_p lp; + iarg_p iap; + sym_p sp; offset diff, newdiff; assert(ev.e_typ != EV_UNDEF); @@ -274,11 +274,11 @@ static offset rotate(offset w, offset amount) eval_t undefres = { EV_UNDEF }; -static eval_t compute(register expr_p pexp) +static eval_t compute(expr_p pexp) { eval_t leaf1, leaf2, res; - register int i; - register sym_p sp; + int i; + sym_p sp; offset mask; switch (nparam[pexp->ex_operator]) @@ -483,10 +483,10 @@ static eval_t compute(register expr_p pexp) extern bool special(); #endif -static bool tryrepl(line_p *lpp, register byte *bp, int patlen) +static bool tryrepl(line_p *lpp, byte *bp, int patlen) { int rpllen, instr, rplval; - register line_p lp; + line_p lp; line_p replacement, *rlpp, tp; rpllen = *bp++ & BMASK; @@ -547,11 +547,11 @@ static bool tryrepl(line_p *lpp, register byte *bp, int patlen) return (TRUE); } -static bool trypat(line_p *lpp, register byte *bp, int len) +static bool trypat(line_p *lpp, byte *bp, int len) { - register iarg_p iap; + iarg_p iap; int i, patlen; - register line_p lp; + line_p lp; eval_t result; patlen = *bp++ & BMASK; @@ -649,10 +649,10 @@ static bool trypat(line_p *lpp, register byte *bp, int len) static int basicblock(line_p *alpp) { - register line_p *lpp, lp; + line_p *lpp, lp; unsigned short hash[3]; line_p *next; - register byte *bp; + byte *bp; int i; short index; bool madeopt; @@ -760,9 +760,9 @@ static int basicblock(line_p *alpp) return madeopt; } -static int repl_mul(register line_p lp, line_p *b, line_p *e) +static int repl_mul(line_p lp, line_p *b, line_p *e) { - register line_p next = lp->l_next; + line_p next = lp->l_next; int ins; int sz; unsigned long n; diff --git a/util/opt/process.c b/util/opt/process.c index 631805b677..21e06918ea 100644 --- a/util/opt/process.c +++ b/util/opt/process.c @@ -26,8 +26,8 @@ extern int peephole(void); static void relabel(void) { - register num_p *npp, np, tp; - register num_p repl, ttp; + num_p *npp, np, tp; + num_p repl, ttp; /* * For each label find its final destination after crossjumping. @@ -62,7 +62,7 @@ static void relabel(void) static void symknown(void) { - register sym_p *spp, sp; + sym_p *spp, sp; for (spp = symhash; spp < &symhash[NSYMHASH]; spp++) for (sp = *spp; sp != (sym_p) 0; sp = sp->s_next) @@ -72,7 +72,7 @@ static void symknown(void) static void cleanlocals(void) { - register num_p *npp, np, tp; + num_p *npp, np, tp; for (npp = curpro.numhash; npp < &curpro.numhash[NNUMHASH]; npp++) { @@ -89,7 +89,7 @@ static void cleanlocals(void) static void checklocs(void) { - register num_p *npp, np; + num_p *npp, np; for (npp = curpro.numhash; npp < &curpro.numhash[NNUMHASH]; npp++) for (np = *npp; np != (num_p) 0; np = np->n_next) @@ -106,10 +106,10 @@ static offset align(offset count, offset alignment) static void symvalue(void) { - register line_p lp; - register sym_p sp; - register arg_p ap; - register argb_p abp; + line_p lp; + sym_p sp; + arg_p ap; + argb_p abp; short curfrag = 0; offset count; @@ -170,7 +170,7 @@ static void symvalue(void) static void do_tes(void) { - register line_p insptr = instrs, oldlin = NULL, oldlin2 = NULL; + line_p insptr = instrs, oldlin = NULL, oldlin2 = NULL; init_state(); tes_pseudos(); diff --git a/util/opt/putline.c b/util/opt/putline.c index 60c40ebf3c..30b506150e 100644 --- a/util/opt/putline.c +++ b/util/opt/putline.c @@ -25,15 +25,15 @@ #define outbyte(b) putc(b,outfile) /* Forward declarations. */ -static void numlab(register num_p); -static void putargs(register arg_p); -static void putstr(register argb_p); +static void numlab(num_p); +static void putargs(arg_p); +static void putstr(argb_p); -void putlines(register line_p lnp) +void putlines(line_p lnp) { - register arg_p ap; + arg_p ap; line_p temp; - register int instr; + int instr; short curlin = -2; short thislin; @@ -202,7 +202,7 @@ void putlines(register line_p lnp) } } -static void putargs(register arg_p ap) +static void putargs(arg_p ap) { while (ap != (arg_p) 0) @@ -246,10 +246,10 @@ static void putargs(register arg_p ap) } } -static void putstr(register argb_p abp) +static void putstr(argb_p abp) { - register argb_p tbp; - register int length; + argb_p tbp; + int length; length = 0; tbp = abp; @@ -267,7 +267,7 @@ static void putstr(register argb_p abp) } } -void outdef(register sym_p sp) +void outdef(sym_p sp) { /* @@ -287,7 +287,7 @@ void outdef(register sym_p sp) */ } -void outocc(register sym_p sp) +void outocc(sym_p sp) { if ((sp->s_flags & SYMOUT) == 0) @@ -354,7 +354,7 @@ void outshort(short i) outbyte((byte ) (i >> 8)); } -static void numlab(register num_p np) +static void numlab(num_p np) { if (np->n_number < sp_nilb0) outbyte((byte) (np->n_number + sp_filb0)); @@ -362,7 +362,7 @@ static void numlab(register num_p np) outnum(np); } -void outnum(register num_p np) +void outnum(num_p np) { if (np->n_number < 256) { @@ -376,10 +376,10 @@ void outnum(register num_p np) } } -void outsym(register sym_p sp) +void outsym(sym_p sp) { - register char *p; - register unsigned num; + char *p; + unsigned num; if (sp->s_name[0] == '.') { diff --git a/util/opt/putline.h b/util/opt/putline.h index 2b798901f3..b554477b8e 100644 --- a/util/opt/putline.h +++ b/util/opt/putline.h @@ -10,16 +10,16 @@ #include "types.h" -void putlines(register line_p lnp); -void outdef(register sym_p sp); -void outocc(register sym_p sp); +void putlines(line_p lnp); +void outdef(sym_p sp); +void outocc(sym_p sp); void outpro(void); void outend(void); void outinst(int m); void outoff(offset off); void outint(short i); void outshort(short i); -void outnum(register num_p np); -void outsym(register sym_p sp); +void outnum(num_p np); +void outsym(sym_p sp); #endif /* PUTLINE_H_ */ diff --git a/util/opt/reg.c b/util/opt/reg.c index 62385630d5..9bf3f3a9f2 100644 --- a/util/opt/reg.c +++ b/util/opt/reg.c @@ -18,10 +18,10 @@ #include #include "ext.h" -void regvar(register arg_p ap) +void regvar(arg_p ap) { - register reg_p rp; - register int i; + reg_p rp; + int i; rp = newreg(); i = 0; @@ -55,7 +55,7 @@ void regvar(register arg_p ap) int inreg(offset off) { - register reg_p rp; + reg_p rp; for (rp = curpro.freg; rp != (reg_p) 0; rp = rp->r_next) if (rp->r_par[0] == off) @@ -65,8 +65,8 @@ int inreg(offset off) void outregs(void) { - register reg_p rp, tp; - register int i; + reg_p rp, tp; + int i; for (rp = curpro.freg; rp != (reg_p) 0; rp = tp) { @@ -91,7 +91,7 @@ void outregs(void) /* outtes() handles the output of the top elt. messages */ void outtes(void) { - register num_p *npp, np; + num_p *npp, np; for (npp = curpro.numhash; npp < &curpro.numhash[NNUMHASH]; npp++) { @@ -112,7 +112,7 @@ void outtes(void) void incregusage(offset off) { - register reg_p rp; + reg_p rp; #ifndef GLOBAL_OPT /* If we're optimizing the output of the global optimizer diff --git a/util/opt/reg.h b/util/opt/reg.h index 144c224dfb..535c7fea3f 100644 --- a/util/opt/reg.h +++ b/util/opt/reg.h @@ -8,7 +8,7 @@ #include "types.h" -void regvar(register arg_p ap); +void regvar(arg_p ap); void outregs(void); int inreg(offset off); void outtes(void); diff --git a/util/opt/tes.c b/util/opt/tes.c index 3f28032179..a79f4fe2e5 100644 --- a/util/opt/tes.c +++ b/util/opt/tes.c @@ -37,7 +37,7 @@ static int stacktop = 0; /* Forward declarations */ static void do_inst_label(line_p); -static void assign_label(register num_p); +static void assign_label(num_p); void init_state(void) { @@ -47,7 +47,7 @@ void init_state(void) void tes_pseudos(void) { - register line_p lp; + line_p lp; for (lp = pseudos; lp != (line_p) 0; lp = lp->l_next) { @@ -57,7 +57,7 @@ void tes_pseudos(void) case ps_rom: if (lp->l_optyp == OPLIST) { - register arg_p ap = lp->l_a.la_arg; + arg_p ap = lp->l_a.la_arg; while (ap != (arg_p) 0) { @@ -77,8 +77,8 @@ void tes_pseudos(void) void tes_instr(line_p lnp, line_p x, line_p y) { char *s; - register int instr = INSTR(lnp); - register int arg, argdef; + int instr = INSTR(lnp); + int arg, argdef; int neg = 0; if (instr == op_lab) @@ -195,7 +195,7 @@ void tes_instr(line_p lnp, line_p x, line_p y) } } -static void assign_label(register num_p label) +static void assign_label(num_p label) { if (label->n_flags & NUMSET) { diff --git a/util/topgen/LLlex.c b/util/topgen/LLlex.c index 64d9cb352a..479e4dc482 100644 --- a/util/topgen/LLlex.c +++ b/util/topgen/LLlex.c @@ -25,7 +25,7 @@ extern void error(char *s, char* s1); int LLlex(void) { - register int c; + int c; if (aside.t_tokno) { /* A token was pushed aside, return it now */ dot = aside; diff --git a/util/topgen/hash.c b/util/topgen/hash.c index cafe26d698..003ba53c05 100644 --- a/util/topgen/hash.c +++ b/util/topgen/hash.c @@ -28,8 +28,8 @@ static struct hlist *hashtable[129]; /* an array of ptr's to these lists, static unsigned hash(char* string) { - register char *p; - register unsigned i, sum; + char *p; + unsigned i, sum; if (strcmp(string, "ANY") == 0) return 128; @@ -45,7 +45,7 @@ void addtohashtable(char* s, int n) * s is the key, n the pattern number */ unsigned hval; - register struct hlist *p; + struct hlist *p; hval = hash(s); p = (struct hlist *) malloc(sizeof *p); @@ -78,7 +78,7 @@ void printhashtable(void) * Print the linear lists, and also output an array of * pointers to them */ - register int i; + int i; for (i = 1; i <= 128; i++) { diff --git a/util/topgen/main.c b/util/topgen/main.c index 1a8dfed56c..f79b9afd07 100644 --- a/util/topgen/main.c +++ b/util/topgen/main.c @@ -60,7 +60,7 @@ void error(char *s, char* s1) putc('\n',stderr); } -int onlyspace(register char* s) +int onlyspace(char* s) { while (*s) { diff --git a/util/topgen/pattern.c b/util/topgen/pattern.c index 93ba5459fa..6a6ac16aa9 100644 --- a/util/topgen/pattern.c +++ b/util/topgen/pattern.c @@ -41,7 +41,7 @@ void addpattern(char* str,int l,int np,int nr) * "nr" is the number of instructions in the replacement * Space is allocated in chunks of 50 */ - register struct pattern *p; + struct pattern *p; if (!pattable) { /* No space allocated yet */ pattable = (struct pattern *) malloc(50 * sizeof *pattable); @@ -69,7 +69,7 @@ static void prconstraint(char* str) * prints a constraint, with variable names replaced */ char c; - register char *p, *q; + char *p, *q; struct symtab *name; p = str; @@ -110,8 +110,8 @@ void printpatterns(void) { * Prints the pattern_descr table and generates the routine * "check_constraint" */ - register struct pattern *p; - register int i; + struct pattern *p; + int i; p = pattable; i = 1; diff --git a/util/topgen/symtab.c b/util/topgen/symtab.c index 3a85ae2503..3ad75ff0d0 100644 --- a/util/topgen/symtab.c +++ b/util/topgen/symtab.c @@ -25,8 +25,8 @@ struct symtab * findident(char *s, int mode, struct symtab **table) * If mode = ENTERING, a new entry will be made if s is not in the * table yet, otherwise an error results */ - register struct symtab *p; - register int n; + struct symtab *p; + int n; if (!*table) { /* No entry for this symbol */