From a2f603174ce34359dde60b6227d138b5bf330503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Paw=C5=82ow?= Date: Wed, 14 Sep 2016 17:21:01 +0200 Subject: Revert "Quick and dirty PHP7 port." This reverts commit 87380c76cb1eb3644da7291d842281caaae63f2d. There are much more differences between PHP5 and 7 than I anticipated. The code doesn't work right. --- filters/php_testfilter.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'filters/php_testfilter.c') diff --git a/filters/php_testfilter.c b/filters/php_testfilter.c index c9e4b5b..ca844b3 100644 --- a/filters/php_testfilter.c +++ b/filters/php_testfilter.c @@ -14,9 +14,7 @@ _php_testfilter_tint(Imlib_Image im, HashTable* params) { Imlib_Image imge = im; Imlib_Image anoim; - ulong num_index; - zend_string *str_index; - imlib_zval *data; + HashPosition pos; Imlib_Color_Modifier cm; DATA8 atab[256]; @@ -30,21 +28,30 @@ _php_testfilter_tint(Imlib_Image im, HashTable* params) w = imlib_image_get_width(); h = imlib_image_get_height(); - ZEND_HASH_FOREACH_KEY_VAL(params, num_index, str_index, data) + zend_hash_internal_pointer_reset_ex(params,&pos); + while (pos) { - if (str_index) + char *str_index; + ulong num_index; + int retval; + + retval=zend_hash_get_current_key_ex(params,&str_index,NULL,&num_index,0,&pos); + if (retval==HASH_KEY_IS_STRING) { + zval **data; + zend_hash_get_current_data_ex(params,(void*)&data,&pos); convert_to_long_ex(data); - if (!strcmp(STR_VAL(str_index),"red")) r=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"blue")) b=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"green")) g=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"x")) x=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"y")) y=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"w")) w=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"h")) h=Z_LVAL_PP(data); - if (!strcmp(STR_VAL(str_index),"alpha")) a=Z_LVAL_PP(data); + if (!strcmp(str_index,"red")) r=Z_LVAL_PP(data); + if (!strcmp(str_index,"blue")) b=Z_LVAL_PP(data); + if (!strcmp(str_index,"green")) g=Z_LVAL_PP(data); + if (!strcmp(str_index,"x")) x=Z_LVAL_PP(data); + if (!strcmp(str_index,"y")) y=Z_LVAL_PP(data); + if (!strcmp(str_index,"w")) w=Z_LVAL_PP(data); + if (!strcmp(str_index,"h")) h=Z_LVAL_PP(data); + if (!strcmp(str_index,"alpha")) a=Z_LVAL_PP(data); } - } ZEND_HASH_FOREACH_END(); + zend_hash_move_forward_ex(params,&pos); + } /* zend_printf( "Using values red=%d,blue=%d,green=%d,x=%d,y=%d,height=%d,width=%d,alpha=%d\n", r,b,g,x,y,w,h,a ); */ -- cgit v1.2.3