]> granicus.if.org Git - php/commitdiff
Kill some warnings
authorMarcus Boerger <helly@php.net>
Sun, 9 Feb 2003 14:17:05 +0000 (14:17 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 9 Feb 2003 14:17:05 +0000 (14:17 +0000)
# the remainig is not easy to solve: float_var = float_cast(extpression)
# This cannot be fixed by simply casting again to float because some
# compilers may ignore the double casting.

ext/gd/libgd/gd.c

index c9b342d0c1e62db6f5b3056ab9a1c04c8181bf6d..918b6b76292aaf9e55744f9fe295e575fc67232c 100644 (file)
@@ -694,11 +694,11 @@ static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) {
                }
                m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */
                /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */
-               *y0 -= m * *x0;
+               *y0 -= (int)(m * *x0);
                *x0 = 0;
                /* now, perhaps, adjust the far end of the line as well */
                if (*x1 > maxdim) {
-                       *y1 += m * (maxdim - *x1);
+                       *y1 += (int)(m * (maxdim - *x1));
                        *x1 = maxdim;
                }
                return 1;
@@ -708,11 +708,11 @@ static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) {
                        return 0;
                }
                m = (*y1 - *y0)/(double)(*x1 - *x0);  /* calculate the slope of the line */
-               *y0 += m * (maxdim - *x0); /* adjust so point is on the right boundary */
+               *y0 += (int)(m * (maxdim - *x0)); /* adjust so point is on the right boundary */
                *x0 = maxdim;                  
                /* now, perhaps, adjust the end of the line */
                if (*x1 < 0) {
-                       *y1 -= m * *x1;
+                       *y1 -= (int)(m * *x1);
                        *x1 = 0;
                }
                return 1;
@@ -720,13 +720,13 @@ static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) {
        /* the final case - the start of the line is inside the window */
        if (*x1 > maxdim) { /* other end is outside to the right */
                m = (*y1 - *y0)/(double)(*x1 - *x0);  /* calculate the slope of the line */
-               *y1 += m * (maxdim - *x1);
+               *y1 += (int)(m * (maxdim - *x1));
                *x1 = maxdim;
                return 1;
        }
        if (*x1 < 0) { /* other end is outside to the left */
                m = (*y1 - *y0)/(double)(*x1 - *x0);  /* calculate the slope of the line */
-               *y1 -= m * *x1;
+               *y1 -= (int)(m * *x1);
                *x1 = 0;
                return 1;
        }