xserver/fb fbcompose.c,1.32,1.33

Lars Knoll <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Wed, 13 Jul 2005 00:23:57 -0700 (PDT)
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: lars

Update of /cvs/xserver/xserver/fb
In directory gabe:/tmp/cvs-serv16796/fb

Modified Files:
	fbcompose.c 
Log Message:
fix some compiler warnings and a smaller bug in the
convolution filter.


Index: fbcompose.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbcompose.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- fbcompose.c	13 Jul 2005 07:13:20 -0000	1.32
+++ fbcompose.c	13 Jul 2005 07:23:55 -0000	1.33
@@ -3187,9 +3187,9 @@
                 }
 
                 if (satot < 0) satot = 0; else if (satot > 0xff) satot = 0xff;
-                if (srtot < 0) srtot = 0; else if (srtot > satot) srtot = satot;
-                if (sgtot < 0) sgtot = 0; else if (sgtot > satot) sgtot = satot;
-                if (sbtot < 0) sbtot = 0; else if (sbtot > satot) sbtot = satot;
+                if (srtot < 0) srtot = 0; else if (srtot > 0xff) srtot = 0xff;
+                if (sgtot < 0) sgtot = 0; else if (sgtot > 0xff) sgtot = 0xff;
+                if (sbtot < 0) sbtot = 0; else if (sbtot > 0xff) sbtot = 0xff;
 
                 buffer[i] = ((satot << 24) |
                              (srtot << 16) |
@@ -3210,11 +3210,13 @@
     CARD32 _alpha_buffer[SCANLINE_BUFFER_LENGTH];
     CARD32 *alpha_buffer = _alpha_buffer;
 
-    if (!pict->alphaMap)
-        return fbFetchTransformed(pict, x, y, width, buffer);
-
+    if (!pict->alphaMap) {
+        fbFetchTransformed(pict, x, y, width, buffer);
+        return;
+    }
+    
     if (width > SCANLINE_BUFFER_LENGTH)
-        alpha_buffer = malloc(width*sizeof(CARD32));
+        alpha_buffer = (CARD32 *) malloc(width*sizeof(CARD32));
     
     fbFetchTransformed(pict, x, y, width, buffer);
     fbFetchTransformed(pict->alphaMap, x - pict->alphaOrigin.x, y - pict->alphaOrigin.y, width, alpha_buffer);
@@ -3259,8 +3261,10 @@
     miIndexedPtr indexed = (miIndexedPtr) pict->pFormat->index.devPrivate;
     miIndexedPtr aindexed;
 
-    if (!pict->alphaMap)
-        return fbStore(pict, x, y, width, buffer);
+    if (!pict->alphaMap) {
+        fbStore(pict, x, y, width, buffer);
+        return;
+    }
 
     store = storeProcForPicture(pict);
     astore = storeProcForPicture(pict->alphaMap);