]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix malfunctioning cursor display on 32-bit Gtk
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Oct 2018 16:47:28 +0000 (09:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 9 Oct 2018 16:48:37 +0000 (09:48 -0700)
This bug on 32-bit platforms was caused by the timespec_hz
definition going haywire because the C expression
FIXNUM_OVERFLOW_P (MOST_POSITIVE_FIXNUM) did not work in #if.
Eventually the numeric problem showed up as a malfunctioning
cursor (Bug#32992).  Fix the problem with MOST_POSITIVE_FIXNUM.
By the way, make_fixnum should check for integer overflow when
debugging; this would have made it easier to track this bug down.
But one fix at a time.
* src/lisp.h (INTTYPEBITS): Now a macro, so usable in #if.
(MOST_POSITIVE_FIXNUM): Mention it’s used in #if.

src/lisp.h

index ae329268dc495e7e63f83a73a93e138d83c94f11..2c20b483cadd959632d9d342dceb5ac7f65d4203 100644 (file)
@@ -236,13 +236,15 @@ enum Lisp_Bits
     /* Number of bits in a Lisp_Object value, not counting the tag.  */
     VALBITS = EMACS_INT_WIDTH - GCTYPEBITS,
 
-    /* Number of bits in a Lisp fixnum tag.  */
-    INTTYPEBITS = GCTYPEBITS - 1,
-
     /* Number of bits in a Lisp fixnum value, not counting the tag.  */
     FIXNUM_BITS = VALBITS + 1
   };
 
+/* Number of bits in a Lisp fixnum tag; can be used in #if.  */
+DEFINE_GDB_SYMBOL_BEGIN (int, INTTYPEBITS)
+#define INTTYPEBITS (GCTYPEBITS - 1)
+DEFINE_GDB_SYMBOL_END (INTTYPEBITS)
+
 /* The maximum value that can be stored in a EMACS_INT, assuming all
    bits other than the type bits contribute to a nonnegative signed value.
    This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an
@@ -1034,7 +1036,7 @@ enum More_Lisp_Bits
    that cons.  */
 
 /* Largest and smallest representable fixnum values.  These are the C
-   values.  They are macros for use in static initializers.  */
+   values.  They are macros for use in #if and static initializers.  */
 #define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS)
 #define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM)