cvs: php4 /ext/gd/libgd gd.c gd2copypal.c gd_jpeg.c gdft.c
| From: | Marcus B�rger | Date: | Sun, 11 Aug 2002 19:13:07 +0000 |
| Subject: | cvs: php4 /ext/gd/libgd gd.c gd2copypal.c gd_jpeg.c gdft.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13266@lists.php.net to get a copy of this message | ||
helly Sun Aug 11 15:13:07 2002 EDT
Modified files:
/php4/ext/gd/libgd gd.c gd2copypal.c gd_jpeg.c gdft.c
Log:
try even more to fix those warnings.....
#repeat: this code must come from hell
Index: php4/ext/gd/libgd/gd.c
diff -u php4/ext/gd/libgd/gd.c:1.7 php4/ext/gd/libgd/gd.c:1.8
--- php4/ext/gd/libgd/gd.c:1.7 Sun Aug 11 09:50:27 2002
+++ php4/ext/gd/libgd/gd.c Sun Aug 11 15:13:06 2002
@@ -277,7 +277,7 @@
}
else
{
- diff = abs (HWB1.H - HWB2.H);
+ diff = fabsf (HWB1.H - HWB2.H);
if (diff > 3)
{
diff = 6 - diff; /* Remember, it's a colour circle */
@@ -823,7 +823,7 @@
if (dy <= dx)
{
/* More-or-less horizontal. use wid for vertical stroke */
- wid = thick * cos (atan2 (dy, dx));
+ wid = (int)(thick * cos (atan2 (dy, dx)));
if (wid == 0)
wid = 1;
@@ -892,7 +892,7 @@
else
{
/* More-or-less vertical. use wid for horizontal stroke */
- wid = thick * sin (atan2 (dy, dx));
+ wid = (int)(thick * sin (atan2 (dy, dx)));
if (wid == 0)
wid = 1;
@@ -977,7 +977,7 @@
if (dy <= dx)
{
/* More-or-less horizontal. use wid for vertical stroke */
- wid = thick * sin (atan2 (dy, dx));
+ wid = (int)(thick * sin (atan2 (dy, dx)));
vert = 1;
d = 2 * dy - dx;
@@ -1036,7 +1036,7 @@
else
{
/* More-or-less vertical. use wid for horizontal stroke */
- wid = thick * sin (atan2 (dy, dx));
+ wid = (int)(thick * sin (atan2 (dy, dx)));
vert = 0;
d = 2 * dx - dy;
@@ -1766,12 +1766,12 @@
{
dc = gdImageGetPixel (dst, tox, toy);
- ncR = gdImageRed (src, c) * (pct / 100.0)
- + gdImageRed (dst, dc) * ((100 - pct) / 100.0);
- ncG = gdImageGreen (src, c) * (pct / 100.0)
- + gdImageGreen (dst, dc) * ((100 - pct) / 100.0);
- ncB = gdImageBlue (src, c) * (pct / 100.0)
- + gdImageBlue (dst, dc) * ((100 - pct) / 100.0);
+ ncR = (int)( gdImageRed (src, c) * (pct / 100.0f)
+ + gdImageRed (dst, dc) * ((100 - pct) / 100.0f));
+ ncG = (int)( gdImageGreen (src, c) * (pct / 100.0f)
+ + gdImageGreen (dst, dc) * ((100 - pct) / 100.0f));
+ ncB = (int)( gdImageBlue (src, c) * (pct / 100.0f)
+ + gdImageBlue (dst, dc) * ((100 - pct) / 100.0f));
/* Find a reasonable color */
nc = gdImageColorResolve (dst, ncR, ncG, ncB);
@@ -1816,19 +1816,19 @@
else
{
dc = gdImageGetPixel (dst, tox, toy);
- g = 0.29900 * dst->red[dc]
- + 0.58700 * dst->green[dc]
- + 0.11400 * dst->blue[dc];
-
- ncR = gdImageRed (src, c) * (pct / 100.0)
- + gdImageRed (dst, dc) * g *
- ((100 - pct) / 100.0);
- ncG = gdImageGreen (src, c) * (pct / 100.0)
- + gdImageGreen (dst, dc) * g *
- ((100 - pct) / 100.0);
- ncB = gdImageBlue (src, c) * (pct / 100.0)
- + gdImageBlue (dst, dc) * g *
- ((100 - pct) / 100.0);
+ g = 0.29900f * dst->red[dc]
+ + 0.58700f * dst->green[dc]
+ + 0.11400f * dst->blue[dc];
+
+ ncR = (int)( gdImageRed (src, c) * (pct / 100.0f)
+ + gdImageRed (dst, dc) * g * ((100 - pct) / 100.0f));
+
+ ncG = (int)( gdImageGreen (src, c) * (pct / 100.0f)
+ + gdImageGreen (dst, dc) * g * ((100 - pct) / 100.0f));
+
+ ncB = (int)( gdImageBlue (src, c) * (pct / 100.0f)
+ + gdImageBlue (dst, dc) * g * ((100 - pct) / 100.0f));
+
/* First look for an exact match */
nc = gdImageColorExact (dst, ncR, ncG, ncB);
@@ -2009,18 +2009,18 @@
do
{
float yportion;
- if (floor (sy) == floor (sy1))
+ if (floorf(sy) == floorf(sy1))
{
- yportion = 1.0f - (sy - floor (sy));
+ yportion = 1.0f - (sy - floorf(sy));
if (yportion > sy2 - sy1)
{
yportion = sy2 - sy1;
}
- sy = floor (sy);
+ sy = floorf(sy);
}
- else if (sy == floor (sy2))
+ else if (sy == floorf(sy2))
{
- yportion = sy2 - floor (sy2);
+ yportion = sy2 - floorf(sy2);
}
else
{
@@ -2036,18 +2036,18 @@
float xportion;
float pcontribution;
int p;
- if (floor (sx) == floor (sx1))
+ if (floorf(sx) == floorf(sx1))
{
- xportion = 1.0 - (sx - floor (sx));
+ xportion = 1.0 - (sx - floorf(sx));
if (xportion > sx2 - sx1)
{
xportion = sx2 - sx1;
}
- sx = floor (sx);
+ sx = floorf(sx);
}
- else if (sx == floor (sx2))
+ else if (sx == floorf(sx2))
{
- xportion = sx2 - floor (sx2);
+ xportion = sx2 - floorf(sx2);
}
else
{
Index: php4/ext/gd/libgd/gd2copypal.c
diff -u php4/ext/gd/libgd/gd2copypal.c:1.1 php4/ext/gd/libgd/gd2copypal.c:1.2
--- php4/ext/gd/libgd/gd2copypal.c:1.1 Fri Apr 12 22:03:08 2002
+++ php4/ext/gd/libgd/gd2copypal.c Sun Aug 11 15:13:07 2002
@@ -1,6 +1,7 @@
#include <stdio.h>
#include "gd.h"
+#include <stdlib.h>
/* A short program which converts a .png file into a .gd file, for
your convenience in creating images on the fly from a
Index: php4/ext/gd/libgd/gd_jpeg.c
diff -u php4/ext/gd/libgd/gd_jpeg.c:1.2 php4/ext/gd/libgd/gd_jpeg.c:1.3
--- php4/ext/gd/libgd/gd_jpeg.c:1.2 Sun Aug 11 09:50:27 2002
+++ php4/ext/gd/libgd/gd_jpeg.c Sun Aug 11 15:13:07 2002
@@ -813,7 +813,7 @@
/* Write any data remaining in the buffer */
if (datacount > 0)
{
- if (gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
+ if ((size_t)gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
ERREXIT (cinfo, JERR_FILE_WRITE);
}
}
Index: php4/ext/gd/libgd/gdft.c
diff -u php4/ext/gd/libgd/gdft.c:1.6 php4/ext/gd/libgd/gdft.c:1.7
--- php4/ext/gd/libgd/gdft.c:1.6 Sun Aug 11 09:50:27 2002
+++ php4/ext/gd/libgd/gdft.c Sun Aug 11 15:13:07 2002
@@ -14,9 +14,11 @@
#ifndef MSWIN32
#include <unistd.h>
-extern int access(const char *pathname, int mode);
#else
#define R_OK 2
+#endif
+#ifdef WIN32
+extern int access(const char *pathname, int mode);
#endif
/* number of antialised colors for indexed bitmaps */