#define BYTEWIDTH 8 /* In bits. */
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+#define STREQ(s1, s2) (strcmp (s1, s2) == 0)
#undef MAX
#undef MIN
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])); \
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"); \
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. */ \
\
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; \
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.
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;
== Sword || multi_p)
fastmap[j] = 1;
}
+#ifndef UTF2000
}
+#endif
}
#else /* ! MULE */
for (j = 0; j < (1 << BYTEWIDTH); j++)
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;
!= Sword || multi_p)
fastmap[j] = 1;
}
+#ifndef UTF2000
}
+#endif
}
#else /* ! MULE */
for (j = 0; j < (1 << BYTEWIDTH); j++)
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;
highest_active_reg = NO_HIGHEST_ACTIVE_REG;
}
else
- highest_active_reg = r;
- }
+ {
+ highest_active_reg = r;
+
+ /* 98/9/21 jhod: We've also gotta set lowest_active_reg, don't we? */
+ r = 1;
+ while (r < highest_active_reg && !IS_ACTIVE(reg_info[r]))
+ r++;
+ lowest_active_reg = r;
+ }
+ }
/* If just failed to match something this time around with a
group that's operated on by a repetition operator, try to
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;
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
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;
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;
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;
}