]> code.delx.au - gnu-emacs/commitdiff
* lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jul 2012 18:56:42 +0000 (11:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Jul 2012 18:56:42 +0000 (11:56 -0700)
This no-op macro hasn't been needed for many years.
* src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.

admin/CPP-DEFINES
src/ChangeLog
src/alloc.c
src/data.c
src/keyboard.c
src/lisp.h
src/regex.c
src/syntax.c
src/xdisp.c

index 9fc7ce3e33d06cb5504e635754a73b8b1730f22f..47963edecab4ea614a051285208bd7d269fd3531 100644 (file)
@@ -61,8 +61,6 @@ SYSTEM_TYPE
 ** Misc macros
 USER_FULL_NAME   If defined, overrides the default pw->pw_gecos for getting at the full user name.  Only MSDOS overrides the default.
 
-** Replace, the definition is trivial: SWITCH_ENUM_CAST
-
 ** Defines from src/s/*.h.  Some of these might not be used in the code anymore, so they can be removed.  The HAVE_* definitions are probably handled by autoconf, so it might be possible to just remove them from src/s/*.h.
 
 
index 7aa4982f6ca7fa64663acb641bfc0390b75533aa..5354c6e29ba7fe6ae76a21f449327810515579a5 100644 (file)
@@ -1,5 +1,9 @@
 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
+       This no-op macro hasn't been needed for many years.
+       * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
+
        Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
        * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
        * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
index 4227b168c6b759b38f2700906f12eb16cf7e6f5f..5b2553c69cc9bc3c640518bb16a7c3e2fb7d42dc 100644 (file)
@@ -5926,7 +5926,7 @@ mark_object (Lisp_Object arg)
 
 #endif /* not GC_CHECK_MARKED_OBJECTS */
 
-  switch (SWITCH_ENUM_CAST (XTYPE (obj)))
+  switch (XTYPE (obj))
     {
     case Lisp_String:
       {
index bef2888a969c4bca01cc77df87a8defd172f4841..fd873b22d4d3cce004ea3a6f61417dbd7b11d815 100644 (file)
@@ -2522,7 +2522,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
   ptrdiff_t ok_args;
   EMACS_INT ok_accum;
 
-  switch (SWITCH_ENUM_CAST (code))
+  switch (code)
     {
     case Alogior:
     case Alogxor:
@@ -2557,7 +2557,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
                                   nargs, args);
       args[argnum] = val;
       next = XINT (args[argnum]);
-      switch (SWITCH_ENUM_CAST (code))
+      switch (code)
        {
        case Aadd:
          if (INT_ADD_OVERFLOW (accum, next))
@@ -2643,7 +2643,7 @@ float_arith_driver (double accum, ptrdiff_t argnum, enum arithop code,
          args[argnum] = val;    /* runs into a compiler bug. */
          next = XINT (args[argnum]);
        }
-      switch (SWITCH_ENUM_CAST (code))
+      switch (code)
        {
        case Aadd:
          accum += next;
index 00e6f4cbbe9df35ad1e64afd99e0cedcc1f60b92..d8533b796c328cf88972685ccf1d365057ef3434 100644 (file)
@@ -5319,7 +5319,7 @@ make_lispy_event (struct input_event *event)
 {
   int i;
 
-  switch (SWITCH_ENUM_CAST (event->kind))
+  switch (event->kind)
     {
       /* A simple keystroke.  */
     case ASCII_KEYSTROKE_EVENT:
index 2690ab90cb098456abfd37005e18166775256733..2d9359abacf1f483d6b366bb3a802bd61e484f6c 100644 (file)
@@ -3319,8 +3319,6 @@ static char const DIRECTORY_SEP = '/';
 #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
 #endif
 
-#define SWITCH_ENUM_CAST(x) (x)
-
 /* Use this to suppress gcc's warnings.  */
 #ifdef lint
 
index 43ee2c45212d4125d0cf59fb5dacd78d12acfa6e..afe3751ea5e85ee2af30bac416e6d1bbae9f9eb1 100644 (file)
@@ -255,8 +255,6 @@ xrealloc (void *block, size_t size)
 /* Sword must be nonzero for the wordchar pattern commands in re_match_2.  */
 enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
 
-#  define SWITCH_ENUM_CAST(x) (x)
-
 /* Dummy macros for non-Emacs environments.  */
 # define CHAR_CHARSET(c) 0
 # define CHARSET_LEADING_CODE_BASE(c) 0
@@ -3913,7 +3911,7 @@ analyse_first (const re_char *p, const re_char *pend, char *fastmap, const int m
         as used for the *? operator.  */
       re_char *p1 = p;
 
-      switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
+      switch (*p++)
        {
        case succeed:
          return 1;
@@ -4088,7 +4086,7 @@ analyse_first (const re_char *p, const re_char *pend, char *fastmap, const int m
               visited.  `re_compile' should make sure this is true.  */
            break;
          p += j;
-         switch (SWITCH_ENUM_CAST ((re_opcode_t) *p))
+         switch (*p)
            {
            case on_failure_jump:
            case on_failure_keep_string_jump:
@@ -4621,7 +4619,7 @@ static int bcmp_translate (re_char *s1, re_char *s2,
 static re_char *
 skip_one_char (const re_char *p)
 {
-  switch (SWITCH_ENUM_CAST (*p++))
+  switch (*p++)
     {
     case anychar:
       break;
@@ -4666,7 +4664,7 @@ skip_noops (const re_char *p, const re_char *pend)
   int mcnt;
   while (p < pend)
     {
-      switch (SWITCH_ENUM_CAST ((re_opcode_t) *p))
+      switch (*p)
        {
        case start_memory:
        case stop_memory:
@@ -4711,7 +4709,7 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, const re_char *p1, const r
 
   op2 = p2 == pend ? succeed : *p2;
 
-  switch (SWITCH_ENUM_CAST (op2))
+  switch (op2)
     {
     case succeed:
     case endbuf:
@@ -4835,7 +4833,7 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, const re_char *p1, const r
       break;
 
     case charset_not:
-      switch (SWITCH_ENUM_CAST (*p1))
+      switch (*p1)
        {
        case exactn:
        case charset:
@@ -5313,7 +5311,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1,
        }
 
       /* Otherwise match next pattern command.  */
-      switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
+      switch (*p++)
        {
        /* Ignore these.  Used to ignore the n of succeed_n's which
           currently have n == 0.  */
@@ -6235,7 +6233,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1,
          /* A restart point is known.  Restore to that state.  */
          DEBUG_PRINT1 ("\nFAIL:\n");
          POP_FAILURE_POINT (str, pat);
-         switch (SWITCH_ENUM_CAST ((re_opcode_t) *pat++))
+         switch (*pat++)
            {
            case on_failure_keep_string_jump:
              assert (str == NULL);
index 14bec9a9c2f48342b05e7ae3f37eed8ab8c605a1..f0e30803deae372183e69e9c4b04371fbbc92a9b 100644 (file)
@@ -1152,7 +1152,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
 
   insert_string ("\twhich means: ");
 
-  switch (SWITCH_ENUM_CAST (code))
+  switch (code)
     {
     case Swhitespace:
       insert_string ("whitespace"); break;
@@ -2525,7 +2525,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
          if (prefix)
            continue;
 
-         switch (SWITCH_ENUM_CAST (code))
+         switch (code)
            {
            case Sescape:
            case Scharquote:
@@ -2702,7 +2702,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
          else if (SYNTAX_FLAGS_PREFIX (syntax))
            continue;
 
-         switch (SWITCH_ENUM_CAST (code))
+         switch (code)
            {
            case Sword:
            case Ssymbol:
@@ -3123,7 +3123,7 @@ do { prev_from = from;                            \
 
       if (SYNTAX_FLAGS_PREFIX (prev_from_syntax))
        continue;
-      switch (SWITCH_ENUM_CAST (code))
+      switch (code)
        {
        case Sescape:
        case Scharquote:
index 83f0ae830f8cacd0f5995e08a808cfa2dc5992fa..e9bf472696d18a2919b5ca615a079425df47926a 100644 (file)
@@ -20414,7 +20414,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
 
   depth++;
 
-  switch (SWITCH_ENUM_CAST (XTYPE (elt)))
+  switch (XTYPE (elt))
     {
     case Lisp_String:
       {