X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fregex.c;h=c5cdf344da00da82fe82cbb5ca4e968c451dc160;hb=f8c889244f022ae695ea8dc67267499286921903;hp=b8e9b25453ab6ecaeec2fe37aaea480aaf1ac8dc;hpb=669565bfdc5d704dfb1d5ac1a0ec01fb3615a1ae;p=chise%2Fxemacs-chise.git- diff --git a/src/regex.c b/src/regex.c index b8e9b25..c5cdf34 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1284,14 +1284,14 @@ typedef struct DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ DEBUG_STATEMENT (num_regs_pushed++); \ \ - DEBUG_PRINT2 (" start: 0x%p\n", regstart[this_reg]); \ + DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ PUSH_FAILURE_POINTER (regstart[this_reg]); \ \ - DEBUG_PRINT2 (" end: 0x%p\n", regend[this_reg]); \ + DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ PUSH_FAILURE_POINTER (regend[this_reg]); \ \ DEBUG_PRINT2 (" info: 0x%lx\n ", \ - * (unsigned long *) (®_info[this_reg])); \ + * (long *) (®_info[this_reg])); \ DEBUG_PRINT2 (" match_null=%d", \ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ @@ -1309,11 +1309,11 @@ typedef struct DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ PUSH_FAILURE_INT (highest_active_reg); \ \ - DEBUG_PRINT2 (" Pushing pattern 0x%p: ", pattern_place); \ + DEBUG_PRINT2 (" Pushing pattern 0x%lx: ", (long) pattern_place); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ PUSH_FAILURE_POINTER (pattern_place); \ \ - DEBUG_PRINT2 (" Pushing string 0x%p: `", string_place); \ + DEBUG_PRINT2 (" Pushing string 0x%lx: `", (long) string_place); \ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ size2); \ DEBUG_PRINT1 ("'\n"); \ @@ -1387,12 +1387,12 @@ typedef struct if (string_temp != NULL) \ str = (CONST char *) string_temp; \ \ - DEBUG_PRINT2 (" Popping string 0x%p: `", str); \ + DEBUG_PRINT2 (" Popping string 0x%lx: `", (long) str); \ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ DEBUG_PRINT1 ("'\n"); \ \ pat = (unsigned char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" Popping pattern 0x%p: ", pat); \ + DEBUG_PRINT2 (" Popping pattern 0x%lx: ", (long) pat); \ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ @@ -1408,13 +1408,13 @@ typedef struct \ reg_info[this_reg].word = POP_FAILURE_ELT (); \ DEBUG_PRINT2 (" info: 0x%lx\n", \ - * (unsigned long *) ®_info[this_reg]); \ + * (long *) ®_info[this_reg]); \ \ regend[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" end: 0x%p\n", regend[this_reg]); \ + DEBUG_PRINT2 (" end: 0x%lx\n", (long) regend[this_reg]); \ \ regstart[this_reg] = (CONST char *) POP_FAILURE_POINTER (); \ - DEBUG_PRINT2 (" start: 0x%p\n", regstart[this_reg]); \ + DEBUG_PRINT2 (" start: 0x%lx\n", (long) regstart[this_reg]); \ } \ \ set_regs_matched_done = 0; \ @@ -3315,11 +3315,15 @@ compile_extended_range (CONST char **p_ptr, CONST char *pend, char *translate, return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; /* Can't have ranges spanning different charsets, except maybe for - ranges entirely witin the first 256 chars. */ + ranges entirely within the first 256 chars. */ if ((range_start >= 0x100 || range_end >= 0x100) - && CHAR_LEADING_BYTE (range_start) != - CHAR_LEADING_BYTE (range_end)) +#ifdef UTF2000 + && CHAR_CHARSET_ID (range_start) != CHAR_CHARSET_ID (range_end) +#else + && CHAR_LEADING_BYTE (range_start) != CHAR_LEADING_BYTE (range_end) +#endif + ) return REG_ERANGESPAN; /* As advertised, translations only work over the 0 - 0x7F range. @@ -3605,11 +3609,13 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) fastmap[j] = 1; for (j = 0x80; j < 0xA0; j++) { +#ifndef UTF2000 if (LEADING_BYTE_PREFIX_P(j)) /* too complicated to calculate this right */ fastmap[j] = 1; else { +#endif int multi_p; Lisp_Object cset; @@ -3621,7 +3627,9 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) == Sword || multi_p) fastmap[j] = 1; } +#ifndef UTF2000 } +#endif } #else /* ! MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) @@ -3646,11 +3654,13 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) fastmap[j] = 1; for (j = 0x80; j < 0xA0; j++) { +#ifndef UTF2000 if (LEADING_BYTE_PREFIX_P(j)) /* too complicated to calculate this right */ fastmap[j] = 1; else { +#endif int multi_p; Lisp_Object cset; @@ -3662,7 +3672,9 @@ re_compile_fastmap (struct re_pattern_buffer *bufp) != Sword || multi_p) fastmap[j] = 1; } +#ifndef UTF2000 } +#endif } #else /* ! MULE */ for (j = 0; j < (1 << BYTEWIDTH); j++) @@ -4473,7 +4485,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, fails at this starting point in the input data. */ for (;;) { - DEBUG_PRINT2 ("\n0x%p: ", p); + DEBUG_PRINT2 ("\n0x%lx: ", (long) p); #ifdef emacs /* XEmacs added, w/removal of immediate_quit */ if (!no_quit_in_re_search) QUIT; @@ -5084,7 +5096,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%p):\n", mcnt, p + mcnt); + DEBUG_PRINT3 (" %d (to 0x%lx):\n", mcnt, (long) (p + mcnt)); PUSH_FAILURE_POINT (p + mcnt, (char *) 0, -2); break; @@ -5107,7 +5119,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, DEBUG_PRINT1 ("EXECUTING on_failure_jump"); EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" %d (to 0x%p)", mcnt, p + mcnt); + DEBUG_PRINT3 (" %d (to 0x%lx)", mcnt, (long) (p + mcnt)); /* If this on_failure_jump comes right before a group (i.e., the original * applied to a group), save the information @@ -5322,7 +5334,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); p += mcnt; /* Do the jump. */ - DEBUG_PRINT2 ("(to 0x%p).\n", p); + DEBUG_PRINT2 ("(to 0x%lx).\n", (long) p); break; @@ -5371,11 +5383,12 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, mcnt--; p += 2; STORE_NUMBER_AND_INCR (p, mcnt); - DEBUG_PRINT3 (" Setting 0x%p to %d.\n", p, mcnt); + DEBUG_PRINT3 (" Setting 0x%lx to %d.\n", (long) p, mcnt); } else if (mcnt == 0) { - DEBUG_PRINT2 (" Setting two bytes from 0x%p to no_op.\n", p+2); + DEBUG_PRINT2 (" Setting two bytes from 0x%lx to no_op.\n", + (long) (p+2)); p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; goto on_failure; @@ -5405,7 +5418,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, CONST char *string1, EXTRACT_NUMBER_AND_INCR (mcnt, p); p1 = p + mcnt; EXTRACT_NUMBER_AND_INCR (mcnt, p); - DEBUG_PRINT3 (" Setting 0x%p to %d.\n", p1, mcnt); + DEBUG_PRINT3 (" Setting 0x%lx to %d.\n", (long) p1, mcnt); STORE_NUMBER (p1, mcnt); break; }