diff options
author | ngie <ngie@FreeBSD.org> | 2014-10-12 21:54:55 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-10-12 21:54:55 +0000 |
commit | 58bd819849119cdcc80dcf3601c7fce2ddc14cff (patch) | |
tree | 55f20bac1157f5759c46d95955906aff4e450618 /contrib/netbsd-tests/lib/libc/regex/debug.c | |
parent | 7a7f1f864ed680bdb4c5dff5643a1e7d77a6984f (diff) | |
download | FreeBSD-src-58bd819849119cdcc80dcf3601c7fce2ddc14cff.zip FreeBSD-src-58bd819849119cdcc80dcf3601c7fce2ddc14cff.tar.gz |
Fix compilation errors with missing wide-type headers and fix compilation
warnings with -Wformat
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/regex/debug.c')
-rw-r--r-- | contrib/netbsd-tests/lib/libc/regex/debug.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/regex/debug.c b/contrib/netbsd-tests/lib/libc/regex/debug.c index c1528b9..55655eb 100644 --- a/contrib/netbsd-tests/lib/libc/regex/debug.c +++ b/contrib/netbsd-tests/lib/libc/regex/debug.c @@ -34,6 +34,10 @@ #include <string.h> #include <sys/types.h> +#if defined(__FreeBSD__) +#include <wchar.h> +#include <wctype.h> +#endif /* Don't sort these! */ #include "utils.h" @@ -50,6 +54,7 @@ static char *regchar(int); void regprint(regex_t *r, FILE *d) { +#if defined(__NetBSD__) struct re_guts *g = r->re_g; int c; int last; @@ -111,6 +116,7 @@ regprint(regex_t *r, FILE *d) } fprintf(d, "\n"); } +#endif } /* @@ -171,6 +177,7 @@ s_print(struct re_guts *g, FILE *d) break; case OANYOF: fprintf(d, "[(%ld)", (long)opnd); +#if defined(__NetBSD__) cs = &g->sets[opnd]; last = -1; for (size_t i = 0; i < g->csetsize+1; i++) /* +1 flushes */ @@ -187,6 +194,7 @@ s_print(struct re_guts *g, FILE *d) last = -1; } } +#endif fprintf(d, "]"); break; case OBACK_: @@ -242,7 +250,11 @@ s_print(struct re_guts *g, FILE *d) fprintf(d, ">"); break; default: +#if defined(__FreeBSD__) + fprintf(d, "!%ld(%ld)!", OP(*s), opnd); +#else fprintf(d, "!%d(%d)!", OP(*s), opnd); +#endif break; } if (!done) |