Bug 66872 - gnome-base/eel-2.8.0 integer tests fail on amd64
Bug#: 66872 Product:  Gentoo Linux Version: unspecified Platform: AMD64
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: amd64@gentoo.org Reported By: l_indien@magic.fr
Component: Applications
URL: 
Summary: gnome-base/eel-2.8.0 integer tests fail on amd64
Keywords:  InCVS
Status Whiteboard: 
Opened: 2004-10-09 07:20 0000
Description:   Opened: 2004-10-09 07:20 0000
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 From Jocelyn Mayer 2004-10-09 07:22:23 0000 -------
Created an attachment (id=41422) [details]
emerge log

------- Comment #2 From Jocelyn Mayer 2004-10-09 07:30:42 0000 -------
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 From Jan Brinkmann (RETIRED) 2005-03-31 19:01:46 0000 -------
thanks for the report, added a patch which makes also use of your suggestion in
comment #2. fixed in cvs.