diff options
author | obrien <obrien@FreeBSD.org> | 2002-03-21 18:49:23 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-03-21 18:49:23 +0000 |
commit | 1196344bb37334ed0f8808056a53ca058758843c (patch) | |
tree | 12b252b7426e8a8904ef257bea10fea6038142f4 /lib/libc/regex | |
parent | 8ee1755c8ef3729bb2d3c4bfae2b85b786fdaf70 (diff) | |
download | FreeBSD-src-1196344bb37334ed0f8808056a53ca058758843c.zip FreeBSD-src-1196344bb37334ed0f8808056a53ca058758843c.tar.gz |
Remove 'register' keyword.
Diffstat (limited to 'lib/libc/regex')
-rw-r--r-- | lib/libc/regex/engine.c | 156 | ||||
-rw-r--r-- | lib/libc/regex/grot/debug.c | 28 | ||||
-rw-r--r-- | lib/libc/regex/grot/main.c | 22 | ||||
-rw-r--r-- | lib/libc/regex/grot/split.c | 34 | ||||
-rw-r--r-- | lib/libc/regex/regcomp.c | 406 | ||||
-rw-r--r-- | lib/libc/regex/regerror.c | 12 | ||||
-rw-r--r-- | lib/libc/regex/regexec.c | 4 | ||||
-rw-r--r-- | lib/libc/regex/regfree.c | 2 |
8 files changed, 334 insertions, 330 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 04844ba..ce0a39d 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -134,33 +134,33 @@ static char *pchar __P((int ch)); /* - matcher - the actual matching engine - == static int matcher(register struct re_guts *g, char *string, \ + == static int matcher(struct re_guts *g, char *string, \ == size_t nmatch, regmatch_t pmatch[], int eflags); */ static int /* 0 success, REG_NOMATCH failure */ matcher(g, string, nmatch, pmatch, eflags) -register struct re_guts *g; +struct re_guts *g; char *string; size_t nmatch; regmatch_t pmatch[]; int eflags; { - register char *endp; - register int i; + char *endp; + int i; struct match mv; - register struct match *m = &mv; - register char *dp; - register const sopno gf = g->firststate+1; /* +1 for OEND */ - register const sopno gl = g->laststate; + struct match *m = &mv; + char *dp; + const sopno gf = g->firststate+1; /* +1 for OEND */ + const sopno gl = g->laststate; char *start; char *stop; /* Boyer-Moore algorithms variables */ - register char *pp; + char *pp; int cj, mj; - register char *mustfirst; - register char *mustlast; - register int *matchjump; - register int *charjump; + char *mustfirst; + char *mustlast; + int *matchjump; + int *charjump; /* simplify the situation where possible */ if (g->cflags®_NOSUB) @@ -345,30 +345,30 @@ int eflags; /* - dissect - figure out what matched what, no back references - == static char *dissect(register struct match *m, char *start, \ + == static char *dissect(struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ static char * /* == stop (success) always */ dissect(m, start, stop, startst, stopst) -register struct match *m; +struct match *m; char *start; char *stop; sopno startst; sopno stopst; { - register int i; - register sopno ss; /* start sop of current subRE */ - register sopno es; /* end sop of current subRE */ - register char *sp; /* start of string matched by it */ - register char *stp; /* string matched by it cannot pass here */ - register char *rest; /* start of rest of string */ - register char *tail; /* string unmatched by rest of RE */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register char *ssp; /* start of string matched by subsubRE */ - register char *sep; /* end of string matched by subsubRE */ - register char *oldssp; /* previous ssp */ - register char *dp; + int i; + sopno ss; /* start sop of current subRE */ + sopno es; /* end sop of current subRE */ + char *sp; /* start of string matched by it */ + char *stp; /* string matched by it cannot pass here */ + char *rest; /* start of rest of string */ + char *tail; /* string unmatched by rest of RE */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *sep; /* end of string matched by subsubRE */ + char *oldssp; /* previous ssp */ + char *dp; AT("diss", start, stop, startst, stopst); sp = start; @@ -533,30 +533,30 @@ sopno stopst; /* - backref - figure out what matched what, figuring in back references - == static char *backref(register struct match *m, char *start, \ + == static char *backref(struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst, sopno lev); */ static char * /* == stop (success) or NULL (failure) */ backref(m, start, stop, startst, stopst, lev) -register struct match *m; +struct match *m; char *start; char *stop; sopno startst; sopno stopst; sopno lev; /* PLUS nesting level */ { - register int i; - register sopno ss; /* start sop of current subRE */ - register char *sp; /* start of string matched by it */ - register sopno ssub; /* start sop of subsubRE */ - register sopno esub; /* end sop of subsubRE */ - register char *ssp; /* start of string matched by subsubRE */ - register char *dp; - register size_t len; - register int hard; - register sop s; - register regoff_t offsave; - register cset *cs; + int i; + sopno ss; /* start sop of current subRE */ + char *sp; /* start of string matched by it */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *dp; + size_t len; + int hard; + sop s; + regoff_t offsave; + cset *cs; AT("back", start, stop, startst, stopst); sp = start; @@ -738,26 +738,26 @@ sopno lev; /* PLUS nesting level */ /* - fast - step through the string at top speed - == static char *fast(register struct match *m, char *start, \ + == static char *fast(struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ static char * /* where tentative match ended, or NULL */ fast(m, start, stop, startst, stopst) -register struct match *m; +struct match *m; char *start; char *stop; sopno startst; sopno stopst; { - register states st = m->st; - register states fresh = m->fresh; - register states tmp = m->tmp; - register char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register char *coldp; /* last p after which no match was underway */ + states st = m->st; + states fresh = m->fresh; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start-1); + int lastc; /* previous c */ + int flagch; + int i; + char *coldp; /* last p after which no match was underway */ CLEAR(st); SET1(st, startst); @@ -829,26 +829,26 @@ sopno stopst; /* - slow - step through the string more deliberately - == static char *slow(register struct match *m, char *start, \ + == static char *slow(struct match *m, char *start, \ == char *stop, sopno startst, sopno stopst); */ static char * /* where it ended */ slow(m, start, stop, startst, stopst) -register struct match *m; +struct match *m; char *start; char *stop; sopno startst; sopno stopst; { - register states st = m->st; - register states empty = m->empty; - register states tmp = m->tmp; - register char *p = start; - register int c = (start == m->beginp) ? OUT : *(start-1); - register int lastc; /* previous c */ - register int flagch; - register int i; - register char *matchp; /* last p at which a match ended */ + states st = m->st; + states empty = m->empty; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start-1); + int lastc; /* previous c */ + int flagch; + int i; + char *matchp; /* last p at which a match ended */ AT("slow", start, stop, startst, stopst); CLEAR(st); @@ -916,8 +916,8 @@ sopno stopst; /* - step - map set of states reachable before char to set reachable after - == static states step(register struct re_guts *g, sopno start, sopno stop, \ - == register states bef, int ch, register states aft); + == static states step(struct re_guts *g, sopno start, sopno stop, \ + == states bef, int ch, states aft); == #define BOL (OUT+1) == #define EOL (BOL+1) == #define BOLEOL (BOL+2) @@ -930,19 +930,19 @@ sopno stopst; */ static states step(g, start, stop, bef, ch, aft) -register struct re_guts *g; +struct re_guts *g; sopno start; /* start state within strip */ sopno stop; /* state after stop state within strip */ -register states bef; /* states reachable before */ +states bef; /* states reachable before */ int ch; /* character or NONCHAR code */ -register states aft; /* states already known reachable after */ +states aft; /* states already known reachable after */ { - register cset *cs; - register sop s; - register sopno pc; - register onestate here; /* note, macros know this name */ - register sopno look; - register int i; + cset *cs; + sop s; + sopno pc; + onestate here; /* note, macros know this name */ + sopno look; + int i; for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { s = g->strip[pc]; @@ -1058,9 +1058,9 @@ states st; int ch; FILE *d; { - register struct re_guts *g = m->g; - register int i; - register int first = 1; + struct re_guts *g = m->g; + int i; + int first = 1; if (!(m->eflags®_TRACE)) return; diff --git a/lib/libc/regex/grot/debug.c b/lib/libc/regex/grot/debug.c index 357f3ea..24bad14 100644 --- a/lib/libc/regex/grot/debug.c +++ b/lib/libc/regex/grot/debug.c @@ -21,10 +21,10 @@ regprint(r, d) regex_t *r; FILE *d; { - register struct re_guts *g = r->re_g; - register int i; - register int c; - register int last; + struct re_guts *g = r->re_g; + int i; + int c; + int last; int nincat[NC]; fprintf(d, "%ld states, %d categories", (long)g->nstates, @@ -87,21 +87,21 @@ FILE *d; /* - s_print - print the strip for debugging - == static void s_print(register struct re_guts *g, FILE *d); + == static void s_print(struct re_guts *g, FILE *d); */ static void s_print(g, d) -register struct re_guts *g; +struct re_guts *g; FILE *d; { - register sop *s; - register cset *cs; - register int i; - register int done = 0; - register sop opnd; - register int col = 0; - register int last; - register sopno offset = 2; + sop *s; + cset *cs; + int i; + int done = 0; + sop opnd; + int col = 0; + int last; + sopno offset = 2; # define GAP() { if (offset % 5 == 0) { \ if (col > 40) { \ fprintf(d, "\n\t"); \ diff --git a/lib/libc/regex/grot/main.c b/lib/libc/regex/grot/main.c index c0a73dc..cb56e48 100644 --- a/lib/libc/regex/grot/main.c +++ b/lib/libc/regex/grot/main.c @@ -37,7 +37,7 @@ char *argv[]; size_t len; int c; int errflg = 0; - register int i; + int i; extern int optind; extern char *optarg; @@ -220,7 +220,7 @@ int opts; /* may not match f1 */ int err; int len; char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE"; - register int i; + int i; char *grump; char f0copy[1000]; char f2copy[1000]; @@ -317,9 +317,9 @@ options(type, s) int type; /* 'c' compile, 'e' exec */ char *s; { - register char *p; - register int o = (type == 'c') ? copts : eopts; - register char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; + char *p; + int o = (type == 'c') ? copts : eopts; + char *legal = (type == 'c') ? "bisnmp" : "^$#tl"; for (p = s; *p != '\0'; p++) if (strchr(legal, *p) != NULL) @@ -379,11 +379,11 @@ char *s; /* - fixstr - transform magic characters in strings - == void fixstr(register char *p); + == void fixstr(char *p); */ void fixstr(p) -register char *p; +char *p; { if (p == NULL) return; @@ -409,11 +409,11 @@ char *str; regmatch_t sub; char *should; { - register int len; - register int shlen; - register char *p; + int len; + int shlen; + char *p; static char grump[500]; - register char *at = NULL; + char *at = NULL; if (should != NULL && strcmp(should, "-") == 0) should = NULL; diff --git a/lib/libc/regex/grot/split.c b/lib/libc/regex/grot/split.c index bcd6a37..e001f39 100644 --- a/lib/libc/regex/grot/split.c +++ b/lib/libc/regex/grot/split.c @@ -14,14 +14,14 @@ char *fields[]; /* list is not NULL-terminated */ int nfields; /* number of entries available in fields[] */ char *sep; /* "" white, "c" single char, "ab" [ab]+ */ { - register char *p = string; - register char c; /* latest character */ - register char sepc = sep[0]; - register char sepc2; - register int fn; - register char **fp = fields; - register char *sepp; - register int trimtrail; + char *p = string; + char c; /* latest character */ + char sepc = sep[0]; + char sepc2; + int fn; + char **fp = fields; + char *sepp; + int trimtrail; /* white space */ if (sepc == '\0') { @@ -155,7 +155,7 @@ int argc; char *argv[]; { char buf[512]; - register int n; + int n; # define MNF 10 char *fields[MNF]; @@ -187,7 +187,7 @@ char *seps; { # define NF 5 char *fields[NF]; - register int nf; + int nf; nf = split(string, fields, NF, seps); print(nf, NF, fields); @@ -198,8 +198,8 @@ int nf; int nfp; char *fields[]; { - register int fn; - register int bound; + int fn; + int bound; bound = (nf > nfp) ? nfp : nf; printf("%d:\t", nf); @@ -279,12 +279,12 @@ struct { regress() { char buf[512]; - register int n; + int n; char *fields[RNF+1]; - register int nf; - register int i; - register int printit; - register char *f; + int nf; + int i; + int printit; + char *f; for (n = 0; tests[n].str != NULL; n++) { (void) strcpy(buf, tests[n].str); diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 602ddb0..f522e40 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -194,10 +194,10 @@ const char *pattern; int cflags; { struct parse pa; - register struct re_guts *g; - register struct parse *p = &pa; - register int i; - register size_t len; + struct re_guts *g; + struct parse *p = &pa; + int i; + size_t len; #ifdef REDEBUG # define GOODFLAGS(f) (f) #else @@ -303,18 +303,18 @@ int cflags; /* - p_ere - ERE parser top level, concatenation and alternation - == static void p_ere(register struct parse *p, int stop); + == static void p_ere(struct parse *p, int stop); */ static void p_ere(p, stop) -register struct parse *p; +struct parse *p; int stop; /* character this ERE should end at */ { - register char c; - register sopno prevback; - register sopno prevfwd; - register sopno conc; - register int first = 1; /* is this the first alternative? */ + char c; + sopno prevback; + sopno prevfwd; + sopno conc; + int first = 1; /* is this the first alternative? */ for (;;) { /* do a bunch of concatenated expressions */ @@ -349,17 +349,17 @@ int stop; /* character this ERE should end at */ /* - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op - == static void p_ere_exp(register struct parse *p); + == static void p_ere_exp(struct parse *p); */ static void p_ere_exp(p) -register struct parse *p; +struct parse *p; { - register char c; - register sopno pos; - register int count; - register int count2; - register sopno subno; + char c; + sopno pos; + int count; + int count2; + sopno subno; int wascaret = 0; assert(MORE()); /* caller should have ensured this */ @@ -498,11 +498,11 @@ register struct parse *p; /* - p_str - string (no metacharacters) "parser" - == static void p_str(register struct parse *p); + == static void p_str(struct parse *p); */ static void p_str(p) -register struct parse *p; +struct parse *p; { (void)REQUIRE(MORE(), REG_EMPTY); while (MORE()) @@ -511,8 +511,8 @@ register struct parse *p; /* - p_bre - BRE parser top level, anchoring and concatenation - == static void p_bre(register struct parse *p, register int end1, \ - == register int end2); + == static void p_bre(struct parse *p, int end1, \ + == int end2); * Giving end1 as OUT essentially eliminates the end1/end2 check. * * This implementation is a bit of a kludge, in that a trailing $ is first @@ -523,13 +523,13 @@ register struct parse *p; */ static void p_bre(p, end1, end2) -register struct parse *p; -register int end1; /* first terminating character */ -register int end2; /* second terminating character */ +struct parse *p; +int end1; /* first terminating character */ +int end2; /* second terminating character */ { - register sopno start = HERE(); - register int first = 1; /* first subexpression? */ - register int wasdollar = 0; + sopno start = HERE(); + int first = 1; /* first subexpression? */ + int wasdollar = 0; if (EAT('^')) { EMIT(OBOL, 0); @@ -552,19 +552,19 @@ register int end2; /* second terminating character */ /* - p_simp_re - parse a simple RE, an atom possibly followed by a repetition - == static int p_simp_re(register struct parse *p, int starordinary); + == static int p_simp_re(struct parse *p, int starordinary); */ static int /* was the simple RE an unbackslashed $? */ p_simp_re(p, starordinary) -register struct parse *p; +struct parse *p; int starordinary; /* is a leading * an ordinary character? */ { - register int c; - register int count; - register int count2; - register sopno pos; - register int i; - register sopno subno; + int c; + int count; + int count2; + sopno pos; + int i; + sopno subno; # define BACKSL (1<<CHAR_BIT) pos = HERE(); /* repetion op, if any, covers from here */ @@ -670,14 +670,14 @@ int starordinary; /* is a leading * an ordinary character? */ /* - p_count - parse a repetition count - == static int p_count(register struct parse *p); + == static int p_count(struct parse *p); */ static int /* the value */ p_count(p) -register struct parse *p; +struct parse *p; { - register int count = 0; - register int ndigits = 0; + int count = 0; + int ndigits = 0; while (MORE() && isdigit((uch)PEEK()) && count <= DUPMAX) { count = count*10 + (GETNEXT() - '0'); @@ -690,17 +690,17 @@ register struct parse *p; /* - p_bracket - parse a bracketed character list - == static void p_bracket(register struct parse *p); + == static void p_bracket(struct parse *p); * * Note a significant property of this code: if the allocset() did SETERROR, * no set operations are done. */ static void p_bracket(p) -register struct parse *p; +struct parse *p; { - register cset *cs = allocset(p); - register int invert = 0; + cset *cs = allocset(p); + int invert = 0; /* Dept of Truly Sickening Special-Case Kludges */ if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) { @@ -730,8 +730,8 @@ register struct parse *p; return; if (p->g->cflags®_ICASE) { - register int i; - register int ci; + int i; + int ci; for (i = p->g->csetsize - 1; i >= 0; i--) if (CHIN(cs, i) && isalpha(i)) { @@ -743,7 +743,7 @@ register struct parse *p; mccase(p, cs); } if (invert) { - register int i; + int i; for (i = p->g->csetsize - 1; i >= 0; i--) if (CHIN(cs, i)) @@ -767,16 +767,16 @@ register struct parse *p; /* - p_b_term - parse one term of a bracketed character list - == static void p_b_term(register struct parse *p, register cset *cs); + == static void p_b_term(struct parse *p, cset *cs); */ static void p_b_term(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register char c; - register char start, finish; - register int i; + char c; + char start, finish; + int i; /* classify what we've got */ switch ((MORE()) ? PEEK() : '\0') { @@ -846,17 +846,17 @@ register cset *cs; /* - p_b_cclass - parse a character-class name and deal with it - == static void p_b_cclass(register struct parse *p, register cset *cs); + == static void p_b_cclass(struct parse *p, cset *cs); */ static void p_b_cclass(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register int c; - register char *sp = p->next; - register struct cclass *cp; - register size_t len; + int c; + char *sp = p->next; + struct cclass *cp; + size_t len; while (MORE() && isalpha((uch)PEEK())) NEXT(); @@ -940,16 +940,16 @@ register cset *cs; /* - p_b_eclass - parse an equivalence-class name and deal with it - == static void p_b_eclass(register struct parse *p, register cset *cs); + == static void p_b_eclass(struct parse *p, cset *cs); * * This implementation is incomplete. xxx */ static void p_b_eclass(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register char c; + char c; c = p_b_coll_elem(p, '='); CHadd(cs, c); @@ -957,13 +957,13 @@ register cset *cs; /* - p_b_symbol - parse a character or [..]ed multicharacter collating symbol - == static char p_b_symbol(register struct parse *p); + == static char p_b_symbol(struct parse *p); */ static char /* value of symbol */ p_b_symbol(p) -register struct parse *p; +struct parse *p; { - register char value; + char value; (void)REQUIRE(MORE(), REG_EBRACK); if (!EATTWO('[', '.')) @@ -977,16 +977,16 @@ register struct parse *p; /* - p_b_coll_elem - parse a collating-element name and look it up - == static char p_b_coll_elem(register struct parse *p, int endc); + == static char p_b_coll_elem(struct parse *p, int endc); */ static char /* value of collating element */ p_b_coll_elem(p, endc) -register struct parse *p; +struct parse *p; int endc; /* name ended by endc,']' */ { - register char *sp = p->next; - register struct cname *cp; - register int len; + char *sp = p->next; + struct cname *cp; + int len; while (MORE() && !SEETWO(endc, ']')) NEXT(); @@ -1024,17 +1024,17 @@ int ch; /* - bothcases - emit a dualcase version of a two-case character - == static void bothcases(register struct parse *p, int ch); + == static void bothcases(struct parse *p, int ch); * * Boy, is this implementation ever a kludge... */ static void bothcases(p, ch) -register struct parse *p; +struct parse *p; int ch; { - register char *oldnext = p->next; - register char *oldend = p->end; + char *oldnext = p->next; + char *oldend = p->end; char bracket[3]; ch = (uch)ch; @@ -1052,14 +1052,14 @@ int ch; /* - ordinary - emit an ordinary character - == static void ordinary(register struct parse *p, register int ch); + == static void ordinary(struct parse *p, int ch); */ static void ordinary(p, ch) -register struct parse *p; -register int ch; +struct parse *p; +int ch; { - register cat_t *cap = p->g->categories; + cat_t *cap = p->g->categories; if ((p->g->cflags®_ICASE) && isalpha((uch)ch) && othercase(ch) != ch) bothcases(p, ch); @@ -1072,16 +1072,16 @@ register int ch; /* - nonnewline - emit REG_NEWLINE version of OANY - == static void nonnewline(register struct parse *p); + == static void nonnewline(struct parse *p); * * Boy, is this implementation ever a kludge... */ static void nonnewline(p) -register struct parse *p; +struct parse *p; { - register char *oldnext = p->next; - register char *oldend = p->end; + char *oldnext = p->next; + char *oldend = p->end; char bracket[4]; p->next = bracket; @@ -1098,21 +1098,21 @@ register struct parse *p; /* - repeat - generate code for a bounded repetition, recursively if needed - == static void repeat(register struct parse *p, sopno start, int from, int to); + == static void repeat(struct parse *p, sopno start, int from, int to); */ static void repeat(p, start, from, to) -register struct parse *p; +struct parse *p; sopno start; /* operand from here to end of strip */ int from; /* repeated from this number */ int to; /* to this number of times (maybe INFINITY) */ { - register sopno finish = HERE(); + sopno finish = HERE(); # define N 2 # define INF 3 # define REP(f, t) ((f)*8 + (t)) # define MAP(n) (((n) <= 1) ? (n) : ((n) == INFINITY) ? INF : N) - register sopno copy; + sopno copy; if (p->error != 0) /* head off possible runaway recursion */ return; @@ -1170,11 +1170,11 @@ int to; /* to this number of times (maybe INFINITY) */ /* - seterr - set an error condition - == static int seterr(register struct parse *p, int e); + == static int seterr(struct parse *p, int e); */ static int /* useless but makes type checking happy */ seterr(p, e) -register struct parse *p; +struct parse *p; int e; { if (p->error == 0) /* keep earliest error condition */ @@ -1186,18 +1186,18 @@ int e; /* - allocset - allocate a set of characters for [] - == static cset *allocset(register struct parse *p); + == static cset *allocset(struct parse *p); */ static cset * allocset(p) -register struct parse *p; +struct parse *p; { - register int no = p->g->ncsets++; - register size_t nc; - register size_t nbytes; - register cset *cs; - register size_t css = (size_t)p->g->csetsize; - register int i; + int no = p->g->ncsets++; + size_t nc; + size_t nbytes; + cset *cs; + size_t css = (size_t)p->g->csetsize; + int i; if (no >= p->ncsalloc) { /* need another column of space */ p->ncsalloc += CHAR_BIT; @@ -1241,16 +1241,16 @@ register struct parse *p; /* - freeset - free a now-unused set - == static void freeset(register struct parse *p, register cset *cs); + == static void freeset(struct parse *p, cset *cs); */ static void freeset(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register int i; - register cset *top = &p->g->sets[p->g->ncsets]; - register size_t css = (size_t)p->g->csetsize; + int i; + cset *top = &p->g->sets[p->g->ncsets]; + size_t css = (size_t)p->g->csetsize; for (i = 0; i < css; i++) CHsub(cs, i); @@ -1260,7 +1260,7 @@ register cset *cs; /* - freezeset - final processing on a set of characters - == static int freezeset(register struct parse *p, register cset *cs); + == static int freezeset(struct parse *p, cset *cs); * * The main task here is merging identical sets. This is usually a waste * of time (although the hash code minimizes the overhead), but can win @@ -1270,14 +1270,14 @@ register cset *cs; */ static int /* set number */ freezeset(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register short h = cs->hash; - register int i; - register cset *top = &p->g->sets[p->g->ncsets]; - register cset *cs2; - register size_t css = (size_t)p->g->csetsize; + short h = cs->hash; + int i; + cset *top = &p->g->sets[p->g->ncsets]; + cset *cs2; + size_t css = (size_t)p->g->csetsize; /* look for an earlier one which is the same */ for (cs2 = &p->g->sets[0]; cs2 < top; cs2++) @@ -1300,15 +1300,15 @@ register cset *cs; /* - firstch - return first character in a set (which must have at least one) - == static int firstch(register struct parse *p, register cset *cs); + == static int firstch(struct parse *p, cset *cs); */ static int /* character; there is no "none" value */ firstch(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register int i; - register size_t css = (size_t)p->g->csetsize; + int i; + size_t css = (size_t)p->g->csetsize; for (i = 0; i < css; i++) if (CHIN(cs, i)) @@ -1319,16 +1319,16 @@ register cset *cs; /* - nch - number of characters in a set - == static int nch(register struct parse *p, register cset *cs); + == static int nch(struct parse *p, cset *cs); */ static int nch(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { - register int i; - register size_t css = (size_t)p->g->csetsize; - register int n = 0; + int i; + size_t css = (size_t)p->g->csetsize; + int n = 0; for (i = 0; i < css; i++) if (CHIN(cs, i)) @@ -1338,16 +1338,16 @@ register cset *cs; /* - mcadd - add a collating element to a cset - == static void mcadd(register struct parse *p, register cset *cs, \ - == register char *cp); + == static void mcadd(struct parse *p, cset *cs, \ + == char *cp); */ static void mcadd(p, cs, cp) -register struct parse *p; -register cset *cs; -register char *cp; +struct parse *p; +cset *cs; +char *cp; { - register size_t oldend = cs->smultis; + size_t oldend = cs->smultis; cs->smultis += strlen(cp) + 1; if (cs->multis == NULL) @@ -1366,15 +1366,15 @@ register char *cp; #if used /* - mcsub - subtract a collating element from a cset - == static void mcsub(register cset *cs, register char *cp); + == static void mcsub(cset *cs, char *cp); */ static void mcsub(cs, cp) -register cset *cs; -register char *cp; +cset *cs; +char *cp; { - register char *fp = mcfind(cs, cp); - register size_t len = strlen(fp); + char *fp = mcfind(cs, cp); + size_t len = strlen(fp); assert(fp != NULL); (void) memmove(fp, fp + len + 1, @@ -1393,26 +1393,26 @@ register char *cp; /* - mcin - is a collating element in a cset? - == static int mcin(register cset *cs, register char *cp); + == static int mcin(cset *cs, char *cp); */ static int mcin(cs, cp) -register cset *cs; -register char *cp; +cset *cs; +char *cp; { return(mcfind(cs, cp) != NULL); } /* - mcfind - find a collating element in a cset - == static char *mcfind(register cset *cs, register char *cp); + == static char *mcfind(cset *cs, char *cp); */ static char * mcfind(cs, cp) -register cset *cs; -register char *cp; +cset *cs; +char *cp; { - register char *p; + char *p; if (cs->multis == NULL) return(NULL); @@ -1425,47 +1425,47 @@ register char *cp; /* - mcinvert - invert the list of collating elements in a cset - == static void mcinvert(register struct parse *p, register cset *cs); + == static void mcinvert(struct parse *p, cset *cs); * * This would have to know the set of possibilities. Implementation * is deferred. */ static void mcinvert(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { assert(cs->multis == NULL); /* xxx */ } /* - mccase - add case counterparts of the list of collating elements in a cset - == static void mccase(register struct parse *p, register cset *cs); + == static void mccase(struct parse *p, cset *cs); * * This would have to know the set of possibilities. Implementation * is deferred. */ static void mccase(p, cs) -register struct parse *p; -register cset *cs; +struct parse *p; +cset *cs; { assert(cs->multis == NULL); /* xxx */ } /* - isinsets - is this character in any sets? - == static int isinsets(register struct re_guts *g, int c); + == static int isinsets(struct re_guts *g, int c); */ static int /* predicate */ isinsets(g, c) -register struct re_guts *g; +struct re_guts *g; int c; { - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc = (uch)c; + uch *col; + int i; + int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; + unsigned uc = (uch)c; for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) if (col[uc] != 0) @@ -1475,19 +1475,19 @@ int c; /* - samesets - are these two characters in exactly the same sets? - == static int samesets(register struct re_guts *g, int c1, int c2); + == static int samesets(struct re_guts *g, int c1, int c2); */ static int /* predicate */ samesets(g, c1, c2) -register struct re_guts *g; +struct re_guts *g; int c1; int c2; { - register uch *col; - register int i; - register int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; - register unsigned uc1 = (uch)c1; - register unsigned uc2 = (uch)c2; + uch *col; + int i; + int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT; + unsigned uc1 = (uch)c1; + unsigned uc2 = (uch)c2; for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize) if (col[uc1] != col[uc2]) @@ -1497,17 +1497,17 @@ int c2; /* - categorize - sort out character categories - == static void categorize(struct parse *p, register struct re_guts *g); + == static void categorize(struct parse *p, struct re_guts *g); */ static void categorize(p, g) struct parse *p; -register struct re_guts *g; +struct re_guts *g; { - register cat_t *cats = g->categories; - register int c; - register int c2; - register cat_t cat; + cat_t *cats = g->categories; + int c; + int c2; + cat_t cat; /* avoid making error situations worse */ if (p->error != 0) @@ -1525,16 +1525,16 @@ register struct re_guts *g; /* - dupl - emit a duplicate of a bunch of sops - == static sopno dupl(register struct parse *p, sopno start, sopno finish); + == static sopno dupl(struct parse *p, sopno start, sopno finish); */ static sopno /* start of duplicate */ dupl(p, start, finish) -register struct parse *p; +struct parse *p; sopno start; /* from here */ sopno finish; /* to this less one */ { - register sopno ret = HERE(); - register sopno len = finish - start; + sopno ret = HERE(); + sopno len = finish - start; assert(finish >= start); if (len == 0) @@ -1549,7 +1549,7 @@ sopno finish; /* to this less one */ /* - doemit - emit a strip operator - == static void doemit(register struct parse *p, sop op, size_t opnd); + == static void doemit(struct parse *p, sop op, size_t opnd); * * It might seem better to implement this as a macro with a function as * hard-case backup, but it's just too big and messy unless there are @@ -1557,7 +1557,7 @@ sopno finish; /* to this less one */ */ static void doemit(p, op, opnd) -register struct parse *p; +struct parse *p; sop op; size_t opnd; { @@ -1579,18 +1579,18 @@ size_t opnd; /* - doinsert - insert a sop into the strip - == static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos); + == static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos); */ static void doinsert(p, op, opnd, pos) -register struct parse *p; +struct parse *p; sop op; size_t opnd; sopno pos; { - register sopno sn; - register sop s; - register int i; + sopno sn; + sop s; + int i; /* avoid making error situations worse */ if (p->error != 0) @@ -1619,12 +1619,12 @@ sopno pos; /* - dofwd - complete a forward reference - == static void dofwd(register struct parse *p, sopno pos, sop value); + == static void dofwd(struct parse *p, sopno pos, sop value); */ static void dofwd(p, pos, value) -register struct parse *p; -register sopno pos; +struct parse *p; +sopno pos; sop value; { /* avoid making error situations worse */ @@ -1637,14 +1637,14 @@ sop value; /* - enlarge - enlarge the strip - == static void enlarge(register struct parse *p, sopno size); + == static void enlarge(struct parse *p, sopno size); */ static void enlarge(p, size) -register struct parse *p; -register sopno size; +struct parse *p; +sopno size; { - register sop *sp; + sop *sp; if (p->ssize >= size) return; @@ -1660,12 +1660,12 @@ register sopno size; /* - stripsnug - compact the strip - == static void stripsnug(register struct parse *p, register struct re_guts *g); + == static void stripsnug(struct parse *p, struct re_guts *g); */ static void stripsnug(p, g) -register struct parse *p; -register struct re_guts *g; +struct parse *p; +struct re_guts *g; { g->nstates = p->slen; g->strip = (sop *)realloc((char *)p->strip, p->slen * sizeof(sop)); @@ -1677,7 +1677,7 @@ register struct re_guts *g; /* - findmust - fill in must and mlen with longest mandatory literal string - == static void findmust(register struct parse *p, register struct re_guts *g); + == static void findmust(struct parse *p, struct re_guts *g); * * This algorithm could do fancy things like analyzing the operands of | * for common subsequences. Someday. This code is simple and finds most @@ -1688,15 +1688,15 @@ register struct re_guts *g; static void findmust(p, g) struct parse *p; -register struct re_guts *g; +struct re_guts *g; { - register sop *scan; + sop *scan; sop *start; - register sop *newstart; - register sopno newlen; - register sop s; - register char *cp; - register sopno i; + sop *newstart; + sopno newlen; + sop s; + char *cp; + sopno i; int offset; int cs, mccs; @@ -1925,7 +1925,7 @@ int mccs; /* - computejumps - compute char jumps for BM scan - == static void computejumps(register struct parse *p, register struct re_guts *g); + == static void computejumps(struct parse *p, struct re_guts *g); * * This algorithm assumes g->must exists and is has size greater than * zero. It's based on the algorithm found on Computer Algorithms by @@ -1969,7 +1969,7 @@ struct re_guts *g; /* - computematchjumps - compute match jumps for BM scan - == static void computematchjumps(register struct parse *p, register struct re_guts *g); + == static void computematchjumps(struct parse *p, struct re_guts *g); * * This algorithm assumes g->must exists and is has size greater than * zero. It's based on the algorithm found on Computer Algorithms by @@ -2054,17 +2054,17 @@ struct re_guts *g; /* - pluscount - count + nesting - == static sopno pluscount(register struct parse *p, register struct re_guts *g); + == static sopno pluscount(struct parse *p, struct re_guts *g); */ static sopno /* nesting depth */ pluscount(p, g) struct parse *p; -register struct re_guts *g; +struct re_guts *g; { - register sop *scan; - register sop s; - register sopno plusnest = 0; - register sopno maxnest = 0; + sop *scan; + sop s; + sopno plusnest = 0; + sopno maxnest = 0; if (p->error != 0) return(0); /* there may not be an OEND */ diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c index b1d151d..97080df 100644 --- a/lib/libc/regex/regerror.c +++ b/lib/libc/regex/regerror.c @@ -40,6 +40,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/types.h> #include <stdio.h> @@ -118,10 +120,10 @@ const regex_t *preg; char *errbuf; size_t errbuf_size; { - register struct rerr *r; - register size_t len; - register int target = errcode &~ REG_ITOA; - register char *s; + struct rerr *r; + size_t len; + int target = errcode &~ REG_ITOA; + char *s; char convbuf[50]; if (errcode == REG_ATOI) @@ -164,7 +166,7 @@ regatoi(preg, localbuf) const regex_t *preg; char *localbuf; { - register struct rerr *r; + struct rerr *r; for (r = rerrs; r->code != 0; r++) if (strcmp(r->name, preg->re_endp) == 0) diff --git a/lib/libc/regex/regexec.c b/lib/libc/regex/regexec.c index 80a7ad0..a23c61c 100644 --- a/lib/libc/regex/regexec.c +++ b/lib/libc/regex/regexec.c @@ -40,6 +40,8 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)regexec.c 8.3 (Berkeley) 3/20/94"; #endif /* LIBC_SCCS and not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); /* * the outer shell of regexec() @@ -160,7 +162,7 @@ size_t nmatch; regmatch_t pmatch[]; int eflags; { - register struct re_guts *g = preg->re_g; + struct re_guts *g = preg->re_g; #ifdef REDEBUG # define GOODFLAGS(f) (f) #else diff --git a/lib/libc/regex/regfree.c b/lib/libc/regex/regfree.c index 4266d1c..41c04b4 100644 --- a/lib/libc/regex/regfree.c +++ b/lib/libc/regex/regfree.c @@ -60,7 +60,7 @@ void regfree(preg) regex_t *preg; { - register struct re_guts *g; + struct re_guts *g; if (preg->re_magic != MAGIC1) /* oops */ return; /* nice to complain, but hard */ |