aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-07-30 11:56:42 -0700
committerPaul Eggert2012-07-30 11:56:42 -0700
commit7393bcbb8bf25c97aed35079da765436d4e9fc03 (patch)
tree0dda0e5bacb8115b1103c07a9abd13dc5ba80c87
parentc32af1e4a04ef689097f73430982b28392d72372 (diff)
downloademacs-7393bcbb8bf25c97aed35079da765436d4e9fc03.tar.gz
emacs-7393bcbb8bf25c97aed35079da765436d4e9fc03.zip
* 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.
-rw-r--r--admin/CPP-DEFINES2
-rw-r--r--src/ChangeLog4
-rw-r--r--src/alloc.c2
-rw-r--r--src/data.c6
-rw-r--r--src/keyboard.c2
-rw-r--r--src/lisp.h2
-rw-r--r--src/regex.c18
-rw-r--r--src/syntax.c8
-rw-r--r--src/xdisp.c2
9 files changed, 22 insertions, 24 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 9fc7ce3e33d..47963edecab 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -61,8 +61,6 @@ SYSTEM_TYPE
61** Misc macros 61** Misc macros
62USER_FULL_NAME If defined, overrides the default pw->pw_gecos for getting at the full user name. Only MSDOS overrides the default. 62USER_FULL_NAME If defined, overrides the default pw->pw_gecos for getting at the full user name. Only MSDOS overrides the default.
63 63
64** Replace, the definition is trivial: SWITCH_ENUM_CAST
65
66** 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. 64** 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.
67 65
68 66
diff --git a/src/ChangeLog b/src/ChangeLog
index 7aa4982f6ca..5354c6e29ba 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12012-07-30 Paul Eggert <eggert@cs.ucla.edu> 12012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4 This no-op macro hasn't been needed for many years.
5 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
6
3 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB. 7 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits. 8 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for 9 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
diff --git a/src/alloc.c b/src/alloc.c
index 4227b168c6b..5b2553c69cc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5926,7 +5926,7 @@ mark_object (Lisp_Object arg)
5926 5926
5927#endif /* not GC_CHECK_MARKED_OBJECTS */ 5927#endif /* not GC_CHECK_MARKED_OBJECTS */
5928 5928
5929 switch (SWITCH_ENUM_CAST (XTYPE (obj))) 5929 switch (XTYPE (obj))
5930 { 5930 {
5931 case Lisp_String: 5931 case Lisp_String:
5932 { 5932 {
diff --git a/src/data.c b/src/data.c
index bef2888a969..fd873b22d4d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2522,7 +2522,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
2522 ptrdiff_t ok_args; 2522 ptrdiff_t ok_args;
2523 EMACS_INT ok_accum; 2523 EMACS_INT ok_accum;
2524 2524
2525 switch (SWITCH_ENUM_CAST (code)) 2525 switch (code)
2526 { 2526 {
2527 case Alogior: 2527 case Alogior:
2528 case Alogxor: 2528 case Alogxor:
@@ -2557,7 +2557,7 @@ arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
2557 nargs, args); 2557 nargs, args);
2558 args[argnum] = val; 2558 args[argnum] = val;
2559 next = XINT (args[argnum]); 2559 next = XINT (args[argnum]);
2560 switch (SWITCH_ENUM_CAST (code)) 2560 switch (code)
2561 { 2561 {
2562 case Aadd: 2562 case Aadd:
2563 if (INT_ADD_OVERFLOW (accum, next)) 2563 if (INT_ADD_OVERFLOW (accum, next))
@@ -2643,7 +2643,7 @@ float_arith_driver (double accum, ptrdiff_t argnum, enum arithop code,
2643 args[argnum] = val; /* runs into a compiler bug. */ 2643 args[argnum] = val; /* runs into a compiler bug. */
2644 next = XINT (args[argnum]); 2644 next = XINT (args[argnum]);
2645 } 2645 }
2646 switch (SWITCH_ENUM_CAST (code)) 2646 switch (code)
2647 { 2647 {
2648 case Aadd: 2648 case Aadd:
2649 accum += next; 2649 accum += next;
diff --git a/src/keyboard.c b/src/keyboard.c
index 00e6f4cbbe9..d8533b796c3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -5319,7 +5319,7 @@ make_lispy_event (struct input_event *event)
5319{ 5319{
5320 int i; 5320 int i;
5321 5321
5322 switch (SWITCH_ENUM_CAST (event->kind)) 5322 switch (event->kind)
5323 { 5323 {
5324 /* A simple keystroke. */ 5324 /* A simple keystroke. */
5325 case ASCII_KEYSTROKE_EVENT: 5325 case ASCII_KEYSTROKE_EVENT:
diff --git a/src/lisp.h b/src/lisp.h
index 2690ab90cb0..2d9359abacf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3319,8 +3319,6 @@ static char const DIRECTORY_SEP = '/';
3319#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_)) 3319#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
3320#endif 3320#endif
3321 3321
3322#define SWITCH_ENUM_CAST(x) (x)
3323
3324/* Use this to suppress gcc's warnings. */ 3322/* Use this to suppress gcc's warnings. */
3325#ifdef lint 3323#ifdef lint
3326 3324
diff --git a/src/regex.c b/src/regex.c
index 43ee2c45212..afe3751ea5e 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -255,8 +255,6 @@ xrealloc (void *block, size_t size)
255/* Sword must be nonzero for the wordchar pattern commands in re_match_2. */ 255/* Sword must be nonzero for the wordchar pattern commands in re_match_2. */
256enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; 256enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
257 257
258# define SWITCH_ENUM_CAST(x) (x)
259
260/* Dummy macros for non-Emacs environments. */ 258/* Dummy macros for non-Emacs environments. */
261# define CHAR_CHARSET(c) 0 259# define CHAR_CHARSET(c) 0
262# define CHARSET_LEADING_CODE_BASE(c) 0 260# 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
3913 as used for the *? operator. */ 3911 as used for the *? operator. */
3914 re_char *p1 = p; 3912 re_char *p1 = p;
3915 3913
3916 switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) 3914 switch (*p++)
3917 { 3915 {
3918 case succeed: 3916 case succeed:
3919 return 1; 3917 return 1;
@@ -4088,7 +4086,7 @@ analyse_first (const re_char *p, const re_char *pend, char *fastmap, const int m
4088 visited. `re_compile' should make sure this is true. */ 4086 visited. `re_compile' should make sure this is true. */
4089 break; 4087 break;
4090 p += j; 4088 p += j;
4091 switch (SWITCH_ENUM_CAST ((re_opcode_t) *p)) 4089 switch (*p)
4092 { 4090 {
4093 case on_failure_jump: 4091 case on_failure_jump:
4094 case on_failure_keep_string_jump: 4092 case on_failure_keep_string_jump:
@@ -4621,7 +4619,7 @@ static int bcmp_translate (re_char *s1, re_char *s2,
4621static re_char * 4619static re_char *
4622skip_one_char (const re_char *p) 4620skip_one_char (const re_char *p)
4623{ 4621{
4624 switch (SWITCH_ENUM_CAST (*p++)) 4622 switch (*p++)
4625 { 4623 {
4626 case anychar: 4624 case anychar:
4627 break; 4625 break;
@@ -4666,7 +4664,7 @@ skip_noops (const re_char *p, const re_char *pend)
4666 int mcnt; 4664 int mcnt;
4667 while (p < pend) 4665 while (p < pend)
4668 { 4666 {
4669 switch (SWITCH_ENUM_CAST ((re_opcode_t) *p)) 4667 switch (*p)
4670 { 4668 {
4671 case start_memory: 4669 case start_memory:
4672 case stop_memory: 4670 case stop_memory:
@@ -4711,7 +4709,7 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, const re_char *p1, const r
4711 4709
4712 op2 = p2 == pend ? succeed : *p2; 4710 op2 = p2 == pend ? succeed : *p2;
4713 4711
4714 switch (SWITCH_ENUM_CAST (op2)) 4712 switch (op2)
4715 { 4713 {
4716 case succeed: 4714 case succeed:
4717 case endbuf: 4715 case endbuf:
@@ -4835,7 +4833,7 @@ mutually_exclusive_p (struct re_pattern_buffer *bufp, const re_char *p1, const r
4835 break; 4833 break;
4836 4834
4837 case charset_not: 4835 case charset_not:
4838 switch (SWITCH_ENUM_CAST (*p1)) 4836 switch (*p1)
4839 { 4837 {
4840 case exactn: 4838 case exactn:
4841 case charset: 4839 case charset:
@@ -5313,7 +5311,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1,
5313 } 5311 }
5314 5312
5315 /* Otherwise match next pattern command. */ 5313 /* Otherwise match next pattern command. */
5316 switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++)) 5314 switch (*p++)
5317 { 5315 {
5318 /* Ignore these. Used to ignore the n of succeed_n's which 5316 /* Ignore these. Used to ignore the n of succeed_n's which
5319 currently have n == 0. */ 5317 currently have n == 0. */
@@ -6235,7 +6233,7 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const re_char *string1,
6235 /* A restart point is known. Restore to that state. */ 6233 /* A restart point is known. Restore to that state. */
6236 DEBUG_PRINT1 ("\nFAIL:\n"); 6234 DEBUG_PRINT1 ("\nFAIL:\n");
6237 POP_FAILURE_POINT (str, pat); 6235 POP_FAILURE_POINT (str, pat);
6238 switch (SWITCH_ENUM_CAST ((re_opcode_t) *pat++)) 6236 switch (*pat++)
6239 { 6237 {
6240 case on_failure_keep_string_jump: 6238 case on_failure_keep_string_jump:
6241 assert (str == NULL); 6239 assert (str == NULL);
diff --git a/src/syntax.c b/src/syntax.c
index 14bec9a9c2f..f0e30803dea 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1152,7 +1152,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
1152 1152
1153 insert_string ("\twhich means: "); 1153 insert_string ("\twhich means: ");
1154 1154
1155 switch (SWITCH_ENUM_CAST (code)) 1155 switch (code)
1156 { 1156 {
1157 case Swhitespace: 1157 case Swhitespace:
1158 insert_string ("whitespace"); break; 1158 insert_string ("whitespace"); break;
@@ -2525,7 +2525,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
2525 if (prefix) 2525 if (prefix)
2526 continue; 2526 continue;
2527 2527
2528 switch (SWITCH_ENUM_CAST (code)) 2528 switch (code)
2529 { 2529 {
2530 case Sescape: 2530 case Sescape:
2531 case Scharquote: 2531 case Scharquote:
@@ -2702,7 +2702,7 @@ scan_lists (register EMACS_INT from, EMACS_INT count, EMACS_INT depth, int sexpf
2702 else if (SYNTAX_FLAGS_PREFIX (syntax)) 2702 else if (SYNTAX_FLAGS_PREFIX (syntax))
2703 continue; 2703 continue;
2704 2704
2705 switch (SWITCH_ENUM_CAST (code)) 2705 switch (code)
2706 { 2706 {
2707 case Sword: 2707 case Sword:
2708 case Ssymbol: 2708 case Ssymbol:
@@ -3123,7 +3123,7 @@ do { prev_from = from; \
3123 3123
3124 if (SYNTAX_FLAGS_PREFIX (prev_from_syntax)) 3124 if (SYNTAX_FLAGS_PREFIX (prev_from_syntax))
3125 continue; 3125 continue;
3126 switch (SWITCH_ENUM_CAST (code)) 3126 switch (code)
3127 { 3127 {
3128 case Sescape: 3128 case Sescape:
3129 case Scharquote: 3129 case Scharquote:
diff --git a/src/xdisp.c b/src/xdisp.c
index 83f0ae830f8..e9bf472696d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20414,7 +20414,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
20414 20414
20415 depth++; 20415 depth++;
20416 20416
20417 switch (SWITCH_ENUM_CAST (XTYPE (elt))) 20417 switch (XTYPE (elt))
20418 { 20418 {
20419 case Lisp_String: 20419 case Lisp_String:
20420 { 20420 {