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 629387 - Use gint16 for GtkBorder
Use gint16 for GtkBorder
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-09-12 00:05 UTC by Havoc Pennington
Modified: 2010-09-13 17:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use gint16 for GtkBorder (2.40 KB, patch)
2010-09-12 00:05 UTC, Havoc Pennington
none Details | Review

Description Havoc Pennington 2010-09-12 00:05:42 UTC
GtkBorder was wasting space when embedded in 
other objects.

16-bit signed is enough for any reasonable border in a 
screen-displayed pixel layout.

Signed is used because unsigned in layout math 
leads to lots of bugs (this is why GtkAllocation 
is signed, for example). Search through old logs
for "unsigned" to find examples.
Comment 1 Havoc Pennington 2010-09-12 00:05:46 UTC
Created attachment 170050 [details] [review]
Use gint16 for GtkBorder

32K of border ought to be enough for any pixel dimensions. At least
until screens are so huge we start using doubles.

This saves a nice 64 bits of space when we have a GtkBorder
stored somewhere.

Signed integers are used to avoid surprising unsigned math
issues. Just search GTK's whole git log from inception
for "unsigned" if you want to find any number of commits
fixing signed/unsigned bugs.
Comment 2 Matthias Clasen 2010-09-13 17:17:20 UTC
This has been committed as part of the 'padding-cleanup' merge.