summaryrefslogtreecommitdiff
path: root/src/regex.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-01-18 20:47:36 +0000
committerKarl Heuer <kwzh@gnu.org>1995-01-18 20:47:36 +0000
commit089ee837e9a769c9888160363a8b108c2c4b3dd0 (patch)
tree400b94ef860c3063529efbf06a297be9ea102bc7 /src/regex.c
parent7ca41cfc1668840ff90cb7ebb41612de2ef6014b (diff)
downloademacs-089ee837e9a769c9888160363a8b108c2c4b3dd0.tar.gz
[!emacs] (SWITCH_ENUM_CAST): New macro, from emacs/lisp.h
(re_compile_fastmap, re_match_2_internal): Use that macro instead of testing SWITCH_ENUM_BUG.
Diffstat (limited to 'src/regex.c')
-rw-r--r--src/regex.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/regex.c b/src/regex.c
index 9e373a97f46..645b661c208 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -86,6 +86,12 @@ char *realloc ();
#define Sword 1
#endif
+#ifdef SWITCH_ENUM_BUG
+#define SWITCH_ENUM_CAST(x) ((int)(x))
+#else
+#define SWITCH_ENUM_CAST(x) (x)
+#endif
+
#ifdef SYNTAX_TABLE
extern char *re_syntax_table;
@@ -2813,11 +2819,7 @@ re_compile_fastmap (bufp)
/* We should never be about to go beyond the end of the pattern. */
assert (p < pend);
-#ifdef SWITCH_ENUM_BUG
- switch ((int) ((re_opcode_t) *p++))
-#else
- switch ((re_opcode_t) *p++)
-#endif
+ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
{
/* I guess the idea here is to simply not bother with a fastmap
@@ -3770,11 +3772,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
/* Otherwise match next pattern command. */
-#ifdef SWITCH_ENUM_BUG
- switch ((int) ((re_opcode_t) *p++))
-#else
- switch ((re_opcode_t) *p++)
-#endif
+ switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
{
/* Ignore these. Used to ignore the n of succeed_n's which
currently have n == 0. */