[gs-commits] rev 10938 - trunk/gs/base

robin at ghostscript.com robin at ghostscript.com
Wed Mar 17 20:12:26 UTC 2010


Author: robin
Date: 2010-03-17 20:12:25 +0000 (Wed, 17 Mar 2010)
New Revision: 10938

Modified:
   trunk/gs/base/gdevm40.c
   trunk/gs/base/gdevm48.c
   trunk/gs/base/gdevm56.c
   trunk/gs/base/gdevm64.c
   trunk/gs/base/gxclrast.c
Log:
MSVC whinges when asked to shift by 32 or more bits at once. Simple tweaks
to fool the compiler and eliminate warnings.

No expected differences.



Modified: trunk/gs/base/gdevm40.c
===================================================================
--- trunk/gs/base/gdevm40.c	2010-03-17 19:16:54 UTC (rev 10937)
+++ trunk/gs/base/gdevm40.c	2010-03-17 20:12:25 UTC (rev 10938)
@@ -58,7 +58,7 @@
 
 /* Unpack a color into its bytes. */
 #define declare_unpack_color(a, b, c, d, e, color)\
-	byte a = (byte)(color >> 32);\
+	byte a = (byte)((color >> 16) >> 16);\
 	byte b = (byte)((uint)color >> 24);\
 	byte c = (byte)((uint)color >> 16);\
 	byte d = (byte)((uint)color >> 8);\

Modified: trunk/gs/base/gdevm48.c
===================================================================
--- trunk/gs/base/gdevm48.c	2010-03-17 19:16:54 UTC (rev 10937)
+++ trunk/gs/base/gdevm48.c	2010-03-17 20:12:25 UTC (rev 10938)
@@ -58,8 +58,8 @@
 
 /* Unpack a color into its bytes. */
 #define declare_unpack_color(a, b, c, d, e, f, color)\
-	byte a = (byte)(color >> 40);\
-	byte b = (byte)(color >> 32);\
+	byte a = (byte)((color >> 24) >> 16);\
+	byte b = (byte)((color >> 16) >> 16);\
 	byte c = (byte)((uint)color >> 24);\
 	byte d = (byte)((uint)color >> 16);\
 	byte e = (byte)((uint)color >> 8);\

Modified: trunk/gs/base/gdevm56.c
===================================================================
--- trunk/gs/base/gdevm56.c	2010-03-17 19:16:54 UTC (rev 10937)
+++ trunk/gs/base/gdevm56.c	2010-03-17 20:12:25 UTC (rev 10938)
@@ -58,9 +58,9 @@
 
 /* Unpack a color into its bytes. */
 #define declare_unpack_color(a, b, c, d, e, f, g, color)\
-	byte a = (byte)(color >> 48);\
-	byte b = (byte)(color >> 40);\
-	byte c = (byte)(color >> 32);\
+	byte a = (byte)((color >> 24) >> 24);\
+	byte b = (byte)((color >> 24) >> 16);\
+	byte c = (byte)((color >> 16) >> 16);\
 	byte d = (byte)((uint)color >> 24);\
 	byte e = (byte)((uint)color >> 16);\
 	byte f = (byte)((uint)color >> 8);\

Modified: trunk/gs/base/gdevm64.c
===================================================================
--- trunk/gs/base/gdevm64.c	2010-03-17 19:16:54 UTC (rev 10937)
+++ trunk/gs/base/gdevm64.c	2010-03-17 20:12:25 UTC (rev 10938)
@@ -68,8 +68,8 @@
 #else
 /* Unpack a color into 32 bit chunks. */
 #  define declare_unpack_color(abcd, efgh, color)\
-	bits32 abcd = (bits32)((0x000000ff & ((color) >> 56)) |\
-		               (0x0000ff00 & ((color) >> 40)) |\
+	bits32 abcd = (bits32)((0x000000ff & (((color) >> 28) >> 28)) |\
+		               (0x0000ff00 & (((color) >> 24) >> 16)) |\
 		               (0x00ff0000 & ((color) >> 24)) |\
 		               (0xff000000 & ((color) >> 8)));\
 	bits32 efgh = (bits32)((0x000000ff & ((color) >> 24)) |\

Modified: trunk/gs/base/gxclrast.c
===================================================================
--- trunk/gs/base/gxclrast.c	2010-03-17 19:16:54 UTC (rev 10937)
+++ trunk/gs/base/gxclrast.c	2010-03-17 20:12:25 UTC (rev 10938)
@@ -779,12 +779,12 @@
 				/* For cases with an even number of bytes */
 			        case 8:
 			            data = *cbp++;
-			            delta = ((gx_color_index)
-				        ((data & 0xf0) << 4) + (data & 0x0f)) << 48;
+			            delta = (((gx_color_index)
+				        ((data & 0xf0) << 4) + (data & 0x0f)) << 24) << 24;
 			        case 6:
 			            data = *cbp++;
-			            delta |= ((gx_color_index)
-				        ((data & 0xf0) << 4) + (data & 0x0f)) << 32;
+			            delta |= (((gx_color_index)
+				        ((data & 0xf0) << 4) + (data & 0x0f)) << 16) << 16;
 			        case 4:
 			            data = *cbp++;
 			            delta |= ((gx_color_index)



More information about the gs-commits mailing list