Commit: 51d78c253318158371ce9d547d0637392b5428a5
Author: Anatol Belski <a...@php.net> Fri, 29 Nov 2013 08:53:32 +0100
Parents: 57db68e03d46da1b1a2244e001550739c8eec468
Branches: str_size_and_int64
Link:
http://git.php.net/?p=php-src.git;a=commitdiff;h=51d78c253318158371ce9d547d0637392b5428a5
Log:
basic fixes for ext/gd
Changed paths:
M ext/gd/gd.c
M ext/gd/gd_ctx.c
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index d8a90f5..800a94e 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1420,12 +1420,13 @@ PHP_GD_API int phpi_get_le_gd(void)
PHP_FUNCTION(imageloadfont)
{
char *file;
- int file_name, hdr_size = sizeof(gdFont) - sizeof(char *);
+ zend_str_size_int file_name;
+ int hdr_size = sizeof(gdFont) - sizeof(char *);
int ind, body_size, n = 0, b, i, body_size_check;
gdFontPtr font;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file,
&file_name) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &file,
&file_name) == FAILURE) {
return;
}
@@ -1563,10 +1564,10 @@ PHP_FUNCTION(imagesetstyle)
Create a new true color image */
PHP_FUNCTION(imagecreatetruecolor)
{
- long x_size, y_size;
+ php_int_t x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size,
&y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &x_size,
&y_size) == FAILURE) {
return;
}
@@ -1608,10 +1609,10 @@ PHP_FUNCTION(imagetruecolortopalette)
{
zval *IM;
zend_bool dither;
- long ncolors;
+ php_int_t ncolors;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rbl", &IM,
&dither, &ncolors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rbi", &IM,
&dither, &ncolors) == FAILURE) {
return;
}
@@ -1694,10 +1695,10 @@ PHP_FUNCTION(imagecolormatch)
PHP_FUNCTION(imagesetthickness)
{
zval *IM;
- long thick;
+ php_int_t thick;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &thick)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &IM, &thick)
== FAILURE) {
return;
}
@@ -1714,10 +1715,10 @@ PHP_FUNCTION(imagesetthickness)
PHP_FUNCTION(imagefilledellipse)
{
zval *IM;
- long cx, cy, w, h, color;
+ php_int_t cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -1734,11 +1735,11 @@ PHP_FUNCTION(imagefilledellipse)
PHP_FUNCTION(imagefilledarc)
{
zval *IM;
- long cx, cy, w, h, ST, E, col, style;
+ php_int_t cx, cy, w, h, ST, E, col, style;
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllllllll", &IM,
&cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiiiiii", &IM,
&cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
return;
}
@@ -1803,10 +1804,10 @@ PHP_FUNCTION(imagesavealpha)
PHP_FUNCTION(imagelayereffect)
{
zval *IM;
- long effect;
+ php_int_t effect;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM,
&effect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &IM,
&effect) == FAILURE) {
return;
}
@@ -1822,11 +1823,11 @@ PHP_FUNCTION(imagelayereffect)
PHP_FUNCTION(imagecolorallocatealpha)
{
zval *IM;
- long red, green, blue, alpha;
+ php_int_t red, green, blue, alpha;
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
RETURN_FALSE;
}
@@ -1835,7 +1836,7 @@ PHP_FUNCTION(imagecolorallocatealpha)
if (ct < 0) {
RETURN_FALSE;
}
- RETURN_LONG((long)ct);
+ RETURN_LONG((php_int_t)ct);
}
/* }}} */
@@ -1844,10 +1845,10 @@ PHP_FUNCTION(imagecolorallocatealpha)
PHP_FUNCTION(imagecolorresolvealpha)
{
zval *IM;
- long red, green, blue, alpha;
+ php_int_t red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1862,10 +1863,10 @@ PHP_FUNCTION(imagecolorresolvealpha)
PHP_FUNCTION(imagecolorclosestalpha)
{
zval *IM;
- long red, green, blue, alpha;
+ php_int_t red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1880,10 +1881,10 @@ PHP_FUNCTION(imagecolorclosestalpha)
PHP_FUNCTION(imagecolorexactalpha)
{
zval *IM;
- long red, green, blue, alpha;
+ php_int_t red, green, blue, alpha;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii", &IM,
&red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1898,11 +1899,11 @@ PHP_FUNCTION(imagecolorexactalpha)
PHP_FUNCTION(imagecopyresampled)
{
zval *SIM, *DIM;
- long SX, SY, SW, SH, DX, DY, DW, DH;
+ php_int_t SX, SY, SW, SH, DX, DY, DW, DH;
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll",
&DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rriiiiiiii",
&DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -1930,7 +1931,7 @@ PHP_FUNCTION(imagecopyresampled)
PHP_FUNCTION(imagegrabwindow)
{
HWND window;
- long client_area = 0;
+ php_int_t client_area = 0;
RECT rc = {0};
RECT rc_win = {0};
int Width, Height;
@@ -1939,12 +1940,12 @@ PHP_FUNCTION(imagegrabwindow)
HBITMAP memBM;
HBITMAP hOld;
HINSTANCE handle;
- long lwindow_handle;
+ php_int_t lwindow_handle;
typedef BOOL (WINAPI *tPrintWindow)(HWND, HDC,UINT);
tPrintWindow pPrintWindow = 0;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
&lwindow_handle, &client_area) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|i",
&lwindow_handle, &client_area) == FAILURE) {
RETURN_FALSE;
}
@@ -2081,10 +2082,10 @@ PHP_FUNCTION(imagerotate)
zval *SIM;
gdImagePtr im_dst, im_src;
double degrees;
- long color;
- long ignoretransparent = 0;
+ php_int_t color;
+ php_int_t ignoretransparent = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM,
°rees, &color, &ignoretransparent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdi|i", &SIM,
°rees, &color, &ignoretransparent) == FAILURE) {
RETURN_FALSE;
}
@@ -2144,10 +2145,10 @@ PHP_FUNCTION(imagesetbrush)
Create a new image */
PHP_FUNCTION(imagecreate)
{
- long x_size, y_size;
+ php_int_t x_size, y_size;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x_size,
&y_size) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ii", &x_size,
&y_size) == FAILURE) {
return;
}
@@ -2256,7 +2257,7 @@ gdImagePtr _php_image_create_from_string(zval **data,
char *tn, gdImagePtr (*ioc
gdImagePtr im;
gdIOCtx *io_ctx;
- io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0);
+ io_ctx = gdNewDynamicCtxEx(Z_STRSIZE_PP(data), Z_STRVAL_PP(data), 0);
if (!io_ctx) {
return NULL;
@@ -2289,7 +2290,7 @@ PHP_FUNCTION(imagecreatefromstring)
}
convert_to_string_ex(data);
- if (Z_STRLEN_PP(data) < 8) {
+ if (Z_STRSIZE_PP(data) < 8) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string or
invalid image");
RETURN_FALSE;
}
@@ -2348,15 +2349,15 @@ PHP_FUNCTION(imagecreatefromstring)
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int
image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)())
{
char *file;
- int file_len;
- long srcx, srcy, width, height;
+ zend_str_size_int file_len;
+ php_int_t srcx, srcy, width, height;
gdImagePtr im = NULL;
php_stream *stream;
FILE * fp = NULL;
- long ignore_warning;
+ php_int_t ignore_warning;
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll",
&file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Siiii",
&file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
@@ -2364,7 +2365,7 @@ static void
_php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S",
&file, &file_len) == FAILURE) {
return;
}
}
@@ -2551,18 +2552,19 @@ static void
_php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
{
zval *imgind;
char *file = NULL;
- long quality = 0, type = 0;
+ php_int_t quality = 0, type = 0;
gdImagePtr im;
char *fn = NULL;
FILE *fp;
- int file_len = 0, argc = ZEND_NUM_ARGS();
+ zend_str_size_int file_len = 0;
+ int argc = ZEND_NUM_ARGS();
int q = -1, i, t = 1;
/* The quality parameter for Wbmp stands for the threshold when called
from image2wbmp() */
/* When called from imagewbmp() the quality parameter stands for the
foreground color. Default: black. */
/* The quality parameter for gd2 stands for chunk size */
- if (zend_parse_parameters(argc TSRMLS_CC, "r|pll", &imgind, &file,
&file_len, &quality, &type) == FAILURE) {
+ if (zend_parse_parameters(argc TSRMLS_CC, "r|Pii", &imgind, &file,
&file_len, &quality, &type) == FAILURE) {
return;
}
@@ -2794,11 +2796,11 @@ PHP_FUNCTION(imagedestroy)
PHP_FUNCTION(imagecolorallocate)
{
zval *IM;
- long red, green, blue;
+ php_int_t red, green, blue;
gdImagePtr im;
int ct = (-1);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red,
&green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &red,
&green, &blue) == FAILURE) {
return;
}
@@ -2835,10 +2837,10 @@ PHP_FUNCTION(imagepalettecopy)
PHP_FUNCTION(imagecolorat)
{
zval *IM;
- long x, y;
+ php_int_t x, y;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &IM, &x,
&y) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rii", &IM, &x,
&y) == FAILURE) {
return;
}
@@ -2867,10 +2869,10 @@ PHP_FUNCTION(imagecolorat)
PHP_FUNCTION(imagecolorclosest)
{
zval *IM;
- long red, green, blue;
+ php_int_t red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red,
&green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &red,
&green, &blue) == FAILURE) {
return;
}
@@ -2885,10 +2887,10 @@ PHP_FUNCTION(imagecolorclosest)
PHP_FUNCTION(imagecolorclosesthwb)
{
zval *IM;
- long red, green, blue;
+ php_int_t red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red,
&green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &red,
&green, &blue) == FAILURE) {
return;
}
@@ -2903,11 +2905,11 @@ PHP_FUNCTION(imagecolorclosesthwb)
PHP_FUNCTION(imagecolordeallocate)
{
zval *IM;
- long index;
+ php_int_t index;
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &IM, &index)
== FAILURE) {
return;
}
@@ -2935,10 +2937,10 @@ PHP_FUNCTION(imagecolordeallocate)
PHP_FUNCTION(imagecolorresolve)
{
zval *IM;
- long red, green, blue;
+ php_int_t red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red,
&green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &red,
&green, &blue) == FAILURE) {
return;
}
@@ -2953,10 +2955,10 @@ PHP_FUNCTION(imagecolorresolve)
PHP_FUNCTION(imagecolorexact)
{
zval *IM;
- long red, green, blue;
+ php_int_t red, green, blue;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &red,
&green, &blue) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &red,
&green, &blue) == FAILURE) {
return;
}
@@ -2971,11 +2973,11 @@ PHP_FUNCTION(imagecolorexact)
PHP_FUNCTION(imagecolorset)
{
zval *IM;
- long color, red, green, blue, alpha = 0;
+ php_int_t color, red, green, blue, alpha = 0;
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &IM,
&color, &red, &green, &blue, &alpha) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii|i", &IM,
&color, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -2999,11 +3001,11 @@ PHP_FUNCTION(imagecolorset)
PHP_FUNCTION(imagecolorsforindex)
{
zval *IM;
- long index;
+ php_int_t index;
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &IM, &index)
== FAILURE) {
return;
}
@@ -3073,10 +3075,10 @@ PHP_FUNCTION(imagegammacorrect)
PHP_FUNCTION(imagesetpixel)
{
zval *IM;
- long x, y, col;
+ php_int_t x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x,
&y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &x,
&y, &col) == FAILURE) {
return;
}
@@ -3091,10 +3093,10 @@ PHP_FUNCTION(imagesetpixel)
PHP_FUNCTION(imageline)
{
zval *IM;
- long x1, y1, x2, y2, col;
+ php_int_t x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3117,10 +3119,10 @@ PHP_FUNCTION(imageline)
PHP_FUNCTION(imagedashedline)
{
zval *IM;
- long x1, y1, x2, y2, col;
+ php_int_t x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3135,10 +3137,10 @@ PHP_FUNCTION(imagedashedline)
PHP_FUNCTION(imagerectangle)
{
zval *IM;
- long x1, y1, x2, y2, col;
+ php_int_t x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3153,10 +3155,10 @@ PHP_FUNCTION(imagerectangle)
PHP_FUNCTION(imagefilledrectangle)
{
zval *IM;
- long x1, y1, x2, y2, col;
+ php_int_t x1, y1, x2, y2, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3171,11 +3173,11 @@ PHP_FUNCTION(imagefilledrectangle)
PHP_FUNCTION(imagearc)
{
zval *IM;
- long cx, cy, w, h, ST, E, col;
+ php_int_t cx, cy, w, h, ST, E, col;
gdImagePtr im;
int e, st;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllllll", &IM,
&cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiiiii", &IM,
&cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
return;
}
@@ -3201,10 +3203,10 @@ PHP_FUNCTION(imagearc)
PHP_FUNCTION(imageellipse)
{
zval *IM;
- long cx, cy, w, h, color;
+ php_int_t cx, cy, w, h, color;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllll", &IM,
&cx, &cy, &w, &h, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiii", &IM,
&cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -3220,10 +3222,10 @@ PHP_FUNCTION(imageellipse)
PHP_FUNCTION(imagefilltoborder)
{
zval *IM;
- long x, y, border, col;
+ php_int_t x, y, border, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll", &IM, &x,
&y, &border, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii", &IM, &x,
&y, &border, &col) == FAILURE) {
return;
}
@@ -3238,10 +3240,10 @@ PHP_FUNCTION(imagefilltoborder)
PHP_FUNCTION(imagefill)
{
zval *IM;
- long x, y, col;
+ php_int_t x, y, col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlll", &IM, &x,
&y, &col) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riii", &IM, &x,
&y, &col) == FAILURE) {
return;
}
@@ -3273,11 +3275,11 @@ PHP_FUNCTION(imagecolorstotal)
PHP_FUNCTION(imagecolortransparent)
{
zval *IM;
- long COL = 0;
+ php_int_t COL = 0;
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &COL) == FAILURE)
{
+ if (zend_parse_parameters(argc TSRMLS_CC, "r|i", &IM, &COL) == FAILURE)
{
return;
}
@@ -3297,10 +3299,10 @@ PHP_FUNCTION(imageinterlace)
{
zval *IM;
int argc = ZEND_NUM_ARGS();
- long INT = 0;
+ php_int_t INT = 0;
gdImagePtr im;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &INT) == FAILURE)
{
+ if (zend_parse_parameters(argc TSRMLS_CC, "r|i", &IM, &INT) == FAILURE)
{
return;
}
@@ -3321,13 +3323,13 @@ PHP_FUNCTION(imageinterlace)
static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
{
zval *IM, *POINTS;
- long NPOINTS, COL;
+ php_int_t NPOINTS, COL;
zval **var = NULL;
gdImagePtr im;
gdPointPtr points;
int npoints, col, nelem, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rall", &IM,
&POINTS, &NPOINTS, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "raii", &IM,
&POINTS, &NPOINTS, &COL) == FAILURE) {
return;
}
@@ -3437,10 +3439,10 @@ static gdFontPtr php_find_gd_font(int size TSRMLS_DC)
*/
static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
{
- long SIZE;
+ php_int_t SIZE;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &SIZE) ==
FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &SIZE) ==
FAILURE) {
return;
}
@@ -3500,15 +3502,15 @@ static void php_gdimagecharup(gdImagePtr im, gdFontPtr
f, int x, int y, int c, i
static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
zval *IM;
- long SIZE, X, Y, COL;
+ php_int_t SIZE, X, Y, COL;
char *C;
- int C_len;
+ zend_str_size_int C_len;
gdImagePtr im;
int ch = 0, col, x, y, size, i, l = 0;
unsigned char *str = NULL;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlllsl", &IM,
&SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiiSi", &IM,
&SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
return;
}
@@ -3595,11 +3597,11 @@ PHP_FUNCTION(imagestringup)
PHP_FUNCTION(imagecopy)
{
zval *SIM, *DIM;
- long SX, SY, SW, SH, DX, DY;
+ php_int_t SX, SY, SW, SH, DX, DY;
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllll", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rriiiiii", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
return;
}
@@ -3623,11 +3625,11 @@ PHP_FUNCTION(imagecopy)
PHP_FUNCTION(imagecopymerge)
{
zval *SIM, *DIM;
- long SX, SY, SW, SH, DX, DY, PCT;
+ php_int_t SX, SY, SW, SH, DX, DY, PCT;
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rriiiiiii", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3652,11 +3654,11 @@ PHP_FUNCTION(imagecopymerge)
PHP_FUNCTION(imagecopymergegray)
{
zval *SIM, *DIM;
- long SX, SY, SW, SH, DX, DY, PCT;
+ php_int_t SX, SY, SW, SH, DX, DY, PCT;
gdImagePtr im_dst, im_src;
int srcH, srcW, srcY, srcX, dstY, dstX, pct;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrlllllll", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rriiiiiii", &DIM,
&SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3681,11 +3683,11 @@ PHP_FUNCTION(imagecopymergegray)
PHP_FUNCTION(imagecopyresized)
{
zval *SIM, *DIM;
- long SX, SY, SW, SH, DX, DY, DW, DH;
+ php_int_t SX, SY, SW, SH, DX, DY, DW, DH;
gdImagePtr im_dst, im_src;
int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrllllllll",
&DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rriiiiiiii",
&DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -3792,8 +3794,10 @@ static void
php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
{
zval *IM, *EXT = NULL;
gdImagePtr im=NULL;
- long col = -1, x = -1, y = -1;
- int str_len, fontname_len, i, brect[8];
+ php_int_t col = -1, x = -1, y = -1;
+ zend_str_size_int str_len;
+ int i, brect[8];
+ zend_str_size_int fontname_len;
double ptsize, angle;
char *str = NULL, *fontname = NULL;
char *error = NULL;
@@ -3803,13 +3807,13 @@ static void
php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
if (mode == TTFTEXT_BBOX) {
if (argc < 4 || argc > ((extended) ? 5 : 4)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "ddss|a",
&ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc TSRMLS_CC, "ddSS|a",
&ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) {
RETURN_FALSE;
}
} else {
if (argc < 8 || argc > ((extended) ? 9 : 8)) {
ZEND_WRONG_PARAM_COUNT();
- } else if (zend_parse_parameters(argc TSRMLS_CC, "rddlllss|a",
&IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len,
&EXT) == FAILURE) {
+ } else if (zend_parse_parameters(argc TSRMLS_CC, "rddiiiSS|a",
&IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len,
&EXT) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
@@ -3909,12 +3913,13 @@ static void php_free_ps_enc(zend_rsrc_list_entry *rsrc
TSRMLS_DC)
PHP_FUNCTION(imagepsloadfont)
{
char *file;
- int file_len, f_ind, *font;
+ zend_str_size_int file_len;
+ int f_ind, *font;
#ifdef PHP_WIN32
- struct stat st;
+ zend_stat_t st;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file,
&file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &file,
&file_len) == FAILURE) {
return;
}
@@ -4019,9 +4024,10 @@ PHP_FUNCTION(imagepsencodefont)
{
zval *fnt;
char *enc, **enc_vector;
- int enc_len, *f_ind;
+ zend_str_size_int enc_len;
+ int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc,
&enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rS", &fnt, &enc,
&enc_len) == FAILURE) {
return;
}
@@ -4102,7 +4108,7 @@ PHP_FUNCTION(imagepstext)
{
zval *img, *fnt;
int i, j;
- long _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0;
+ php_int_t _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0;
int *f_ind;
int h_lines, v_lines, c_ind;
int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl;
@@ -4116,9 +4122,9 @@ PHP_FUNCTION(imagepstext)
T1_OUTLINE *char_path, *str_path;
T1_TMATRIX *transform = NULL;
char *str;
- int str_len;
+ zend_str_size_int str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrlllll|lldl",
&img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle,
&aa_steps) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rSriiiii|iidi",
&img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle,
&aa_steps) == FAILURE) {
return;
}
@@ -4240,13 +4246,14 @@ PHP_FUNCTION(imagepstext)
PHP_FUNCTION(imagepsbbox)
{
zval *fnt;
- long sz = 0, sp = 0, wd = 0;
+ php_int_t sz = 0, sp = 0, wd = 0;
char *str;
int i, space = 0, add_width = 0, char_width, amount_kern;
int cur_x, cur_y, dx, dy;
int x1, y1, x2, y2, x3, y3, x4, y4;
int *f_ind;
- int str_len, per_char = 0;
+ zend_str_size_int str_len;
+ per_char = 0;
int argc = ZEND_NUM_ARGS();
double angle = 0, sin_a = 0, cos_a = 0;
BBox char_bbox, str_bbox = {0, 0, 0, 0};
@@ -4255,7 +4262,7 @@ PHP_FUNCTION(imagepsbbox)
ZEND_WRONG_PARAM_COUNT();
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "srl|lld", &str,
&str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sri|iid", &str,
&str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
return;
}
@@ -4419,8 +4426,8 @@ static void _php_image_bw_convert(gdImagePtr im_org,
gdIOCtx *out, int threshold
static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
{
char *f_org, *f_dest;
- int f_org_len, f_dest_len;
- long height, width, threshold;
+ zend_str_size_int f_org_len, f_dest_len;
+ php_int_t height, width, threshold;
gdImagePtr im_org, im_dest, im_tmp;
char *fn_org = NULL;
char *fn_dest = NULL;
@@ -4433,9 +4440,9 @@ static void
_php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
int int_threshold;
int x, y;
float x_ratio, y_ratio;
- long ignore_warning;
+ php_int_t ignore_warning;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org,
&f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "PPiii", &f_org,
&f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
return;
}
@@ -4630,9 +4637,9 @@ static void
php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS)
{
zval *SIM;
gdImagePtr im_src;
- long brightness, tmp;
+ php_int_t brightness, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &SIM, &tmp,
&brightness) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zii", &SIM, &tmp,
&brightness) == FAILURE) {
RETURN_FALSE;
}
@@ -4653,9 +4660,9 @@ static void
php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS)
{
zval *SIM;
gdImagePtr im_src;
- long contrast, tmp;
+ php_int_t contrast, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &SIM, &tmp,
&contrast) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rii", &SIM, &tmp,
&contrast) == FAILURE) {
RETURN_FALSE;
}
@@ -4676,10 +4683,10 @@ static void
php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS)
{
zval *SIM;
gdImagePtr im_src;
- long r,g,b,tmp;
- long a = 0;
+ php_int_t r,g,b,tmp;
+ php_int_t a = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllll|l", &SIM,
&tmp, &r, &g, &b, &a) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riiii|i", &SIM,
&tmp, &r, &g, &b, &a) == FAILURE) {
RETURN_FALSE;
}
@@ -4754,11 +4761,11 @@ static void
php_image_filter_mean_removal(INTERNAL_FUNCTION_PARAMETERS)
static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS)
{
zval *SIM;
- long tmp;
+ php_int_t tmp;
gdImagePtr im_src;
double weight;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rld", &SIM, &tmp,
&weight) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rid", &SIM, &tmp,
&weight) == FAILURE) {
RETURN_FALSE;
}
@@ -4779,10 +4786,10 @@ static void
php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS)
{
zval *IM;
gdImagePtr im;
- long tmp, blocksize;
+ php_int_t tmp, blocksize;
zend_bool mode = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll|b", &IM,
&tmp, &blocksize, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rii|b", &IM,
&tmp, &blocksize, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -4806,7 +4813,7 @@ PHP_FUNCTION(imagefilter)
zval *tmp;
typedef void (*image_filter)(INTERNAL_FUNCTION_PARAMETERS);
- long filtertype;
+ php_int_t filtertype;
image_filter filters[] =
{
php_image_filter_negate ,
@@ -4825,7 +4832,7 @@ PHP_FUNCTION(imagefilter)
if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > IMAGE_FILTER_MAX_ARGS) {
WRONG_PARAM_COUNT;
- } else if (zend_parse_parameters(2 TSRMLS_CC, "rl", &tmp, &filtertype)
== FAILURE) {
+ } else if (zend_parse_parameters(2 TSRMLS_CC, "ri", &tmp, &filtertype)
== FAILURE) {
return;
}
@@ -4893,10 +4900,10 @@ PHP_FUNCTION(imageconvolution)
PHP_FUNCTION(imageflip)
{
zval *IM;
- long mode;
+ php_int_t mode;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &mode)
== FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &IM, &mode)
== FAILURE) {
return;
}
@@ -5004,13 +5011,13 @@ PHP_FUNCTION(imagecrop)
PHP_FUNCTION(imagecropauto)
{
zval *IM;
- long mode = -1;
- long color = -1;
+ php_int_t mode = -1;
+ php_int_t color = -1;
double threshold = 0.5f;
gdImagePtr im;
gdImagePtr im_crop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|ldl", &IM,
&mode, &threshold, &color) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|idi", &IM,
&mode, &threshold, &color) == FAILURE) {
return;
}
@@ -5054,10 +5061,10 @@ PHP_FUNCTION(imagescale)
zval *IM;
gdImagePtr im;
gdImagePtr im_scaled;
- int new_width, new_height = -1;
+ php_int_t new_width, new_height = -1;
gdInterpolationMethod method = GD_BILINEAR_FIXED;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM,
&new_width, &new_height, &method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|ii", &IM,
&new_width, &new_height, &method) == FAILURE) {
return;
}
@@ -5200,12 +5207,12 @@ PHP_FUNCTION(imageaffine)
PHP_FUNCTION(imageaffinematrixget)
{
double affine[6];
- long type;
+ php_int_t type;
zval *options;
zval **tmp;
int res = GD_FALSE, i;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &type,
&options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|z", &type,
&options) == FAILURE) {
return;
}
@@ -5349,9 +5356,9 @@ PHP_FUNCTION(imagesetinterpolation)
{
zval *IM;
gdImagePtr im;
- long method = GD_BILINEAR_FIXED;
+ php_int_t method = GD_BILINEAR_FIXED;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM,
&method) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|i", &IM,
&method) == FAILURE) {
return;
}
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 2a0b500..6f83e93 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -78,8 +78,8 @@ static void
_php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
{
zval *imgind;
char *file = NULL;
- int file_len = 0;
- long quality, basefilter;
+ zend_str_size_int file_len = 0;
+ php_int_t quality, basefilter;
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
int q = -1, i;
@@ -93,7 +93,7 @@ static void
_php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* from imagey<type>().
*/
if (image_type == PHP_GDIMG_TYPE_XBM) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rp!|ll",
&imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rP!|ii",
&imgind, &file, &file_len, &quality, &basefilter) == FAILURE) {
return;
}
} else {
@@ -103,7 +103,7 @@ static void
_php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
* PHP_GDIMG_TYPE_WBM
* PHP_GDIMG_TYPE_WEBP
* */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/!ll",
&imgind, &to_zval, &quality, &basefilter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/!ii",
&imgind, &to_zval, &quality, &basefilter) == FAILURE) {
return;
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php