unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* LGLYPH_SET_CODE
@ 2008-08-29  8:44 Eli Zaretskii
  2008-08-29 11:17 ` LGLYPH_SET_CODE Kenichi Handa
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2008-08-29  8:44 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

Can the second argument to this macro be negative?  If so, the current
definition:

    #define LGLYPH_SET_CODE(g, val)					\
      do {								\
	if (val == FONT_INVALID_CODE)					\
	  ASET ((g), LGLYPH_IX_CODE, Qnil);				\
	else if ((EMACS_INT)val > MOST_POSITIVE_FIXNUM)			\
	  ASET ((g), LGLYPH_IX_CODE, Fcons (make_number ((val) >> 16),	\
					    make_number ((val) & 0xFFFF)));\
	else								\
	  ASET ((g), LGLYPH_IX_CODE, make_number (val));		\
      } while (0)

does not handle such values correctly, because their absolute value
could be large enough to overflow an EMACS_INT.  If negative values
are possible, we should use FIXNUM_OVERFLOW_P instead of a comparison
with MOST_POSITIVE_FIXNUM.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-01  5:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-29  8:44 LGLYPH_SET_CODE Eli Zaretskii
2008-08-29 11:17 ` LGLYPH_SET_CODE Kenichi Handa
2008-08-29 11:26   ` LGLYPH_SET_CODE Jason Rumney
2008-08-29 23:48   ` LGLYPH_SET_CODE Richard M. Stallman
2008-09-01  5:17     ` LGLYPH_SET_CODE Kenichi Handa

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).