Removed explicit usage of the 'register' keyword.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/2/head
Michele Calgaro 4 years ago
parent 50f53e01f0
commit 92fa724cc7
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -157,7 +157,7 @@ zzfree_ast(AST *tree)
AST *zztmake(AST *rt, ...) AST *zztmake(AST *rt, ...)
{ {
va_list ap; va_list ap;
register AST *child, *sibling=NULL, *tail, *w; AST *child, *sibling=NULL, *tail, *w;
AST *root; AST *root;
va_start(ap, rt); va_start(ap, rt);

@ -240,9 +240,9 @@ zzreplchar(zzchar_t c)
/* replace the string s for the reg. expr last matched and in the buffer */ /* replace the string s for the reg. expr last matched and in the buffer */
void void
zzreplstr(register zzchar_t *s) zzreplstr(zzchar_t *s)
{ {
register zzchar_t *l= &zzlextext[zzbufsize -1]; zzchar_t *l= &zzlextext[zzbufsize -1];
zznextpos = zzbegexpr; zznextpos = zzbegexpr;
if (s){ if (s){
@ -264,7 +264,7 @@ zzreplstr(register zzchar_t *s)
void void
zzgettok() zzgettok()
{ {
register int state, newstate; int state, newstate;
/* last space reserved for the null char */ /* last space reserved for the null char */
zzchar_t *lastpos; /* GPW 1997/09/05 (removed 'register' */ zzchar_t *lastpos; /* GPW 1997/09/05 (removed 'register' */

@ -230,14 +230,14 @@ zzrestore_antlr_state(zzantlr_state *buf)
void void
zzedecode(SetWordType *a) zzedecode(SetWordType *a)
{ {
register SetWordType *p = a; SetWordType *p = a;
register SetWordType *endp = &(p[zzSET_SIZE]); SetWordType *endp = &(p[zzSET_SIZE]);
register unsigned e = 0; unsigned e = 0;
if ( zzset_deg(a)>1 ) fprintf(stderr, " {"); if ( zzset_deg(a)>1 ) fprintf(stderr, " {");
do { do {
register SetWordType t = *p; SetWordType t = *p;
register SetWordType *b = &(bitmask[0]); SetWordType *b = &(bitmask[0]);
do { do {
if ( t & *b ) fprintf(stderr, " %s", zztokens[e]); if ( t & *b ) fprintf(stderr, " %s", zztokens[e]);
e++; e++;
@ -281,15 +281,15 @@ zzset_deg(SetWordType *a)
of elements present in the set. Assumes of elements present in the set. Assumes
that all word bits are used in the set that all word bits are used in the set
*/ */
register SetWordType *p = a; SetWordType *p = a;
register SetWordType *endp = &(a[zzSET_SIZE]); SetWordType *endp = &(a[zzSET_SIZE]);
register int degree = 0; int degree = 0;
if ( a == NULL ) return 0; if ( a == NULL ) return 0;
while ( p < endp ) while ( p < endp )
{ {
register SetWordType t = *p; SetWordType t = *p;
register SetWordType *b = &(bitmask[0]); SetWordType *b = &(bitmask[0]);
do { do {
if (t & *b) ++degree; if (t & *b) ++degree;
} while (++b < &(bitmask[sizeof(SetWordType)*8])); } while (++b < &(bitmask[sizeof(SetWordType)*8]));

@ -175,10 +175,10 @@ zzs_done(void)
} }
void void
zzs_add(char *key, register Sym *rec) zzs_add(char *key, Sym *rec)
{ {
register unsigned int h=0; unsigned int h=0;
register char *p=key; char *p=key;
HASH_FUN(p, h); HASH_FUN(p, h);
rec->hash = h; /* save hash code for fast comp later */ rec->hash = h; /* save hash code for fast comp later */
@ -195,9 +195,9 @@ zzs_add(char *key, register Sym *rec)
Sym * Sym *
zzs_get(char *key) zzs_get(char *key)
{ {
register unsigned int h=0; unsigned int h=0;
register char *p=key; char *p=key;
register Sym *q; Sym *q;
HASH_FUN(p, h); HASH_FUN(p, h);
@ -219,12 +219,12 @@ zzs_get(char *key)
* Will do nothing if all list pointers are NULL * Will do nothing if all list pointers are NULL
*/ */
void void
zzs_del(register Sym *p) zzs_del(Sym *p)
{ {
if ( p == NULL ) {fprintf(stderr, "zzs_del(NULL)\n"); exit(1);} if ( p == NULL ) {fprintf(stderr, "zzs_del(NULL)\n"); exit(1);}
if ( p->prev == NULL ) /* Head of list */ if ( p->prev == NULL ) /* Head of list */
{ {
register Sym **t = p->head; Sym **t = p->head;
if ( t == NULL ) return; /* not part of symbol table */ if ( t == NULL ) return; /* not part of symbol table */
(*t) = p->next; (*t) = p->next;
@ -260,9 +260,9 @@ zzs_scope(Sym **scope)
/* Remove a scope described by 'scope'. Return pointer to 1st element in scope */ /* Remove a scope described by 'scope'. Return pointer to 1st element in scope */
Sym * Sym *
zzs_rmscope(register Sym **scope) zzs_rmscope(Sym **scope)
{ {
register Sym *p; Sym *p;
Sym *start; Sym *start;
if ( scope == NULL ) return(NULL); if ( scope == NULL ) return(NULL);
@ -277,13 +277,13 @@ zzs_stat(void)
{ {
static unsigned short count[20]; static unsigned short count[20];
unsigned int i,n=0,low=0, hi=0; unsigned int i,n=0,low=0, hi=0;
register Sym **p; Sym **p;
float avg=0.0; float avg=0.0;
for (i=0; i<20; i++) count[i] = 0; for (i=0; i<20; i++) count[i] = 0;
for (p=table; p<&(table[size]); p++) for (p=table; p<&(table[size]); p++)
{ {
register Sym *q = *p; Sym *q = *p;
unsigned int len; unsigned int len;
if ( q != NULL && low==0 ) low = p-table; if ( q != NULL && low==0 ) low = p-table;
@ -328,7 +328,7 @@ Sym *
zzs_new(char *text) zzs_new(char *text)
{ {
Sym *p; Sym *p;
char *zzs_strdup(register char *s); char *zzs_strdup(char *s);
if ( (p = (Sym *) calloc(1,sizeof(Sym))) == 0 ) if ( (p = (Sym *) calloc(1,sizeof(Sym))) == 0 )
{ {
@ -353,9 +353,9 @@ zzs_newadd(char *text)
* Bump the pointer into the string table to next avail position. * Bump the pointer into the string table to next avail position.
*/ */
char * char *
zzs_strdup(register char *s) zzs_strdup(char *s)
{ {
register char *start=strp; char *start=strp;
while ( *s != '\0' ) while ( *s != '\0' )
{ {

Loading…
Cancel
Save