Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 66872 - gnome-base/eel-2.8.0 integer tests fail on amd64
Summary: gnome-base/eel-2.8.0 integer tests fail on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-10-09 07:20 UTC by Jocelyn Mayer
Modified: 2005-03-31 19:01 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge log (4421-eel-2.8.0.log,314.87 KB, text/plain)
2004-10-09 07:22 UTC, Jocelyn Mayer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Mayer 2004-10-09 07:20:21 UTC
The integer tests fail on amd64 because of 32 => 64 bits incorrect sign extension.
IE: the first test expects to get 4294901760 and gets -65536
This is equivalent on 32 bits targets but not on 64 bits one:
> printf "%x %x\n" 4294901760 -65536
ffff0000 ffffffffffff0000
The following patch solved the problem:
--- /var/tmp/portage/eel-2.8.0/work/eel-2.8.0/eel/eel-gdk-extensions.h.orig    2004-10-09 16:19:06.076002656 +0200
+++ /var/tmp/portage/eel-2.8.0/work/eel-2.8.0/eel/eel-gdk-extensions.h  2004-10-09 16:15:31.608606656 +0200
@@ -43,10 +43,10 @@
 
 /* Pack RGBA values into 32 bits */
 #define EEL_RGBA_COLOR_PACK(r, g, b, a)                \
-( ((a) << 24) |                                        \
-  ((r) << 16) |                                        \
-  ((g) <<  8) |                                        \
-  ((b) <<  0) )
+( (((unsigned int)a) << 24) |                          \
+  (((unsigned int)r) << 16) |                          \
+  (((unsigned int)g) <<  8) |                          \
+  (((unsigned int)b) <<  0) )
 
 /* Pack opaque RGBA values into 32 bits */
 #define EEL_RGB_COLOR_PACK(r, g, b)            \


Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Jocelyn Mayer 2004-10-09 07:22:23 UTC
Created attachment 41422 [details]
emerge log
Comment 2 Jocelyn Mayer 2004-10-09 07:30:42 UTC
Re-reading my patch, I found that using uint32_t instead of unsigned int for casts would be a better fix: int size may not be 32 bits on some platforms.
Comment 3 Jan Brinkmann (RETIRED) gentoo-dev 2005-03-31 19:01:46 UTC
thanks for the report, added a patch which makes also use of your suggestion in comment #2. fixed in cvs.