From 5b9dde0010ffb3a6a69869098d6002626936a61b Mon Sep 17 00:00:00 2001 From: christos Date: Mon, 10 Oct 2011 04:32:41 +0000 Subject: [PATCH] - Use PROGS instead of PROG so that we can co-exist with TESTS_C - Make the helper program compile again. --- tests/lib/libc/regex/Makefile | 6 +++--- tests/lib/libc/regex/debug.c | 24 +++++++++++------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tests/lib/libc/regex/Makefile b/tests/lib/libc/regex/Makefile index f070471c6372..a7dce01e96a5 100644 --- a/tests/lib/libc/regex/Makefile +++ b/tests/lib/libc/regex/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2011/10/09 18:21:08 christos Exp $ +# $NetBSD: Makefile,v 1.3 2011/10/10 04:32:41 christos Exp $ MKMAN= no @@ -7,8 +7,8 @@ MKMAN= no TESTSDIR= ${TESTSBASE}/lib/libc/regex BINDIR= ${TESTSDIR} -PROG= h_regex -SRCS= main.c split.c debug.c +PROGS+= h_regex +SRCS.h_regex= main.c split.c debug.c CPPFLAGS+= -I${NETBSDSRCDIR}/lib/libc/regex TESTS_SH= t_regex diff --git a/tests/lib/libc/regex/debug.c b/tests/lib/libc/regex/debug.c index 23ebea2ba44c..c1528b9e8c95 100644 --- a/tests/lib/libc/regex/debug.c +++ b/tests/lib/libc/regex/debug.c @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.1 2011/01/08 18:10:31 pgoyette Exp $ */ +/* $NetBSD: debug.c,v 1.2 2011/10/10 04:32:41 christos Exp $ */ /*- * Copyright (c) 1993 The NetBSD Foundation, Inc. @@ -51,12 +51,11 @@ void regprint(regex_t *r, FILE *d) { 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, + fprintf(d, "%ld states, %zu categories", (long)g->nstates, g->ncategories); fprintf(d, ", first %ld last %ld", (long)g->firststate, (long)g->laststate); @@ -77,24 +76,24 @@ regprint(regex_t *r, FILE *d) fprintf(d, ", nplus %ld", (long)g->nplus); fprintf(d, "\n"); s_print(g, d); - for (i = 0; i < g->ncategories; i++) { + for (size_t 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++) + for (size_t 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, ", %zu=%s", i, regchar(c)); } fprintf(d, "\n"); - for (i = 1; i < g->ncategories; i++) + for (size_t i = 1; i < g->ncategories; i++) if (nincat[i] != 1) { - fprintf(d, "cc%d\t", i); + fprintf(d, "cc%zu\t", i); last = -1; for (c = CHAR_MIN; c <= CHAR_MAX+1; c++) /* +1 does flush */ if (c <= CHAR_MAX && g->categories[c] == i) { @@ -122,11 +121,10 @@ s_print(struct re_guts *g, FILE *d) { sop *s; cset *cs; - int i; int done = 0; sop opnd; int col = 0; - int last; + ssize_t last; sopno offset = 2; # define GAP() { if (offset % 5 == 0) { \ if (col > 40) { \ @@ -175,7 +173,7 @@ s_print(struct re_guts *g, FILE *d) fprintf(d, "[(%ld)", (long)opnd); cs = &g->sets[opnd]; last = -1; - for (i = 0; i < g->csetsize+1; i++) /* +1 flushes */ + for (size_t i = 0; i < g->csetsize+1; i++) /* +1 flushes */ if (CHIN(cs, i) && i < g->csetsize) { if (last < 0) { fprintf(d, "%s", regchar(i)); @@ -183,9 +181,9 @@ s_print(struct re_guts *g, FILE *d) } } else { if (last >= 0) { - if (last != i-1) + if (last != (ssize_t)i - 1) fprintf(d, "-%s", - regchar(i-1)); + regchar(i - 1)); last = -1; } }