Browse code

bb11748 Fix compile warning is regex_pcre.c on Mac OS X.

Steven Morgan authored on 2017/02/15 04:31:23
Showing 1 changed files
... ...
@@ -264,7 +264,7 @@ int cli_pcre_match(struct cli_pcre_data *pd, const unsigned char *buffer, uint32
264 264
         results->match[0] = results->match[1] = 0;
265 265
     }
266 266
 #else
267
-    rc = pcre_exec(pd->re, pd->ex, buffer, buflen, startoffset, options, results->ovector, OVECCOUNT);
267
+    rc = pcre_exec(pd->re, pd->ex, (const char *)buffer, buflen, startoffset, options, results->ovector, OVECCOUNT);
268 268
     if (rc < 0 && rc != PCRE_ERROR_NOMATCH) {
269 269
         switch (rc) {
270 270
         case PCRE_ERROR_CALLOUT:
... ...
@@ -332,7 +332,7 @@ static void named_substr_print(const struct cli_pcre_data *pd, const unsigned ch
332 332
         for (i = 0; i < namecount; i++) {
333 333
             int n = (tabptr[0] << 8) | tabptr[1];
334 334
 
335
-            start = buffer + ovector[2*n];
335
+            start = (const char *)buffer + ovector[2*n];
336 336
             length = ovector[2*n+1] - ovector[2*n];
337 337
 
338 338
             trunc = 0;
... ...
@@ -380,7 +380,7 @@ void cli_pcre_report(const struct cli_pcre_data *pd, const unsigned char *buffer
380 380
         if (rc > 0) {
381 381
             /* print out full-match and capture groups */
382 382
             for (i = 0; i < rc; ++i) {
383
-                start = buffer + ovector[2*i];
383
+                start = (const char *)buffer + ovector[2*i];
384 384
                 length = ovector[2*i+1] - ovector[2*i];
385 385
 
386 386
                 if (ovector[2*i+1] > buflen) {