From 985a2a93ea9fc4c44149749be05ba03369762954 Mon Sep 17 00:00:00 2001 From: millert <> Date: Thu, 31 Dec 2020 17:20:19 +0000 Subject: Remove unused categories in re_guts; they are written to but never read. From miod@, OK tb@ --- src/regress/lib/libc/regex/debug.c | 41 ++------------------------------------ 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libc/regex/debug.c b/src/regress/lib/libc/regex/debug.c index 11129e7249..7044a2a185 100644 --- a/src/regress/lib/libc/regex/debug.c +++ b/src/regress/lib/libc/regex/debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: debug.c,v 1.4 2003/07/31 21:48:03 deraadt Exp $ */ +/* $OpenBSD: debug.c,v 1.5 2020/12/31 17:20:19 millert Exp $ */ /* $NetBSD: debug.c,v 1.2 1995/04/20 22:39:42 cgd Exp $ */ #include @@ -26,10 +26,8 @@ FILE *d; register int i; register int c; register int last; - int nincat[NC]; - fprintf(d, "%ld states, %d categories", (long)g->nstates, - g->ncategories); + fprintf(d, "%ld states", (long)g->nstates); fprintf(d, ", first %ld last %ld", (long)g->firststate, (long)g->laststate); if (g->iflags&USEBOL) @@ -49,41 +47,6 @@ FILE *d; fprintf(d, ", nplus %ld", (long)g->nplus); fprintf(d, "\n"); s_print(g, d); - for (i = 0; i < g->ncategories; i++) { - nincat[i] = 0; - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - nincat[i]++; - } - fprintf(d, "cc0#%d", nincat[0]); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] == 1) { - for (c = CHAR_MIN; c <= CHAR_MAX; c++) - if (g->categories[c] == i) - break; - fprintf(d, ", %d=%s", i, regchar(c)); - } - fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) - if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); - last = -1; - for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ - if (c <= CHAR_MAX && g->categories[c] == i) { - if (last < 0) { - fprintf(d, "%s", regchar(c)); - last = c; - } - } else { - if (last >= 0) { - if (last != c-1) - fprintf(d, "-%s", - regchar(c-1)); - last = -1; - } - } - fprintf(d, "\n"); - } } /* -- cgit v1.2.3-55-g6feb