summaryrefslogtreecommitdiff
path: root/ext/gmp/gmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gmp/gmp.c')
-rw-r--r--ext/gmp/gmp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 0f4b317fd0..55567f5c6d 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -72,7 +72,7 @@ PHP_GMP_API zend_class_entry *php_gmp_class_entry(void) {
typedef struct _gmp_temp {
mpz_t num;
- zend_bool is_used;
+ bool is_used;
} gmp_temp_t;
#define GMP_ROUND_ZERO 0
@@ -598,13 +598,16 @@ static zend_result convert_to_gmp(mpz_t gmpnumber, zval *val, zend_long base, ui
return SUCCESS;
case IS_STRING: {
char *numstr = Z_STRVAL_P(val);
- zend_bool skip_lead = 0;
+ bool skip_lead = 0;
int ret;
if (Z_STRLEN_P(val) >= 2 && numstr[0] == '0') {
if ((base == 0 || base == 16) && (numstr[1] == 'x' || numstr[1] == 'X')) {
base = 16;
skip_lead = 1;
+ } else if ((base == 0 || base == 8) && (numstr[1] == 'o' || numstr[1] == 'O')) {
+ base = 8;
+ skip_lead = 1;
} else if ((base == 0 || base == 2) && (numstr[1] == 'b' || numstr[1] == 'B')) {
base = 2;
skip_lead = 1;
@@ -674,7 +677,7 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg) /* {{{ */
{
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- zend_bool use_si = 0;
+ bool use_si = 0;
zend_long res;
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a, 1);
@@ -1624,7 +1627,7 @@ ZEND_FUNCTION(gmp_kronecker)
zval *a_arg, *b_arg;
mpz_ptr gmpnum_a, gmpnum_b;
gmp_temp_t temp_a, temp_b;
- zend_bool use_a_si = 0, use_b_si = 0;
+ bool use_a_si = 0, use_b_si = 0;
int result;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &a_arg, &b_arg) == FAILURE){
@@ -1861,7 +1864,7 @@ ZEND_FUNCTION(gmp_setbit)
{
zval *a_arg;
zend_long index;
- zend_bool set = 1;
+ bool set = 1;
mpz_ptr gmpnum_a;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|b", &a_arg, gmp_ce, &index, &set) == FAILURE) {