changeset 10456:9c6110615166

[!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.
author Karl Heuer <kwzh@gnu.org>
date Wed, 18 Jan 1995 20:47:36 +0000
parents d5a769d08f88
children 2ab3bd0288a9
files src/regex.c
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Wed Jan 18 20:13:17 1995 +0000
+++ b/src/regex.c	Wed Jan 18 20:47:36 1995 +0000
@@ -86,6 +86,12 @@
 #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 @@
       /* 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 @@
         }
 
       /* 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.  */