After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 601234 - Don't downcasting the unicode value in gtk/gtkimcontextsimpleseqs.h
Don't downcasting the unicode value in gtk/gtkimcontextsimpleseqs.h
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Input Methods
2.19.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 567443
Blocks: 598994
 
 
Reported: 2009-11-09 09:47 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-03-09 07:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use guint32 instead guint16 (2.04 KB, patch)
2009-11-09 09:50 UTC, Javier Jardón (IRC: jjardon)
rejected Details | Review

Description Javier Jardón (IRC: jjardon) 2009-11-09 09:47:32 UTC
For example, one line downcasting the unicode value 0x10001af to 0x01af.
Comment 1 Javier Jardón (IRC: jjardon) 2009-11-09 09:50:46 UTC
Created attachment 147260 [details] [review]
Use guint32 instead guint16
Comment 2 Benjamin Otte (Company) 2009-11-09 09:58:23 UTC
You should have mentioned that this also causes gcc to emit warnings with -Wall, so it's bad bad bad.
Comment 3 Matthias Clasen 2009-11-10 21:18:41 UTC
The table is the way it is to make it small. We've worked very hard on making it compact. Would be a shame to throw all that away now to quell a compiler warning.

-1 from me.
Comment 4 Matthias Clasen 2009-11-10 21:26:21 UTC
but you are right that casting 0x10001af to 0x01af is a bug. Compose-parse.py is supposed to throw away non-bmp keysyms; seems that it doesn't do so reliably. And we need a separate non-BMP table to take these sequences.
Comment 5 Tor Lillqvist 2009-11-10 22:17:51 UTC
Actually the Unicode character in question *is* in the BMP (U+01AF), but the problem is that its corresponding *keysym* is not one of the "traditional" ones that fit in 16 bits, but one of the "generic" ones that are encoded as 0x1000000 + the Unicode codepoint.
Comment 6 Javier Jardón (IRC: jjardon) 2009-11-27 04:22:33 UTC
Comment on attachment 147260 [details] [review]
Use guint32 instead guint16

As discussed in the meeting, double the size of the table is not a correct solution. See the bottom of the log: http://live.gnome.org/GTK%2B/Meetings?action=AttachFile&do=view&target=20091110.txt
Comment 7 Matthias Clasen 2010-03-09 07:18:27 UTC
I have fixed the script to reliably throw away >16bit keysyms and regenerated the tables.