summaryrefslogtreecommitdiff
path: root/ext/gd/gd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r--ext/gd/gd.c408
1 files changed, 203 insertions, 205 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5a820860e6..def17b8df3 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -64,8 +64,8 @@ static int le_gd, le_gd_font;
#if HAVE_LIBT1
#include <t1lib.h>
static int le_ps_font, le_ps_enc;
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC);
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC);
+static void php_free_ps_font(zend_resource *rsrc);
+static void php_free_ps_enc(zend_resource *rsrc);
#endif
#include <gd.h>
@@ -135,7 +135,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS);
static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
/* End Section filters declarations */
-static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC);
+static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)());
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
static int _php_image_type(char data[8]);
@@ -1072,7 +1072,7 @@ PHP_INI_END()
/* {{{ php_free_gd_image
*/
-static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_image(zend_resource *rsrc)
{
gdImageDestroy((gdImagePtr) rsrc->ptr);
}
@@ -1080,7 +1080,7 @@ static void php_free_gd_image(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_gd_font
*/
-static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_gd_font(zend_resource *rsrc)
{
gdFontPtr fp = (gdFontPtr) rsrc->ptr;
@@ -1097,9 +1097,8 @@ static void php_free_gd_font(zend_resource *rsrc TSRMLS_DC)
*/
void php_gd_error_method(int type, const char *format, va_list args)
{
- TSRMLS_FETCH();
- php_verror(NULL, "", type, format, args TSRMLS_CC);
+ php_verror(NULL, "", type, format, args);
}
/* }}} */
#endif
@@ -1427,7 +1426,7 @@ PHP_FUNCTION(imageloadfont)
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(), "s", &file, &file_name) == FAILURE) {
return;
}
@@ -1457,9 +1456,9 @@ PHP_FUNCTION(imageloadfont)
if (!n) {
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header");
+ php_error_docref(NULL, E_WARNING, "End of file while reading header");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header");
+ php_error_docref(NULL, E_WARNING, "Error while reading header");
}
php_stream_close(stream);
RETURN_FALSE;
@@ -1478,14 +1477,14 @@ PHP_FUNCTION(imageloadfont)
}
if (overflow2(font->nchars, font->h) || overflow2(font->nchars * font->h, font->w )) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font, invalid font header");
+ php_error_docref(NULL, E_WARNING, "Error reading font, invalid font header");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
}
if (body_size != body_size_check) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font");
+ php_error_docref(NULL, E_WARNING, "Error reading font");
efree(font);
php_stream_close(stream);
RETURN_FALSE;
@@ -1501,16 +1500,16 @@ PHP_FUNCTION(imageloadfont)
efree(font->data);
efree(font);
if (php_stream_eof(stream)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading body");
+ php_error_docref(NULL, E_WARNING, "End of file while reading body");
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body");
+ php_error_docref(NULL, E_WARNING, "Error while reading body");
}
php_stream_close(stream);
RETURN_FALSE;
}
php_stream_close(stream);
- ind = zend_list_insert(font, le_gd_font TSRMLS_CC);
+ ind = zend_list_insert(font, le_gd_font);
/* Adding 5 to the font index so we will never have font indices
* that overlap with the old fonts (with indices 1-5). The first
@@ -1529,7 +1528,7 @@ PHP_FUNCTION(imagesetstyle)
int *stylearr;
int index = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &styles) == FAILURE) {
return;
}
@@ -1557,12 +1556,12 @@ PHP_FUNCTION(imagecreatetruecolor)
zend_long 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(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -1583,7 +1582,7 @@ PHP_FUNCTION(imageistruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1602,14 +1601,14 @@ PHP_FUNCTION(imagetruecolortopalette)
zend_long ncolors;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rbl", &IM, &dither, &ncolors) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rbl", &IM, &dither, &ncolors) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
if (ncolors <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
+ php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero");
RETURN_FALSE;
}
gdImageTrueColorToPalette(im, dither, ncolors);
@@ -1625,7 +1624,7 @@ PHP_FUNCTION(imagepalettetotruecolor)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -1647,7 +1646,7 @@ PHP_FUNCTION(imagecolormatch)
gdImagePtr im1, im2;
int result;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM1, &IM2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM1, &IM2) == FAILURE) {
return;
}
@@ -1657,19 +1656,19 @@ PHP_FUNCTION(imagecolormatch)
result = gdImageColorMatch(im1, im2);
switch (result) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 must be TrueColor" );
+ php_error_docref(NULL, E_WARNING, "Image1 must be TrueColor" );
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must be Palette" );
+ php_error_docref(NULL, E_WARNING, "Image2 must be Palette" );
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image1 and Image2 must be the same size" );
+ php_error_docref(NULL, E_WARNING, "Image1 and Image2 must be the same size" );
RETURN_FALSE;
break;
case -4:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Image2 must have at least one color" );
+ php_error_docref(NULL, E_WARNING, "Image2 must have at least one color" );
RETURN_FALSE;
break;
}
@@ -1686,7 +1685,7 @@ PHP_FUNCTION(imagesetthickness)
zend_long thick;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &thick) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &thick) == FAILURE) {
return;
}
@@ -1706,7 +1705,7 @@ PHP_FUNCTION(imagefilledellipse)
zend_long 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(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -1727,7 +1726,7 @@ PHP_FUNCTION(imagefilledarc)
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(), "rllllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) {
return;
}
@@ -1757,7 +1756,7 @@ PHP_FUNCTION(imagealphablending)
zend_bool blend;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &blend) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &blend) == FAILURE) {
return;
}
@@ -1776,7 +1775,7 @@ PHP_FUNCTION(imagesavealpha)
zend_bool save;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &save) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &save) == FAILURE) {
return;
}
@@ -1795,7 +1794,7 @@ PHP_FUNCTION(imagelayereffect)
zend_long effect;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &effect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &effect) == FAILURE) {
return;
}
@@ -1815,7 +1814,7 @@ PHP_FUNCTION(imagecolorallocatealpha)
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(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
RETURN_FALSE;
}
@@ -1836,7 +1835,7 @@ PHP_FUNCTION(imagecolorresolvealpha)
zend_long 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(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1854,7 +1853,7 @@ PHP_FUNCTION(imagecolorclosestalpha)
zend_long 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(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1872,7 +1871,7 @@ PHP_FUNCTION(imagecolorexactalpha)
zend_long 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(), "rllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -1891,7 +1890,7 @@ PHP_FUNCTION(imagecopyresampled)
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(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -1933,14 +1932,14 @@ PHP_FUNCTION(imagegrabwindow)
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(), "l|l", &lwindow_handle, &client_area) == FAILURE) {
RETURN_FALSE;
}
window = (HWND) lwindow_handle;
if (!IsWindow(window)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid window handle");
+ php_error_docref(NULL, E_NOTICE, "Invalid window handle");
RETURN_FALSE;
}
@@ -1972,7 +1971,7 @@ PHP_FUNCTION(imagegrabwindow)
if ( pPrintWindow ) {
pPrintWindow(window, memDC, (UINT) client_area);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows API too old");
+ php_error_docref(NULL, E_WARNING, "Windows API too old");
goto clean;
}
@@ -2073,7 +2072,7 @@ PHP_FUNCTION(imagerotate)
zend_long color;
zend_long ignoretransparent = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdl|l", &SIM, &degrees, &color, &ignoretransparent) == FAILURE) {
RETURN_FALSE;
}
@@ -2096,7 +2095,7 @@ PHP_FUNCTION(imagesettile)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2116,7 +2115,7 @@ PHP_FUNCTION(imagesetbrush)
zval *IM, *TILE;
gdImagePtr im, tile;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &IM, &TILE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &IM, &TILE) == FAILURE) {
return;
}
@@ -2136,12 +2135,12 @@ PHP_FUNCTION(imagecreate)
zend_long 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(), "ll", &x_size, &y_size) == FAILURE) {
return;
}
if (x_size <= 0 || y_size <= 0 || x_size >= INT_MAX || y_size >= INT_MAX) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -2240,7 +2239,7 @@ static int _php_image_type (char data[8])
/* {{{ _php_image_create_from_string
*/
-gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC)
+gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioctx_func_p)())
{
gdImagePtr im;
gdIOCtx *io_ctx;
@@ -2253,7 +2252,7 @@ gdImagePtr _php_image_create_from_string(zval *data, char *tn, gdImagePtr (*ioct
im = (*ioctx_func_p)(io_ctx);
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn);
+ php_error_docref(NULL, E_WARNING, "Passed data is not in '%s' format", tn);
io_ctx->gd_free(io_ctx);
return NULL;
}
@@ -2273,13 +2272,13 @@ PHP_FUNCTION(imagecreatefromstring)
int imtype;
char sig[8];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &data) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &data) == FAILURE) {
return;
}
convert_to_string_ex(data);
if (Z_STRLEN_P(data) < 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty string or invalid image");
+ php_error_docref(NULL, E_WARNING, "Empty string or invalid image");
RETURN_FALSE;
}
@@ -2290,41 +2289,41 @@ PHP_FUNCTION(imagecreatefromstring)
switch (imtype) {
case PHP_GDIMG_TYPE_JPG:
#ifdef HAVE_GD_JPG
- im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No JPEG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No JPEG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_PNG:
#ifdef HAVE_GD_PNG
- im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx);
#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PNG support in this PHP build");
+ php_error_docref(NULL, E_WARNING, "No PNG support in this PHP build");
RETURN_FALSE;
#endif
break;
case PHP_GDIMG_TYPE_GIF:
- im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx);
break;
case PHP_GDIMG_TYPE_WBM:
- im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx);
break;
case PHP_GDIMG_TYPE_GD2:
- im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC);
+ im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data is not in a recognized format");
+ php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
RETURN_FALSE;
}
if (!im) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't create GD Image Stream out of Data");
+ php_error_docref(NULL, E_WARNING, "Couldn't create GD Image Stream out of Data");
RETURN_FALSE;
}
@@ -2347,15 +2346,15 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
#endif
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(), "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
return;
}
if (width < 1 || height < 1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero width or height not allowed");
+ php_error_docref(NULL, E_WARNING, "Zero width or height not allowed");
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
}
@@ -2380,7 +2379,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
buff = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0);
if (!buff) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data");
+ php_error_docref(NULL, E_WARNING,"Cannot read image data");
goto out_err;
}
@@ -2390,7 +2389,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
if (!io_ctx) {
pefree(pstr, 1);
zend_string_release(buff);
- php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
+ php_error_docref(NULL, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
}
@@ -2443,7 +2442,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
return;
}
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid %s file", file, tn);
+ php_error_docref(NULL, E_WARNING, "'%s' is not a valid %s file", file, tn);
out_err:
php_stream_close(stream);
RETURN_FALSE;
@@ -2557,7 +2556,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
/* 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, "r|pll", &imgind, &file, &file_len, &quality, &type) == FAILURE) {
return;
}
@@ -2578,7 +2577,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
fp = VCWD_FOPEN(fn, "wb");
if (!fp) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn);
RETURN_FALSE;
}
@@ -2587,7 +2586,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, fp);
@@ -2628,9 +2627,9 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
char buf[4096];
char *path;
- tmp = php_open_temporary_file(NULL, NULL, &path TSRMLS_CC);
+ tmp = php_open_temporary_file(NULL, NULL, &path);
if (tmp == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
+ php_error_docref(NULL, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
}
@@ -2639,7 +2638,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
if (q == -1) {
q = 0;
} else if (q < 0 || q > 255) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q);
q = 0;
}
gdImageWBMP(im, q, tmp);
@@ -2681,7 +2680,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
#endif
while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) {
- php_write(buf, b TSRMLS_CC);
+ php_write(buf, b);
}
fclose(tmp);
@@ -2771,7 +2770,7 @@ PHP_FUNCTION(imagedestroy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -2793,7 +2792,7 @@ PHP_FUNCTION(imagecolorallocate)
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(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2814,7 +2813,7 @@ PHP_FUNCTION(imagepalettecopy)
zval *dstim, *srcim;
gdImagePtr dst, src;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &dstim, &srcim) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rr", &dstim, &srcim) == FAILURE) {
return;
}
@@ -2833,7 +2832,7 @@ PHP_FUNCTION(imagecolorat)
zend_long 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(), "rll", &IM, &x, &y) == FAILURE) {
return;
}
@@ -2843,14 +2842,14 @@ PHP_FUNCTION(imagecolorat)
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%pd,%pd is out of bounds", x, y);
+ php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
RETURN_FALSE;
}
}
@@ -2865,7 +2864,7 @@ PHP_FUNCTION(imagecolorclosest)
zend_long 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(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2883,7 +2882,7 @@ PHP_FUNCTION(imagecolorclosesthwb)
zend_long 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(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2902,7 +2901,7 @@ PHP_FUNCTION(imagecolordeallocate)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -2919,7 +2918,7 @@ PHP_FUNCTION(imagecolordeallocate)
gdImageColorDeallocate(im, col);
RETURN_TRUE;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -2933,7 +2932,7 @@ PHP_FUNCTION(imagecolorresolve)
zend_long 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(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2951,7 +2950,7 @@ PHP_FUNCTION(imagecolorexact)
zend_long 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(), "rlll", &IM, &red, &green, &blue) == FAILURE) {
return;
}
@@ -2970,7 +2969,7 @@ PHP_FUNCTION(imagecolorset)
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(), "rllll|l", &IM, &color, &red, &green, &blue, &alpha) == FAILURE) {
return;
}
@@ -2998,7 +2997,7 @@ PHP_FUNCTION(imagecolorsforindex)
int col;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &index) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &index) == FAILURE) {
return;
}
@@ -3014,7 +3013,7 @@ PHP_FUNCTION(imagecolorsforindex)
add_assoc_long(return_value,"blue", gdImageBlue(im,col));
add_assoc_long(return_value,"alpha", gdImageAlpha(im,col));
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col);
+ php_error_docref(NULL, E_WARNING, "Color index %d out of range", col);
RETURN_FALSE;
}
}
@@ -3029,7 +3028,7 @@ PHP_FUNCTION(imagegammacorrect)
int i;
double input, output;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rdd", &IM, &input, &output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rdd", &IM, &input, &output) == FAILURE) {
return;
}
@@ -3071,7 +3070,7 @@ PHP_FUNCTION(imagesetpixel)
zend_long 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(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3089,7 +3088,7 @@ PHP_FUNCTION(imageline)
zend_long 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(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3115,7 +3114,7 @@ PHP_FUNCTION(imagedashedline)
zend_long 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(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3133,7 +3132,7 @@ PHP_FUNCTION(imagerectangle)
zend_long 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(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3151,7 +3150,7 @@ PHP_FUNCTION(imagefilledrectangle)
zend_long 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(), "rlllll", &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) {
return;
}
@@ -3170,7 +3169,7 @@ PHP_FUNCTION(imagearc)
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(), "rlllllll", &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) {
return;
}
@@ -3199,7 +3198,7 @@ PHP_FUNCTION(imageellipse)
zend_long 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(), "rlllll", &IM, &cx, &cy, &w, &h, &color) == FAILURE) {
return;
}
@@ -3218,7 +3217,7 @@ PHP_FUNCTION(imagefilltoborder)
zend_long 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(), "rllll", &IM, &x, &y, &border, &col) == FAILURE) {
return;
}
@@ -3236,7 +3235,7 @@ PHP_FUNCTION(imagefill)
zend_long 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(), "rlll", &IM, &x, &y, &col) == FAILURE) {
return;
}
@@ -3253,7 +3252,7 @@ PHP_FUNCTION(imagecolorstotal)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3272,7 +3271,7 @@ PHP_FUNCTION(imagecolortransparent)
gdImagePtr im;
int argc = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &COL) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &COL) == FAILURE) {
return;
}
@@ -3295,7 +3294,7 @@ PHP_FUNCTION(imageinterlace)
zend_long INT = 0;
gdImagePtr im;
- if (zend_parse_parameters(argc TSRMLS_CC, "r|l", &IM, &INT) == FAILURE) {
+ if (zend_parse_parameters(argc, "r|l", &IM, &INT) == FAILURE) {
return;
}
@@ -3322,7 +3321,7 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
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(), "rall", &IM, &POINTS, &NPOINTS, &COL) == FAILURE) {
return;
}
@@ -3333,15 +3332,15 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
nelem = zend_hash_num_elements(Z_ARRVAL_P(POINTS));
if (nelem < 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array");
+ php_error_docref(NULL, E_WARNING, "You must have at least 3 points in your array");
RETURN_FALSE;
}
if (npoints <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must give a positive number of points");
+ php_error_docref(NULL, E_WARNING, "You must give a positive number of points");
RETURN_FALSE;
}
if (nelem < npoints * 2) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
+ php_error_docref(NULL, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2);
RETURN_FALSE;
}
@@ -3385,7 +3384,7 @@ PHP_FUNCTION(imagefilledpolygon)
/* {{{ php_find_gd_font
*/
-static gdFontPtr php_find_gd_font(int size TSRMLS_DC)
+static gdFontPtr php_find_gd_font(int size)
{
gdFontPtr font;
@@ -3433,11 +3432,11 @@ static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg)
zend_long SIZE;
gdFontPtr font;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &SIZE) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &SIZE) == FAILURE) {
return;
}
- font = php_find_gd_font(SIZE TSRMLS_CC);
+ font = php_find_gd_font(SIZE);
RETURN_LONG(arg ? font->h : font->w);
}
/* }}} */
@@ -3501,7 +3500,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
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(), "rlllsl", &IM, &SIZE, &X, &Y, &C, &C_len, &COL) == FAILURE) {
return;
}
@@ -3520,7 +3519,7 @@ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode)
x = X;
size = SIZE;
- font = php_find_gd_font(size TSRMLS_CC);
+ font = php_find_gd_font(size);
switch (mode) {
case 0:
@@ -3592,7 +3591,7 @@ PHP_FUNCTION(imagecopy)
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(), "rrllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) {
return;
}
@@ -3620,7 +3619,7 @@ PHP_FUNCTION(imagecopymerge)
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(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3649,7 +3648,7 @@ PHP_FUNCTION(imagecopymergegray)
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(), "rrlllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) {
return;
}
@@ -3678,7 +3677,7 @@ PHP_FUNCTION(imagecopyresized)
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(), "rrllllllll", &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) {
return;
}
@@ -3695,7 +3694,7 @@ PHP_FUNCTION(imagecopyresized)
dstW = DW;
if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions");
+ php_error_docref(NULL, E_WARNING, "Invalid image dimensions");
RETURN_FALSE;
}
@@ -3711,7 +3710,7 @@ PHP_FUNCTION(imagesx)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3728,7 +3727,7 @@ PHP_FUNCTION(imagesy)
zval *IM;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &IM) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &IM) == FAILURE) {
return;
}
@@ -3797,13 +3796,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, "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, "rddlllss|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);
@@ -3851,7 +3850,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
#endif /* HAVE_GD_FREETYPE */
if (error) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error);
+ php_error_docref(NULL, E_WARNING, "%s", error);
RETURN_FALSE;
}
@@ -3869,7 +3868,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int
/* {{{ php_free_ps_font
*/
-static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_font(zend_resource *rsrc)
{
int *font = (int *)rsrc->ptr;
@@ -3880,7 +3879,7 @@ static void php_free_ps_font(zend_resource *rsrc TSRMLS_DC)
/* {{{ php_free_ps_enc
*/
-static void php_free_ps_enc(zend_resource *rsrc TSRMLS_DC)
+static void php_free_ps_enc(zend_resource *rsrc)
{
char **enc = (char **)rsrc->ptr;
@@ -3898,13 +3897,13 @@ PHP_FUNCTION(imagepsloadfont)
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(), "s", &file, &file_len) == FAILURE) {
return;
}
#ifdef PHP_WIN32
if (VCWD_STAT(file, &st) < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font file not found (%s)", file);
+ php_error_docref(NULL, E_WARNING, "Font file not found (%s)", file);
RETURN_FALSE;
}
#endif
@@ -3912,12 +3911,12 @@ PHP_FUNCTION(imagepsloadfont)
f_ind = T1_AddFont(file);
if (f_ind < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error (%i): %s", f_ind, T1_StrError(f_ind));
RETURN_FALSE;
}
if (T1_LoadFont(f_ind)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load the font");
+ php_error_docref(NULL, E_WARNING, "Couldn't load the font");
RETURN_FALSE;
}
@@ -3936,14 +3935,14 @@ PHP_FUNCTION(imagepscopyfont)
gd_ps_font *nf_ind, *of_ind;
long fnt;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &fnt) == FAILURE) {
return;
}
of_ind = zend_list_find(fnt, &type);
if (type != le_ps_font) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", fnt);
+ php_error_docref(NULL, E_WARNING, "%ld is not a Type 1 font index", fnt);
RETURN_FALSE;
}
@@ -3955,26 +3954,26 @@ PHP_FUNCTION(imagepscopyfont)
efree(nf_ind);
switch (l_ind) {
case -1:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "FontID %d is not loaded in memory", l_ind);
+ php_error_docref(NULL, E_WARNING, "FontID %d is not loaded in memory", l_ind);
RETURN_FALSE;
break;
case -2:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to copy a logical font");
+ php_error_docref(NULL, E_WARNING, "Tried to copy a logical font");
RETURN_FALSE;
break;
case -3:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib");
+ php_error_docref(NULL, E_WARNING, "Memory allocation fault in t1lib");
RETURN_FALSE;
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib");
+ php_error_docref(NULL, E_WARNING, "An unknown error occurred in t1lib");
RETURN_FALSE;
break;
}
}
nf_ind->extend = 1;
- l_ind = zend_list_insert(nf_ind, le_ps_font TSRMLS_CC);
+ l_ind = zend_list_insert(nf_ind, le_ps_font);
RETURN_LONG(l_ind);
}
*/
@@ -3987,7 +3986,7 @@ PHP_FUNCTION(imagepsfreefont)
zval *fnt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &fnt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &fnt) == FAILURE) {
return;
}
@@ -4005,25 +4004,25 @@ PHP_FUNCTION(imagepsencodefont)
char *enc, **enc_vector;
size_t enc_len, *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &fnt, &enc, &enc_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &fnt, &enc, &enc_len) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font);
if ((enc_vector = T1_LoadEncoding(enc)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load encoding vector from %s", enc);
+ php_error_docref(NULL, E_WARNING, "Couldn't load encoding vector from %s", enc);
RETURN_FALSE;
}
T1_DeleteAllSizes(*f_ind);
if (T1_ReencodeFont(*f_ind, enc_vector)) {
T1_DeleteEncoding(enc_vector);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-encode font");
+ php_error_docref(NULL, E_WARNING, "Couldn't re-encode font");
RETURN_FALSE;
}
- zend_list_insert(enc_vector, le_ps_enc TSRMLS_CC);
+ zend_list_insert(enc_vector, le_ps_enc);
RETURN_TRUE;
}
@@ -4037,7 +4036,7 @@ PHP_FUNCTION(imagepsextendfont)
double ext;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &ext) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &ext) == FAILURE) {
return;
}
@@ -4046,7 +4045,7 @@ PHP_FUNCTION(imagepsextendfont)
T1_DeleteAllSizes(*f_ind);
if (ext <= 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
+ php_error_docref(NULL, E_WARNING, "Second parameter %F out of range (must be > 0)", ext);
RETURN_FALSE;
}
@@ -4066,7 +4065,7 @@ PHP_FUNCTION(imagepsslantfont)
double slt;
int *f_ind;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rd", &fnt, &slt) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rd", &fnt, &slt) == FAILURE) {
return;
}
@@ -4102,12 +4101,12 @@ PHP_FUNCTION(imagepstext)
char *str;
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(), "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) {
return;
}
if (aa_steps != 4 && aa_steps != 16) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Antialias steps must be 4 or 16");
+ php_error_docref(NULL, E_WARNING, "Antialias steps must be 4 or 16");
RETURN_FALSE;
}
@@ -4116,12 +4115,12 @@ PHP_FUNCTION(imagepstext)
/* Ensure that the provided colors are valid */
if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %pd out of range", _fg);
+ php_error_docref(NULL, E_WARNING, "Foreground color index %pd out of range", _fg);
RETURN_FALSE;
}
if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %pd out of range", _bg);
+ php_error_docref(NULL, E_WARNING, "Background color index %pd out of range", _bg);
RETURN_FALSE;
}
@@ -4155,7 +4154,7 @@ PHP_FUNCTION(imagepstext)
T1_AASetLevel(T1_AA_HIGH);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
+ php_error_docref(NULL, E_WARNING, "Invalid value %pd as number of steps for antialiasing", aa_steps);
RETURN_FALSE;
}
@@ -4169,7 +4168,7 @@ PHP_FUNCTION(imagepstext)
if (!str_path) {
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
}
RETURN_FALSE;
}
@@ -4190,7 +4189,7 @@ PHP_FUNCTION(imagepstext)
str_img = T1_AASetString(*f_ind, str, str_len, space, T1_KERNING, size, transform);
}
if (T1_errno) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
+ php_error_docref(NULL, E_WARNING, "T1Lib Error: %s", T1_StrError(T1_errno));
RETURN_FALSE;
}
@@ -4239,7 +4238,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(), "srl|lld", &str, &str_len, &fnt, &sz, &sp, &wd, &angle) == FAILURE) {
return;
}
@@ -4357,23 +4356,22 @@ static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold
int dest_height = gdImageSY(im_org);
int dest_width = gdImageSX(im_org);
int x, y;
- TSRMLS_FETCH();
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
return;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
return;
}
@@ -4421,7 +4419,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
zend_long ignore_warning;
#endif
- 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(), "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) {
return;
}
@@ -4433,7 +4431,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Check threshold value */
if (int_threshold < 0 || int_threshold > 8) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'", int_threshold);
+ php_error_docref(NULL, E_WARNING, "Invalid threshold value '%d'", int_threshold);
RETURN_FALSE;
}
@@ -4446,14 +4444,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
/* Open origin file */
org = VCWD_FOPEN(fn_org, "rb");
if (!org) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for reading", fn_org);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for reading", fn_org);
RETURN_FALSE;
}
/* Open destination file */
dest = VCWD_FOPEN(fn_dest, "wb");
if (!dest) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
RETURN_FALSE;
}
@@ -4461,7 +4459,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_GIF:
im_org = gdImageCreateFromGif(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4471,7 +4469,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
ignore_warning = INI_INT("gd.jpeg_ignore_warning");
im_org = gdImageCreateFromJpegEx(org, ignore_warning);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
RETURN_FALSE;
}
break;
@@ -4481,14 +4479,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
case PHP_GDIMG_TYPE_PNG:
im_org = gdImageCreateFromPng(org);
if (im_org == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
+ php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
RETURN_FALSE;
}
break;
#endif /* HAVE_GD_PNG */
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported");
+ php_error_docref(NULL, E_WARNING, "Format not supported");
RETURN_FALSE;
break;
}
@@ -4522,7 +4520,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_tmp = gdImageCreate (dest_width, dest_height);
if (im_tmp == NULL ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
RETURN_FALSE;
}
@@ -4534,19 +4532,19 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
RETURN_FALSE;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer");
+ php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
RETURN_FALSE;
}
@@ -4582,7 +4580,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
#define PHP_GD_SINGLE_RES \
zval *SIM; \
gdImagePtr im_src; \
- if (zend_parse_parameters(1 TSRMLS_CC, "r", &SIM) == FAILURE) { \
+ if (zend_parse_parameters(1, "r", &SIM) == FAILURE) { \
RETURN_FALSE; \
} \
ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); \
@@ -4618,7 +4616,7 @@ static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long brightness, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zll", &SIM, &tmp, &brightness) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zll", &SIM, &tmp, &brightness) == FAILURE) {
RETURN_FALSE;
}
@@ -4641,7 +4639,7 @@ static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS)
gdImagePtr im_src;
zend_long contrast, tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &SIM, &tmp, &contrast) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rll", &SIM, &tmp, &contrast) == FAILURE) {
RETURN_FALSE;
}
@@ -4665,7 +4663,7 @@ static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS)
zend_long r,g,b,tmp;
zend_long 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(), "rllll|l", &SIM, &tmp, &r, &g, &b, &a) == FAILURE) {
RETURN_FALSE;
}
@@ -4744,7 +4742,7 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS)
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(), "rld", &SIM, &tmp, &weight) == FAILURE) {
RETURN_FALSE;
}
@@ -4768,7 +4766,7 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS)
zend_long 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(), "rll|b", &IM, &tmp, &blocksize, &mode) == FAILURE) {
RETURN_FALSE;
}
@@ -4811,7 +4809,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, "rl", &tmp, &filtertype) == FAILURE) {
return;
}
@@ -4832,7 +4830,7 @@ PHP_FUNCTION(imageconvolution)
int nelem, i, j, res;
float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "radd", &SIM, &hash_matrix, &div, &offset) == FAILURE) {
RETURN_FALSE;
}
@@ -4840,14 +4838,14 @@ PHP_FUNCTION(imageconvolution)
nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
if (nelem != 3) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
for (i=0; i<3; i++) {
if ((var = zend_hash_index_find(Z_ARRVAL_P(hash_matrix), (i))) != NULL && Z_TYPE_P(var) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL_P(var)) != 3 ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have 3x3 array");
+ php_error_docref(NULL, E_WARNING, "You must have 3x3 array");
RETURN_FALSE;
}
@@ -4855,7 +4853,7 @@ PHP_FUNCTION(imageconvolution)
if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), j)) != NULL) {
matrix[i][j] = (float) zval_get_double(var2);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have a 3x3 matrix");
+ php_error_docref(NULL, E_WARNING, "You must have a 3x3 matrix");
RETURN_FALSE;
}
}
@@ -4880,7 +4878,7 @@ PHP_FUNCTION(imageflip)
zend_long mode;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &IM, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &IM, &mode) == FAILURE) {
return;
}
@@ -4900,7 +4898,7 @@ PHP_FUNCTION(imageflip)
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown flip mode");
+ php_error_docref(NULL, E_WARNING, "Unknown flip mode");
RETURN_FALSE;
}
@@ -4917,7 +4915,7 @@ PHP_FUNCTION(imageantialias)
zend_bool alias;
gdImagePtr im;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &IM, &alias) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &IM, &alias) == FAILURE) {
return;
}
@@ -4939,7 +4937,7 @@ PHP_FUNCTION(imagecrop)
zval *z_rect;
zval *tmp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &z_rect) == FAILURE) {
return;
}
@@ -4948,28 +4946,28 @@ PHP_FUNCTION(imagecrop)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") -1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
@@ -4994,7 +4992,7 @@ PHP_FUNCTION(imagecropauto)
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(), "r|ldl", &IM, &mode, &threshold, &color) == FAILURE) {
return;
}
@@ -5013,14 +5011,14 @@ PHP_FUNCTION(imagecropauto)
case GD_CROP_THRESHOLD:
if (color < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode");
+ php_error_docref(NULL, E_WARNING, "Color argument missing with threshold mode");
RETURN_FALSE;
}
im_crop = gdImageCropThreshold(im, color, (float) threshold);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown crop mode");
+ php_error_docref(NULL, E_WARNING, "Unknown crop mode");
RETURN_FALSE;
}
if (im_crop == NULL) {
@@ -5042,7 +5040,7 @@ PHP_FUNCTION(imagescale)
zend_long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED;
gdInterpolationMethod method;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) {
return;
}
method = tmp_m;
@@ -5091,14 +5089,14 @@ PHP_FUNCTION(imageaffine)
int i, nelems;
zval *zval_affine_elem = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra|a", &IM, &z_affine, &z_rect) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(src, gdImagePtr, IM, -1, "Image", le_gd);
if ((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine array must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine array must have six elements");
RETURN_FALSE;
}
@@ -5115,7 +5113,7 @@ PHP_FUNCTION(imageaffine)
affine[i] = zval_get_double(zval_affine_elem);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5125,28 +5123,28 @@ PHP_FUNCTION(imageaffine)
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") - 1)) != NULL) {
rect.x = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) {
rect.y = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) {
rect.width = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width");
+ php_error_docref(NULL, E_WARNING, "Missing width");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) {
rect.height = zval_get_long(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height");
+ php_error_docref(NULL, E_WARNING, "Missing height");
RETURN_FALSE;
}
pRect = &rect;
@@ -5180,7 +5178,7 @@ PHP_FUNCTION(imageaffinematrixget)
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(), "l|z", &type, &options) == FAILURE) {
return;
}
@@ -5189,20 +5187,20 @@ PHP_FUNCTION(imageaffinematrixget)
case GD_AFFINE_SCALE: {
double x, y;
if (!options || Z_TYPE_P(options) != IS_ARRAY) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array expected as options");
+ php_error_docref(NULL, E_WARNING, "Array expected as options");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "x", sizeof("x") - 1)) != NULL) {
x = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position");
+ php_error_docref(NULL, E_WARNING, "Missing x position");
RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(HASH_OF(options), "y", sizeof("y") - 1)) != NULL) {
y = zval_get_double(tmp);
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position");
+ php_error_docref(NULL, E_WARNING, "Missing y position");
RETURN_FALSE;
}
@@ -5220,7 +5218,7 @@ PHP_FUNCTION(imageaffinematrixget)
double angle;
if (!options) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
+ php_error_docref(NULL, E_WARNING, "Number is expected as option");
RETURN_FALSE;
}
@@ -5237,7 +5235,7 @@ PHP_FUNCTION(imageaffinematrixget)
}
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %li", type);
RETURN_FALSE;
}
@@ -5264,12 +5262,12 @@ PHP_FUNCTION(imageaffinematrixconcat)
zval *z_m2;
int i, nelems;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "aa", &z_m1, &z_m2) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "aa", &z_m1, &z_m2) == FAILURE) {
return;
}
if (((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m1))) != 6) || (nelems = zend_hash_num_elements(Z_ARRVAL_P(z_m2))) != 6) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Affine arrays must have six elements");
+ php_error_docref(NULL, E_WARNING, "Affine arrays must have six elements");
RETURN_FALSE;
}
@@ -5286,7 +5284,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m1[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5302,7 +5300,7 @@ PHP_FUNCTION(imageaffinematrixconcat)
m2[i] = zval_get_double(tmp);
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i);
+ php_error_docref(NULL, E_WARNING, "Invalid type for element %i", i);
RETURN_FALSE;
}
}
@@ -5326,7 +5324,7 @@ PHP_FUNCTION(imagesetinterpolation)
gdImagePtr im;
zend_long 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(), "r|l", &IM, &method) == FAILURE) {
return;
}