From f8c86b69a8489f33709de6b869be369a34d5adb0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 12 Jun 2011 18:35:47 -0700 Subject: [PATCH] * composite.c: Use int, not EMACS_INT, for characters. (fill_gstring_body, composition_compute_stop_pos): Use int, not EMACS_INT, for values that are known to be in character range. This doesn't fix any bugs but is the usual style inside Emacs and may generate better code on 32-bit machines. --- src/ChangeLog | 6 ++++++ src/composite.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6a6ae7d53cf..8f98b251234 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-06-13 Paul Eggert + * composite.c: Use int, not EMACS_INT, for characters. + (fill_gstring_body, composition_compute_stop_pos): Use int, not + EMACS_INT, for values that are known to be in character range. + This doesn't fix any bugs but is the usual style inside Emacs and + may generate better code on 32-bit machines. + Make sure a 64-bit char is never passed to ENCODE_CHAR. This is for reasons similar to the recent CHAR_STRING fix. * charset.c (Fencode_char): Check that character arg is actually diff --git a/src/composite.c b/src/composite.c index ab9ec3f5a03..51b7669cb4f 100644 --- a/src/composite.c +++ b/src/composite.c @@ -858,7 +858,7 @@ fill_gstring_body (Lisp_Object gstring) for (i = 0; i < len; i++) { Lisp_Object g = LGSTRING_GLYPH (gstring, i); - EMACS_INT c = XINT (AREF (header, i + 1)); + int c = XFASTINT (AREF (header, i + 1)); if (NILP (g)) { @@ -995,7 +995,8 @@ static int _work_char; void composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, Lisp_Object string) { - EMACS_INT start, end, c; + EMACS_INT start, end; + int c; Lisp_Object prop, val; /* This is from forward_to_next_line_start in xdisp.c. */ const int MAX_NEWLINE_DISTANCE = 500; -- 2.39.2