]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove redundant case_Lisp_Int macro
authorStefan Kangas <stefankangas@gmail.com>
Mon, 20 Jan 2025 00:55:19 +0000 (01:55 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 18:51:29 +0000 (19:51 +0100)
The case_Lisp_Int macro was originally introduced with different
definitions depending on USE_2_TAGS_FOR_INTS.  However, since commit
2b5701247845, we have assumed that USE_2_TAGS_FOR_INTS is always
defined, and the macro has only a single definition.  As a result, the
macro is now unnecessary, and replacing it with standard C case labels
improves readability and understanding.

* src/lisp.h (case_Lisp_Int): Delete macro.
* src/alloc.c (process_mark_stack, survives_gc_p):
* src/data.c (Fcl_type_of):
* src/fns.c (value_cmp, sxhash_obj):
* src/pdumper.c (dump_object):
* src/print.c (print_object):
* src/xfaces.c (face_attr_equal_p): Remove uses of above macro.

(cherry picked from commit 278d1994af4c52a5590c793d27d8fd2867fe7a66)

src/alloc.c
src/data.c
src/fns.c
src/lisp.h
src/pdumper.c
src/print.c
src/xfaces.c

index d2d682561399ae4c91d4fa9634b54e7c81023c3d..c4e2ff520154dd6d567f5d98efd01f40980ec06c 100644 (file)
@@ -7383,7 +7383,8 @@ process_mark_stack (ptrdiff_t base_sp)
            break;
          }
 
-       case_Lisp_Int:
+       case Lisp_Int0:
+       case Lisp_Int1:
          break;
 
        default:
@@ -7437,7 +7438,8 @@ survives_gc_p (Lisp_Object obj)
 
   switch (XTYPE (obj))
     {
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       survives_p = true;
       break;
 
index 8236721961f5d4da08ea80aa2fb32dc8514ab5d8..077719c4062190525d7afe3b35ad56e0dc19c575 100644 (file)
@@ -209,7 +209,8 @@ a fixed set of types.  */)
 {
   switch (XTYPE (object))
     {
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       return Qfixnum;
 
     case Lisp_Symbol:
index c13a4b7ffbfc125e9c167b989fab3a9bdb4abae2..7f7de54383a6526456ec4624cc8a96aebab234d2 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3069,7 +3069,8 @@ value_cmp (Lisp_Object a, Lisp_Object b, int maxdepth)
 
   switch (XTYPE (a))
     {
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       {
        EMACS_INT ia = XFIXNUM (a);
        if (FIXNUMP (b))
@@ -5519,7 +5520,8 @@ sxhash_obj (Lisp_Object obj, int depth)
 
   switch (XTYPE (obj))
     {
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       return XUFIXNUM (obj);
 
     case Lisp_Symbol:
index d0354d836299700d368a85eb9715965e08248d0a..0ac1e1933fdd42a997fab789e5db3212db822b24 100644 (file)
@@ -468,7 +468,6 @@ typedef EMACS_INT Lisp_Word;
 /* Fixnums use 2 tags, to give them one extra bit, thus
    extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1.  */
 #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1))
-#define case_Lisp_Int case Lisp_Int0: case Lisp_Int1
 
 /* Idea stolen from GDB.  Pedantic GCC complains about enum bitfields,
    and xlc and Oracle Studio c99 complain vociferously about them.  */
index 97d3d1412b750fade0faea21754b8add1908afee..3c143fdc2c5deaeef4f33c2a5c20ef8fc2b176fa 100644 (file)
@@ -3238,7 +3238,8 @@ dump_object (struct dump_context *ctx, Lisp_Object object)
     case Lisp_Float:
       offset = dump_float (ctx, XFLOAT (object));
       break;
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       eassert ("should not be dumping int: is self-representing" && 0);
       abort ();
     default:
index f990d6a5dc181bc3e8aca6a3bdd988068be5a610..43698f309b192f18b79eea01737554e8c3e82488 100644 (file)
@@ -2291,7 +2291,8 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
 
   switch (XTYPE (obj))
     {
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
       {
         EMACS_INT i = XFIXNUM (obj);
         char escaped_name;
index 5e76e598d845cfa333f1cfcdf020f8ccd9c79634..e9500b98524b7896fb802270f9f985bdcdc46f9c 100644 (file)
@@ -4425,7 +4425,8 @@ face_attr_equal_p (Lisp_Object v1, Lisp_Object v2)
 
       return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0;
 
-    case_Lisp_Int:
+    case Lisp_Int0:
+    case Lisp_Int1:
     case Lisp_Symbol:
       return false;