diff options
| author | Paul Eggert | 2018-10-09 09:47:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-10-09 09:48:37 -0700 |
| commit | 1f88943924d4e5c98e209790ee8c69b8ab8621d0 (patch) | |
| tree | 35c181bcb92a43dd5e8815148339b825ec58ad6b /src | |
| parent | bd013a448b152a84cff9b18292d8272faf265447 (diff) | |
| download | emacs-1f88943924d4e5c98e209790ee8c69b8ab8621d0.tar.gz emacs-1f88943924d4e5c98e209790ee8c69b8ab8621d0.zip | |
Fix malfunctioning cursor display on 32-bit Gtk
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lisp.h b/src/lisp.h index ae329268dc4..2c20b483cad 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -236,13 +236,15 @@ enum Lisp_Bits | |||
| 236 | /* Number of bits in a Lisp_Object value, not counting the tag. */ | 236 | /* Number of bits in a Lisp_Object value, not counting the tag. */ |
| 237 | VALBITS = EMACS_INT_WIDTH - GCTYPEBITS, | 237 | VALBITS = EMACS_INT_WIDTH - GCTYPEBITS, |
| 238 | 238 | ||
| 239 | /* Number of bits in a Lisp fixnum tag. */ | ||
| 240 | INTTYPEBITS = GCTYPEBITS - 1, | ||
| 241 | |||
| 242 | /* Number of bits in a Lisp fixnum value, not counting the tag. */ | 239 | /* Number of bits in a Lisp fixnum value, not counting the tag. */ |
| 243 | FIXNUM_BITS = VALBITS + 1 | 240 | FIXNUM_BITS = VALBITS + 1 |
| 244 | }; | 241 | }; |
| 245 | 242 | ||
| 243 | /* Number of bits in a Lisp fixnum tag; can be used in #if. */ | ||
| 244 | DEFINE_GDB_SYMBOL_BEGIN (int, INTTYPEBITS) | ||
| 245 | #define INTTYPEBITS (GCTYPEBITS - 1) | ||
| 246 | DEFINE_GDB_SYMBOL_END (INTTYPEBITS) | ||
| 247 | |||
| 246 | /* The maximum value that can be stored in a EMACS_INT, assuming all | 248 | /* The maximum value that can be stored in a EMACS_INT, assuming all |
| 247 | bits other than the type bits contribute to a nonnegative signed value. | 249 | bits other than the type bits contribute to a nonnegative signed value. |
| 248 | This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an | 250 | This can be used in #if, e.g., '#if USE_LSB_TAG' below expands to an |
| @@ -1034,7 +1036,7 @@ enum More_Lisp_Bits | |||
| 1034 | that cons. */ | 1036 | that cons. */ |
| 1035 | 1037 | ||
| 1036 | /* Largest and smallest representable fixnum values. These are the C | 1038 | /* Largest and smallest representable fixnum values. These are the C |
| 1037 | values. They are macros for use in static initializers. */ | 1039 | values. They are macros for use in #if and static initializers. */ |
| 1038 | #define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS) | 1040 | #define MOST_POSITIVE_FIXNUM (EMACS_INT_MAX >> INTTYPEBITS) |
| 1039 | #define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM) | 1041 | #define MOST_NEGATIVE_FIXNUM (-1 - MOST_POSITIVE_FIXNUM) |
| 1040 | 1042 | ||