[cairo-commit] cairo/src cairo-xcb-surface.c, 1.43, 1.44 cairo-xlib-surface.c, 1.100, 1.101

Owen Taylor commit at pdx.freedesktop.org
Thu Jul 28 10:02:56 PDT 2005


Committed by: otaylor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv376/src

Modified Files:
	cairo-xcb-surface.c cairo-xlib-surface.c 
Log Message:
2005-07-16  Owen Taylor  <otaylor at redhat.com>

        Patch from Martin Kretzschmar <martink at gnome.org>, #3798

        * src/cairo-xlib-surface.c (_get_image_surface): prevent
        sign-extension of masks.*_mask on 64bit architectures.

        * src/cairo-xcb-surface.c (_get_image_surface): ditto.


Index: cairo-xcb-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xcb-surface.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- cairo-xcb-surface.c	28 Jul 2005 16:54:03 -0000	1.43
+++ cairo-xcb-surface.c	28 Jul 2005 17:02:54 -0000	1.44
@@ -481,10 +481,10 @@
 	masks.blue_mask = surface->visual->blue_mask;
     } else if (surface->has_format) {
 	masks.bpp = bpp;
-	masks.red_mask = surface->format.direct.red_mask << surface->format.direct.red_shift;
-	masks.green_mask = surface->format.direct.green_mask << surface->format.direct.green_shift;
-	masks.blue_mask = surface->format.direct.blue_mask << surface->format.direct.blue_shift;
-	masks.alpha_mask = surface->format.direct.alpha_mask << surface->format.direct.alpha_shift;
+	masks.red_mask = (unsigned long)surface->format.direct.red_mask << surface->format.direct.red_shift;
+	masks.green_mask = (unsigned long)surface->format.direct.green_mask << surface->format.direct.green_shift;
+	masks.blue_mask = (unsigned long)surface->format.direct.blue_mask << surface->format.direct.blue_shift;
+	masks.alpha_mask = (unsigned long)surface->format.direct.alpha_mask << surface->format.direct.alpha_shift;
     } else {
 	masks.bpp = bpp;
 	masks.red_mask = 0;

Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- cairo-xlib-surface.c	28 Jul 2005 16:54:03 -0000	1.100
+++ cairo-xlib-surface.c	28 Jul 2005 17:02:54 -0000	1.101
@@ -413,10 +413,10 @@
 	masks.blue_mask = surface->visual->blue_mask;
     } else if (surface->format) {
 	masks.bpp = ximage->bits_per_pixel;
-	masks.red_mask = surface->format->direct.redMask << surface->format->direct.red;
-	masks.green_mask = surface->format->direct.greenMask << surface->format->direct.green;
-	masks.blue_mask = surface->format->direct.blueMask << surface->format->direct.blue;
-	masks.alpha_mask = surface->format->direct.alphaMask << surface->format->direct.alpha;
+	masks.red_mask = (unsigned long)surface->format->direct.redMask << surface->format->direct.red;
+	masks.green_mask = (unsigned long)surface->format->direct.greenMask << surface->format->direct.green;
+	masks.blue_mask = (unsigned long)surface->format->direct.blueMask << surface->format->direct.blue;
+	masks.alpha_mask = (unsigned long)surface->format->direct.alphaMask << surface->format->direct.alpha;
     } else {
 	masks.bpp = ximage->bits_per_pixel;
 	masks.red_mask = 0;




More information about the cairo-commit mailing list