all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>, Mauro Aranda <maurooaranda@gmail.com>
Cc: 32992-done@debbugs.gnu.org
Subject: bug#32992: 27.0.50; Malfunctioning Cursor display
Date: Tue, 9 Oct 2018 09:51:29 -0700	[thread overview]
Message-ID: <ecc1bcdd-f852-c0e5-3f3e-a3f359e95c06@cs.ucla.edu> (raw)
In-Reply-To: <835zybyx0w.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

Eli Zaretskii wrote:

> Paul, could you please take a look?  Thanks.

I took a look, reproduced the problem on 32-bit Ubuntu 18.04, and installed the 
attached patch. Thanks, Mauro, for reporting it.

[-- Attachment #2: 0001-Fix-malfunctioning-cursor-display-on-32-bit-Gtk.txt --]
[-- Type: text/plain, Size: 2216 bytes --]

From 6111d2b972db9df8251a5649b162f8404c632ee4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 9 Oct 2018 09:47:28 -0700
Subject: [PATCH] Fix malfunctioning cursor display on 32-bit Gtk
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lisp.h b/src/lisp.h
index ae329268dc..2c20b483ca 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -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)
 
-- 
2.17.1


  reply	other threads:[~2018-10-09 16:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 18:45 bug#32992: 27.0.50; Malfunctioning Cursor display Mauro Aranda
2018-10-08 20:11 ` Eli Zaretskii
2018-10-08 20:45   ` Mauro Aranda
2018-10-09 15:12     ` Eli Zaretskii
2018-10-09 16:51       ` Paul Eggert [this message]
2018-10-09 17:52         ` Eli Zaretskii
2018-10-09 18:03           ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecc1bcdd-f852-c0e5-3f3e-a3f359e95c06@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=32992-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=maurooaranda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.