mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
ext/gd: Use uint32_t type instead of int type
This commit is contained in:
parent
80ea28e918
commit
9491c6850b
1 changed files with 5 additions and 7 deletions
12
ext/gd/gd.c
12
ext/gd/gd.c
|
@ -3712,7 +3712,7 @@ PHP_FUNCTION(imageconvolution)
|
||||||
zval *var = NULL, *var2 = NULL;
|
zval *var = NULL, *var2 = NULL;
|
||||||
gdImagePtr im_src = NULL;
|
gdImagePtr im_src = NULL;
|
||||||
double div, offset;
|
double div, offset;
|
||||||
int nelem, i, j, res;
|
int i, j, res;
|
||||||
float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
|
float matrix[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
|
||||||
|
|
||||||
ZEND_PARSE_PARAMETERS_START(4, 4)
|
ZEND_PARSE_PARAMETERS_START(4, 4)
|
||||||
|
@ -3724,8 +3724,7 @@ PHP_FUNCTION(imageconvolution)
|
||||||
|
|
||||||
im_src = php_gd_libgdimageptr_from_zval_p(SIM);
|
im_src = php_gd_libgdimageptr_from_zval_p(SIM);
|
||||||
|
|
||||||
nelem = zend_hash_num_elements(Z_ARRVAL_P(hash_matrix));
|
if (zend_hash_num_elements(Z_ARRVAL_P(hash_matrix)) != 3) {
|
||||||
if (nelem != 3) {
|
|
||||||
zend_argument_value_error(2, "must be a 3x3 array");
|
zend_argument_value_error(2, "must be a 3x3 array");
|
||||||
RETURN_THROWS();
|
RETURN_THROWS();
|
||||||
}
|
}
|
||||||
|
@ -4045,7 +4044,6 @@ PHP_FUNCTION(imageaffine)
|
||||||
zval *z_affine;
|
zval *z_affine;
|
||||||
zval *tmp;
|
zval *tmp;
|
||||||
double affine[6];
|
double affine[6];
|
||||||
int i, nelems;
|
|
||||||
zval *zval_affine_elem = NULL;
|
zval *zval_affine_elem = NULL;
|
||||||
|
|
||||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||||
|
@ -4057,13 +4055,13 @@ PHP_FUNCTION(imageaffine)
|
||||||
|
|
||||||
|
|
||||||
src = php_gd_libgdimageptr_from_zval_p(IM);
|
src = php_gd_libgdimageptr_from_zval_p(IM);
|
||||||
|
uint32_t nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine));
|
||||||
if ((nelems = zend_hash_num_elements(Z_ARRVAL_P(z_affine))) != 6) {
|
if (nelems != 6) {
|
||||||
zend_argument_value_error(2, "must have 6 elements");
|
zend_argument_value_error(2, "must have 6 elements");
|
||||||
RETURN_THROWS();
|
RETURN_THROWS();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < nelems; i++) {
|
for (uint32_t i = 0; i < nelems; i++) {
|
||||||
if ((zval_affine_elem = zend_hash_index_find_deref(Z_ARRVAL_P(z_affine), i)) != NULL) {
|
if ((zval_affine_elem = zend_hash_index_find_deref(Z_ARRVAL_P(z_affine), i)) != NULL) {
|
||||||
switch (Z_TYPE_P(zval_affine_elem)) {
|
switch (Z_TYPE_P(zval_affine_elem)) {
|
||||||
case IS_LONG:
|
case IS_LONG:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue