X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=src%2Fregex.c;h=61d324c101a67f3edecc3e17a83d77836a0fbee2;hb=f7e5f0c2935452194ac6bceb527cc329f7f230f8;hp=8cb04ee4e1ca5ae019d926ad09083a30dd2d4734;hpb=a17da6cfe6279dbd4ad4a1ba618f862edb2da6fc;p=sxemacs diff --git a/src/regex.c b/src/regex.c index 8cb04ee..61d324c 100644 --- a/src/regex.c +++ b/src/regex.c @@ -83,6 +83,8 @@ along with this program. If not, see . */ # undef REL_ALLOC #endif +#include "sxe-utils.h" + /* The `emacs' switch turns on certain matching commands that make sense only in Emacs. */ #ifdef emacs @@ -1493,7 +1495,7 @@ typedef struct { string2, size2); \ DEBUG_PRINT1("'\n"); \ \ - pat = (unsigned char *) POP_FAILURE_POINTER(); \ + pat = (const unsigned char*)POP_FAILURE_POINTER(); \ DEBUG_PRINT2 (" Popping pattern %p: ", pat); \ DEBUG_PRINT_COMPILED_PATTERN(bufp, pat, pend); \ \ @@ -3809,8 +3811,11 @@ int re_compile_fastmap(struct re_pattern_buffer *bufp) /* fuck, p isnt const thanks to that * unified range table function below */ #ifdef MULE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" p = (unsigned char*)fail_stack. stack[--fail_stack.avail].pointer; +#pragma GCC diagnostic pop #else p = fail_stack.stack[--fail_stack.avail] .pointer; @@ -5855,6 +5860,7 @@ re_match_2_internal(struct re_pattern_buffer *bufp, re_char * string1, dummy_low_reg, dummy_high_reg, reg_dummy, reg_dummy, reg_info_dummy); + SXE_SET_UNUSED(pdummy), SXE_SET_UNUSED(sdummy); } /* Note fall through. */ @@ -6264,9 +6270,16 @@ re_match_2_internal(struct re_pattern_buffer *bufp, re_char * string1, if (!FAIL_STACK_EMPTY()) { /* A restart point is known. Restore to that state. */ DEBUG_PRINT1("\nFAIL:\n"); - POP_FAILURE_POINT(d, p, lowest_active_reg, + + const unsigned char* cpat = p; + + POP_FAILURE_POINT(d, cpat, lowest_active_reg, highest_active_reg, regstart, regend, reg_info); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-qual" + p = (unsigned char*)cpat; +#pragma GCC diagnostic pop /* If this failure point is a dummy, try the next one. */ if (!p) @@ -6537,6 +6550,7 @@ common_op_match_null_string_p(unsigned char **p, unsigned char *end, case set_number_at: p1 += 4; + break; default: /* All other opcodes mean we cannot match the empty string. */