@@ -3712,7 +3712,7 @@ PHP_FUNCTION(imageconvolution)
3712
3712
zval * var = NULL , * var2 = NULL ;
3713
3713
gdImagePtr im_src = NULL ;
3714
3714
double div , offset ;
3715
- int nelem , i , j , res ;
3715
+ int i , j , res ;
3716
3716
float matrix [3 ][3 ] = {{0 ,0 ,0 }, {0 ,0 ,0 }, {0 ,0 ,0 }};
3717
3717
3718
3718
ZEND_PARSE_PARAMETERS_START (4 , 4 )
@@ -3724,8 +3724,7 @@ PHP_FUNCTION(imageconvolution)
3724
3724
3725
3725
im_src = php_gd_libgdimageptr_from_zval_p (SIM );
3726
3726
3727
- nelem = zend_hash_num_elements (Z_ARRVAL_P (hash_matrix ));
3728
- if (nelem != 3 ) {
3727
+ if (zend_hash_num_elements (Z_ARRVAL_P (hash_matrix )) != 3 ) {
3729
3728
zend_argument_value_error (2 , "must be a 3x3 array" );
3730
3729
RETURN_THROWS ();
3731
3730
}
@@ -4045,7 +4044,6 @@ PHP_FUNCTION(imageaffine)
4045
4044
zval * z_affine ;
4046
4045
zval * tmp ;
4047
4046
double affine [6 ];
4048
- int i , nelems ;
4049
4047
zval * zval_affine_elem = NULL ;
4050
4048
4051
4049
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -4057,13 +4055,13 @@ PHP_FUNCTION(imageaffine)
4057
4055
4058
4056
4059
4057
src = php_gd_libgdimageptr_from_zval_p (IM );
4060
-
4061
- if (( nelems = zend_hash_num_elements ( Z_ARRVAL_P ( z_affine ))) != 6 ) {
4058
+ uint32_t nelems = zend_hash_num_elements ( Z_ARRVAL_P ( z_affine ));
4059
+ if (nelems != 6 ) {
4062
4060
zend_argument_value_error (2 , "must have 6 elements" );
4063
4061
RETURN_THROWS ();
4064
4062
}
4065
4063
4066
- for (i = 0 ; i < nelems ; i ++ ) {
4064
+ for (uint32_t i = 0 ; i < nelems ; i ++ ) {
4067
4065
if ((zval_affine_elem = zend_hash_index_find_deref (Z_ARRVAL_P (z_affine ), i )) != NULL ) {
4068
4066
switch (Z_TYPE_P (zval_affine_elem )) {
4069
4067
case IS_LONG :
0 commit comments