Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2014 21:54:56 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273011 - head/contrib/netbsd-tests/lib/libc/regex
Message-ID:  <201410122154.s9CLsu76001577@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Oct 12 21:54:55 2014
New Revision: 273011
URL: https://svnweb.freebsd.org/changeset/base/273011

Log:
  Fix compilation errors with missing wide-type headers and fix compilation
  warnings with -Wformat
  
  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/regex/debug.c

Modified: head/contrib/netbsd-tests/lib/libc/regex/debug.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/regex/debug.c	Sun Oct 12 21:53:13 2014	(r273010)
+++ head/contrib/netbsd-tests/lib/libc/regex/debug.c	Sun Oct 12 21:54:55 2014	(r273011)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410122154.s9CLsu76001577>