xserver/fb fbcompose.c,1.27,1.28

Lars Knoll <xserver-commit-u7BhqnqprCWvj1b/[email protected]> Wed, 29 Jun 2005 08:14:19 -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-serv6914/fb

Modified Files:
	fbcompose.c 
Log Message:
do not use // type comments
Fix a bug in the byteswapping code for gradients and
a memory leak in FreePicture.


Index: fbcompose.c
===================================================================
RCS file: /cvs/xserver/xserver/fb/fbcompose.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- fbcompose.c	29 Jun 2005 11:57:16 -0000	1.27
+++ fbcompose.c	29 Jun 2005 15:14:17 -0000	1.28
@@ -2640,7 +2640,7 @@
 {
     int ipos = (pos * PICT_GRADIENT_STOPTABLE_SIZE - 1) >> 16;
 
-    // calculate the actual offset.
+    /* calculate the actual offset. */
     if (ipos < 0 || ipos >= PICT_GRADIENT_STOPTABLE_SIZE) {
         if (pGradient->type == SourcePictTypeConical || spread == RepeatNormal) {
             ipos = ipos % PICT_GRADIENT_STOPTABLE_SIZE;
@@ -2785,6 +2785,7 @@
             } else {
                 while (buffer < end) {
                     double x, y;
+                    double b, c, det, s;
                     if (rz != 0) {
                         x = rx/rz;
                         y = ry/rz;
@@ -2793,10 +2794,10 @@
                     }
                     x -= pGradient->radial.fx;
                     y -= pGradient->radial.fy;
-                    double b = 2*(x*pGradient->radial.dx + y*pGradient->radial.dy);
-                    double c = -(x*x + y*y);
-                    double det = (b * b) - (4 * pGradient->radial.a * c);
-                    double s = (-b + sqrt(det))/(2. * pGradient->radial.a);
+                    b = 2*(x*pGradient->radial.dx + y*pGradient->radial.dy);
+                    c = -(x*x + y*y);
+                    det = (b * b) - (4 * pGradient->radial.a * c);
+                    s = (-b + sqrt(det))/(2. * pGradient->radial.a);
                     *buffer = gradientPixel(pGradient,
                                             (xFixed_48_16)((s*pGradient->radial.m + pGradient->radial.b)*65536),
                                             pict->repeat);