tabe Fri, 15 Jan 2010 17:09:14 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=293588
Log:
fix wrong type and useless assignments
Changed paths:
U php/php-src/branches/PHP_5_2/ext/gd/gd.c
U php/php-src/branches/PHP_5_3/ext/gd/gd.c
U php/php-src/trunk/ext/gd/gd.c
Modified: php/php-src/branches/PHP_5_2/ext/gd/gd.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/gd/gd.c 2010-01-15 16:55:09 UTC (rev
293587)
+++ php/php-src/branches/PHP_5_2/ext/gd/gd.c 2010-01-15 17:09:14 UTC (rev
293588)
@@ -4238,7 +4238,7 @@
long col = -1, x = -1, y = -1;
int str_len, fontname_len, i, brect[8];
double ptsize, angle;
- unsigned char *str = NULL, *fontname = NULL;
+ char *str = NULL, *fontname = NULL;
char *error = NULL;
int argc = ZEND_NUM_ARGS();
#if HAVE_GD_STRINGFTEX
@@ -4300,28 +4300,24 @@
{
char tmp_font_path[MAXPATHLEN];
- if (VCWD_REALPATH((char *)fontname, tmp_font_path)) {
- fontname = (unsigned char *) fontname;
- } else {
+ if (!VCWD_REALPATH(fontname, tmp_font_path)) {
fontname = NULL;
}
}
-#else
- fontname = (unsigned char *) fontname;
#endif
- PHP_GD_CHECK_OPEN_BASEDIR((char *)fontname, "Invalid font filename");
+ PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
#ifdef USE_GD_IMGSTRTTF
# if HAVE_GD_STRINGFTEX
if (extended) {
- error = gdImageStringFTEx(im, brect, col, (char *)fontname,
ptsize, angle, x, y, (char *)str, &strex);
+ error = gdImageStringFTEx(im, brect, col, fontname, ptsize,
angle, x, y, str, &strex);
}
else
# endif
# if HAVE_GD_STRINGFT
- error = gdImageStringFT(im, brect, col, (char *)fontname, ptsize,
angle, x, y, (char *)str);
+ error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y,
str);
# elif HAVE_GD_STRINGTTF
error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y,
str);
# endif
Modified: php/php-src/branches/PHP_5_3/ext/gd/gd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/gd/gd.c 2010-01-15 16:55:09 UTC (rev
293587)
+++ php/php-src/branches/PHP_5_3/ext/gd/gd.c 2010-01-15 17:09:14 UTC (rev
293588)
@@ -3883,7 +3883,7 @@
long col = -1, x = -1, y = -1;
int str_len, fontname_len, i, brect[8];
double ptsize, angle;
- unsigned char *str = NULL, *fontname = NULL;
+ char *str = NULL, *fontname = NULL;
char *error = NULL;
int argc = ZEND_NUM_ARGS();
#if HAVE_GD_STRINGFTEX
@@ -3945,28 +3945,24 @@
{
char tmp_font_path[MAXPATHLEN];
- if (VCWD_REALPATH((char *)fontname, tmp_font_path)) {
- fontname = (unsigned char *) fontname;
- } else {
+ if (!VCWD_REALPATH(fontname, tmp_font_path)) {
fontname = NULL;
}
}
-#else
- fontname = (unsigned char *) fontname;
#endif
- PHP_GD_CHECK_OPEN_BASEDIR((char *)fontname, "Invalid font filename");
+ PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
#ifdef USE_GD_IMGSTRTTF
# if HAVE_GD_STRINGFTEX
if (extended) {
- error = gdImageStringFTEx(im, brect, col, (char *)fontname,
ptsize, angle, x, y, (char *)str, &strex);
+ error = gdImageStringFTEx(im, brect, col, fontname, ptsize,
angle, x, y, str, &strex);
}
else
# endif
# if HAVE_GD_STRINGFT
- error = gdImageStringFT(im, brect, col, (char *)fontname, ptsize,
angle, x, y, (char *)str);
+ error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y,
str);
# elif HAVE_GD_STRINGTTF
error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y,
str);
# endif
Modified: php/php-src/trunk/ext/gd/gd.c
===================================================================
--- php/php-src/trunk/ext/gd/gd.c 2010-01-15 16:55:09 UTC (rev 293587)
+++ php/php-src/trunk/ext/gd/gd.c 2010-01-15 17:09:14 UTC (rev 293588)
@@ -3588,7 +3588,7 @@
long col = -1, x = -1, y = -1;
int str_len, fontname_len, i, brect[8];
double ptsize, angle;
- unsigned char *str = NULL, *fontname = NULL;
+ char *str = NULL, *fontname = NULL;
char *error = NULL;
int argc = ZEND_NUM_ARGS();
#if HAVE_GD_STRINGFTEX
@@ -3657,14 +3657,10 @@
{
char tmp_font_path[MAXPATHLEN];
- if (VCWD_REALPATH(fontname, tmp_font_path)) {
- fontname = (unsigned char *) fontname;
- } else {
+ if (!VCWD_REALPATH(fontname, tmp_font_path)) {
fontname = NULL;
}
}
-#else
- fontname = (unsigned char *) fontname;
#endif
PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename");
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php