helly Tue Nov 12 08:12:59 2002 EDT Modified files: /php4/ext/gd/libgd gd.c gd_gd2.c gdft.c Log: fix warnings Index: php4/ext/gd/libgd/gd.c diff -u php4/ext/gd/libgd/gd.c:1.23 php4/ext/gd/libgd/gd.c:1.24 --- php4/ext/gd/libgd/gd.c:1.23 Tue Oct 29 18:08:01 2002 +++ php4/ext/gd/libgd/gd.c Tue Nov 12 08:12:58 2002 @@ -2236,10 +2236,10 @@ for (i = 0; i < src->sx; i++) { pxlSrc = f (src,i,uRow); - r = gdImageRed(src,pxlSrc) * dWeight; - g = gdImageGreen(src,pxlSrc) * dWeight; - b = gdImageBlue(src,pxlSrc) * dWeight; - a = gdImageAlpha(src,pxlSrc) * dWeight; + r = (int)(gdImageRed(src,pxlSrc) * dWeight); + g = (int)(gdImageGreen(src,pxlSrc) * dWeight); + b = (int)(gdImageBlue(src,pxlSrc) * dWeight); + a = (int)(gdImageAlpha(src,pxlSrc) * dWeight); pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); @@ -2299,7 +2299,7 @@ void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack) { typedef int (*FuncPtr)(gdImagePtr, int, int); - int i, iYPos, r, g, b, a; + int i, iYPos=0, r, g, b, a; FuncPtr f; int pxlOldLeft, pxlLeft, pxlSrc; @@ -2319,10 +2319,10 @@ pxlSrc = f (src, uCol, i); iYPos = i + iOffset; - r = gdImageRed(src,pxlSrc) * dWeight; - g = gdImageGreen(src,pxlSrc) * dWeight; - b = gdImageBlue(src,pxlSrc) * dWeight; - a = gdImageAlpha(src,pxlSrc) * dWeight; + r = (int)(gdImageRed(src,pxlSrc) * dWeight); + g = (int)(gdImageGreen(src,pxlSrc) * dWeight); + b = (int)(gdImageBlue(src,pxlSrc) * dWeight); + a = (int)(gdImageAlpha(src,pxlSrc) * dWeight); pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); @@ -2482,7 +2482,7 @@ dSinE = sin (dRadAngle); dTan = tan (dRadAngle / 2.0); - newx = src->sx + src->sy * fabs(dTan); + newx = (int)(src->sx + src->sy * fabs(dTan)); newy = src->sy; /* 1st shear */ @@ -2517,7 +2517,7 @@ dShear = ((double)(u - dst1->sy) + 0.5) * dTan; } - iShear = floor(dShear); + iShear = (int)floor(dShear); gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack); } @@ -2547,7 +2547,7 @@ } for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) { - iShear = floor (dOffset); + iShear = (int)floor (dOffset); gdImageSkewY(dst2, dst1, u, iShear, (dOffset - iShear), clrBack); } Index: php4/ext/gd/libgd/gd_gd2.c diff -u php4/ext/gd/libgd/gd_gd2.c:1.3 php4/ext/gd/libgd/gd_gd2.c:1.4 --- php4/ext/gd/libgd/gd_gd2.c:1.3 Tue Oct 29 18:08:01 2002 +++ php4/ext/gd/libgd/gd_gd2.c Tue Nov 12 08:12:58 2002 @@ -763,7 +763,7 @@ /* The zlib notes say output buffer size should be (input size) * 1.01 * 12 */ /* - we'll use 1.02 to be paranoid. */ /* */ - compMax = cs * bytesPerPixel * cs * 1.02 + 12; + compMax = (int)(cs * bytesPerPixel * cs * 1.02 + 12); /* */ /* Allocate the buffers. */ Index: php4/ext/gd/libgd/gdft.c diff -u php4/ext/gd/libgd/gdft.c:1.10 php4/ext/gd/libgd/gdft.c:1.11 --- php4/ext/gd/libgd/gdft.c:1.10 Sun Nov 3 16:21:13 2002 +++ php4/ext/gd/libgd/gdft.c Tue Nov 12 08:12:58 2002 @@ -854,8 +854,8 @@ if (ch == '\r') { penf.x = 0; - x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64; + x1 = (int)((penf.x * cos_a - penf.y * sin_a + 32.0) / 64.0); + y1 = (int)((penf.x * sin_a + penf.y * cos_a + 32.0) / 64.0); pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++; @@ -864,10 +864,10 @@ /* newlines */ if (ch == '\n') { - penf.y -= face->size->metrics.height * LINESPACE; + penf.y = penf.y - (int)(face->size->metrics.height * LINESPACE); penf.y = (penf.y - 32) & -64; /* round to next pixel row */ - x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64; - y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64; + x1 = (int)((penf.x * cos_a - penf.y * sin_a + 32.0) / 64.0); + y1 = (int)((penf.x * sin_a + penf.y * cos_a + 32.0) / 64.0); pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php