unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 32 bits
@ 2012-03-24  5:23 YAMAMOTO Mitsuharu
  2012-03-24  7:01 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: YAMAMOTO Mitsuharu @ 2012-03-24  5:23 UTC (permalink / raw)
  To: 11082

In dispextern.h:

   316	struct glyph
   317	{
(snip)
   418	  /* A union of sub-structures for different glyph types.  */
   419	  union
   420	  {
(snip)
   447	    /* Sub-stretch for type == GLYPHLESS_GLYPH.  */
   448	    struct
   449	    {
   450	      /* Value is an enum of the type glyphless_display_method.  */
   451	      unsigned method : 2;
   452	      /* 1 iff this glyph is for a character of no font. */
   453	      unsigned for_no_font : 1;
   454	      /* Length of acronym or hexadecimal code string (at most 8).  */
   455	      unsigned len : 4;
   456	      /* Character to display.  Actually we need only 22 bits.  */
   457	      unsigned ch : 26;
   458	    } glyphless;
   459	
   460	    /* Used to compare all bit-fields above in one step.  */
   461	    unsigned val;
   462	  } u;
   463	};

The member `u.glyphless' above requires at least 33 bits and does not
fit in the size (32 bits) of `u.val' on many environments.  As a
result, equality with respect to the `u.val' member (e.g., used in
GLYPH_EQUAL_P) does not necessarily mean the equality of glyphless
glyphs.

According to the comment above, it seems to be OK to shorten the
length of `u.glyphless.ch' member from 26 to 25.  Could someone
confirm this?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp





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

end of thread, other threads:[~2012-03-26  5:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24  5:23 bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 32 bits YAMAMOTO Mitsuharu
2012-03-24  7:01 ` Eli Zaretskii
2012-03-24  8:54   ` Andreas Schwab
2012-03-25  0:29     ` YAMAMOTO Mitsuharu
2012-03-26  5:47   ` 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).