From: Marcus Boerger Date: Mon, 12 Aug 2002 09:58:51 +0000 (+0000) Subject: more conversion fixes X-Git-Tag: php-4.3.0dev_zend2_alpha3~127 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d03c0bdf018b0c174fc5a925ebded26287c04d7;p=php more conversion fixes --- diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 35a31a2f9f..fd36cb382c 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -283,14 +283,14 @@ HWB_Diff (int r1, int g1, int b1, int r2, int g2, int b2) if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED)) { - diff = 0; /* Undefined hues always match... */ + diff = 0.0f; /* Undefined hues always match... */ } else { diff = fabsf (HWB1.H - HWB2.H); - if (diff > 3) + if (diff > 3.0f) { - diff = 6 - diff; /* Remember, it's a colour circle */ + diff = 6.0f - diff; /* Remember, it's a colour circle */ } } @@ -2009,11 +2009,11 @@ gdImageCopyResampled (gdImagePtr dst, /*int pd = gdImageGetPixel (dst, x, y);*/ float sy1, sy2, sx1, sx2; float sx, sy; - float spixels = 0; + float spixels = 0.0f; float red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f; - sy1 = ((float) y - (float) dstY) * (float) srcH / - (float) dstH; - sy2 = ((float) (y + 1) - (float) dstY) * (float) srcH / + sy1 = ((float)(y - dstY)) * (float)srcH / + (float)dstH; + sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH; sy = sy1; do @@ -2034,11 +2034,11 @@ gdImageCopyResampled (gdImagePtr dst, } else { - yportion = 1.0; + yportion = 1.0f; } - sx1 = ((float) x - (float) dstX) * (float) srcW / + sx1 = ((float)(x - dstX)) * (float) srcW / dstW; - sx2 = ((float) (x + 1) - (float) dstX) * (float) srcW / + sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW; sx = sx1; do @@ -2048,7 +2048,7 @@ gdImageCopyResampled (gdImagePtr dst, int p; if (floorf(sx) == floorf(sx1)) { - xportion = 1.0 - (sx - floorf(sx)); + xportion = 1.0f - (sx - floorf(sx)); if (xportion > sx2 - sx1) { xportion = sx2 - sx1; @@ -2061,7 +2061,7 @@ gdImageCopyResampled (gdImagePtr dst, } else { - xportion = 1.0; + xportion = 1.0f; } pcontribution = xportion * yportion; p = gdImageGetTrueColorPixel ( @@ -2073,13 +2073,13 @@ gdImageCopyResampled (gdImagePtr dst, blue += gdTrueColorGetBlue (p) * pcontribution; alpha += gdTrueColorGetAlpha (p) * pcontribution; spixels += xportion * yportion; - sx += 1.0; + sx += 1.0f; } while (sx < sx2); - sy += 1.0; + sy += 1.0f; } while (sy < sy2); - if (spixels != 0.0) + if (spixels != 0.0f) { red /= spixels; green /= spixels; @@ -2087,17 +2087,17 @@ gdImageCopyResampled (gdImagePtr dst, alpha /= spixels; } /* Clamping to allow for rounding errors above */ - if (red > 255.0) + if (red > 255.0f) { - red = 255.0; + red = 255.0f; } - if (green > 255.0) + if (green > 255.0f) { - green = 255.0; + green = 255.0f; } - if (blue > 255.0) + if (blue > 255.0f) { - blue = 255.0; + blue = 255.0f; } if (alpha > gdAlphaMax) {