mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Move bcmath_check_scale()
This commit is contained in:
parent
f1b4e1276c
commit
2e88916b58
1 changed files with 9 additions and 9 deletions
|
@ -148,6 +148,15 @@ PHP_MINFO_FUNCTION(bcmath)
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num)
|
||||||
|
{
|
||||||
|
if (UNEXPECTED(scale < 0 || scale > INT_MAX)) {
|
||||||
|
zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX);
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
static void php_long2num(bc_num *num, zend_long lval)
|
static void php_long2num(bc_num *num, zend_long lval)
|
||||||
{
|
{
|
||||||
*num = bc_long2num(lval);
|
*num = bc_long2num(lval);
|
||||||
|
@ -1305,15 +1314,6 @@ static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err(
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num)
|
|
||||||
{
|
|
||||||
if (UNEXPECTED(scale < 0 || scale > INT_MAX)) {
|
|
||||||
zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX);
|
|
||||||
return FAILURE;
|
|
||||||
}
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
PHP_METHOD(BcMath_Number, __construct)
|
PHP_METHOD(BcMath_Number, __construct)
|
||||||
{
|
{
|
||||||
zend_string *str = NULL;
|
zend_string *str = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue