From: Nikita Popov Date: Tue, 2 Sep 2014 16:42:39 +0000 (+0200) Subject: Skip 64bit test on 32bit X-Git-Tag: PRE_PHP7_REMOVALS~145 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5138f3ba22e3dd5ee33fea9817a2c4c845b3ea55;p=php Skip 64bit test on 32bit Also minor type improvements --- diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 1dfaa332cb..d76d09561b 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -319,7 +319,7 @@ if (IS_GMP(zval)) { \ gmp_create(return_value, &gmpnumber TSRMLS_CC) static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base); -static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC); +static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC); static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC); /* @@ -722,7 +722,7 @@ ZEND_MODULE_INFO_D(gmp) /* {{{ convert_to_gmp * Convert zval to be gmp number */ -static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC) +static int convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base TSRMLS_DC) { switch (Z_TYPE_P(val)) { case IS_LONG: @@ -733,7 +733,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC) } case IS_STRING: { char *numstr = Z_STRVAL_P(val); - int skip_lead = 0; + zend_bool skip_lead = 0; int ret; if (Z_STRLEN_P(val) > 2) { @@ -748,7 +748,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC) } } - ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), base); + ret = mpz_set_str(gmpnumber, (skip_lead ? &numstr[2] : numstr), (int) base); if (-1 == ret) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert variable to GMP - string is not an integer"); @@ -767,7 +767,7 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC) static void gmp_strval(zval *result, mpz_t gmpnum, zend_long base) /* {{{ */ { - int num_len; + size_t num_len; zend_string *str; num_len = mpz_sizeinbase(gmpnum, abs(base)); diff --git a/ext/gmp/tests/gmp_php_int_max.phpt b/ext/gmp/tests/gmp_php_int_max.phpt index b85d9c5cea..1f680a1490 100644 --- a/ext/gmp/tests/gmp_php_int_max.phpt +++ b/ext/gmp/tests/gmp_php_int_max.phpt @@ -1,7 +1,10 @@ --TEST-- PHP_INT_MAX tests --SKIPIF-- - + --FILE--