=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/awk/b.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- src/usr.bin/awk/b.c 1999/04/20 17:31:29 1.7 +++ src/usr.bin/awk/b.c 1999/12/08 23:09:45 1.8 @@ -1,4 +1,4 @@ -/* $OpenBSD: b.c,v 1.7 1999/04/20 17:31:29 millert Exp $ */ +/* $OpenBSD: b.c,v 1.8 1999/12/08 23:09:45 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -199,7 +199,7 @@ parent(right(p)) = p; break; default: /* can't happen */ - ERROR "can't happen: unknown type %d in penter", type(p) FATAL; + FATAL("can't happen: unknown type %d in penter", type(p)); break; } } @@ -221,7 +221,7 @@ xfree(p); break; default: /* can't happen */ - ERROR "can't happen: unknown type %d in freetr", type(p) FATAL; + FATAL("can't happen: unknown type %d in freetr", type(p)); break; } } @@ -292,7 +292,7 @@ op = p; if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) - ERROR "out of space for character class [%.10s...] 1", p FATAL; + FATAL("out of space for character class [%.10s...] 1", p); bp = buf; for (i = 0; (c = *p++) != 0; ) { if (c == '\\') { @@ -310,7 +310,7 @@ } while (c < c2) { if (!adjbuf(&buf, &bufsz, bp-buf+2, 100, &bp, 0)) - ERROR "out of space for character class [%.10s...] 2", p FATAL; + FATAL("out of space for character class [%.10s...] 2", p); *bp++ = ++c; i++; } @@ -318,7 +318,7 @@ } } if (!adjbuf(&buf, &bufsz, bp-buf+2, 100, &bp, 0)) - ERROR "out of space for character class [%.10s...] 3", p FATAL; + FATAL("out of space for character class [%.10s...] 3", p); *bp++ = c; i++; } @@ -330,7 +330,7 @@ void overflo(char *s) { - ERROR "regular expression too big: %.30s...", s FATAL; + FATAL("regular expression too big: %.30s...", s); } void cfoll(fa *f, Node *v) /* enter follow set of each leaf of vertex v into lfollow[leaf] */ @@ -370,7 +370,7 @@ cfoll(f,right(v)); break; default: /* can't happen */ - ERROR "can't happen: unknown type %d in cfoll", type(v) FATAL; + FATAL("can't happen: unknown type %d in cfoll", type(v)); } } @@ -411,7 +411,7 @@ if (first(left(p)) == 0 || b == 0) return(0); return(1); } - ERROR "can't happen: unknown type %d in first", type(p) FATAL; /* can't happen */ + FATAL("can't happen: unknown type %d in first", type(p)); /* can't happen */ return(-1); } @@ -584,10 +584,10 @@ lastre = prestr = p; /* prestr points to string to be parsed */ rtok = relex(); if (rtok == '\0') - ERROR "empty regular expression" FATAL; + FATAL("empty regular expression"); np = regexp(); if (rtok != '\0') - ERROR "syntax error in regular expression %s at %s", lastre, prestr FATAL; + FATAL("syntax error in regular expression %s at %s", lastre, prestr); return(np); } @@ -637,9 +637,9 @@ return (unary(np)); } else - ERROR "syntax error in regular expression %s at %s", lastre, prestr FATAL; + FATAL("syntax error in regular expression %s at %s", lastre, prestr); default: - ERROR "illegal primary in regular expression %s at %s", lastre, prestr FATAL; + FATAL("illegal primary in regular expression %s at %s", lastre, prestr); } return 0; /*NOTREACHED*/ } @@ -707,7 +707,7 @@ return CHAR; case '[': if (buf == 0 && (buf = (char *) malloc(bufsz)) == NULL) - ERROR "out of space in reg expr %.10s..", lastre FATAL; + FATAL("out of space in reg expr %.10s..", lastre); bp = buf; if (*prestr == '^') { cflag = 1; @@ -717,17 +717,17 @@ cflag = 0; n = 2 * strlen(prestr)+1; if (!adjbuf(&buf, &bufsz, n, n, &bp, 0)) - ERROR "out of space for reg expr %.10s...", lastre FATAL; + FATAL("out of space for reg expr %.10s...", lastre); for (; ; ) { if ((c = *prestr++) == '\\') { *bp++ = '\\'; if ((c = *prestr++) == '\0') - ERROR "nonterminated character class %.20s...", lastre FATAL; + FATAL("nonterminated character class %.20s...", lastre); *bp++ = c; } else if (c == '\n') { - ERROR "newline in character class %.20s...", lastre FATAL; + FATAL("newline in character class %.20s...", lastre); } else if (c == '\0') { - ERROR "nonterminated character class %.20s", lastre FATAL; + FATAL("nonterminated character class %.20s", lastre); } else if (bp == buf) { /* 1st char is special */ *bp++ = c; } else if (c == ']') { @@ -749,7 +749,7 @@ int *p, *q; if (c < 0) - ERROR "can't happen: neg char %d in cgoto", c FATAL; + FATAL("can't happen: neg char %d in cgoto", c); while (f->accept >= maxsetvec) { /* guessing here! */ maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int));