From 86f18145b0870f07b68dc7f0f44a1a86b79a9a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Paw=C5=82ow?= Date: Fri, 23 Sep 2016 02:43:00 +0200 Subject: Port _php_handle_cliprect_array function. --- php_imlib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'php_imlib.c') diff --git a/php_imlib.c b/php_imlib.c index c1164a3..84f6a9a 100644 --- a/php_imlib.c +++ b/php_imlib.c @@ -831,7 +831,7 @@ PHP_MINFO_FUNCTION(imlib) static int _php_handle_cliprect_array(zval **dbox, char *func_name, int *x, int *y, int *w, int *h TSRMLS_DC) { - zval **element, ***box_coords; + zval *element, **box_coords; int i,arrcount; HashTable *box; @@ -848,20 +848,20 @@ static int _php_handle_cliprect_array(zval **dbox, char *func_name, return 0; } - box_coords = (zval ***)emalloc(arrcount * sizeof(zval **)); + box_coords = (zval **)emalloc(arrcount * sizeof(zval *)); for (i = 0; i < arrcount; i++) { - if (zend_hash_index_find(box, i, (void **)&element) == SUCCESS) + if (element = zend_hash_index_find(box, i)) { convert_to_long_ex(element); box_coords[i] = element; } } - *x = Z_LVAL_PP(box_coords[0]); - *y = Z_LVAL_PP(box_coords[1]); - *w = Z_LVAL_PP(box_coords[2]); - *h = Z_LVAL_PP(box_coords[3]); + *x = Z_LVAL_P(box_coords[0]); + *y = Z_LVAL_P(box_coords[1]); + *w = Z_LVAL_P(box_coords[2]); + *h = Z_LVAL_P(box_coords[3]); efree(box_coords); return 1; -- cgit v1.2.3