Skip to content

Commit 2e88916

Browse files
committed
Move bcmath_check_scale()
1 parent f1b4e12 commit 2e88916

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ext/bcmath/bcmath.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ PHP_MINFO_FUNCTION(bcmath)
148148
}
149149
/* }}} */
150150

151+
static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num)
152+
{
153+
if (UNEXPECTED(scale < 0 || scale > INT_MAX)) {
154+
zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX);
155+
return FAILURE;
156+
}
157+
return SUCCESS;
158+
}
159+
151160
static void php_long2num(bc_num *num, zend_long lval)
152161
{
153162
*num = bc_long2num(lval);
@@ -1305,15 +1314,6 @@ static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err(
13051314
return SUCCESS;
13061315
}
13071316

1308-
static zend_always_inline zend_result bcmath_check_scale(zend_long scale, uint32_t arg_num)
1309-
{
1310-
if (UNEXPECTED(scale < 0 || scale > INT_MAX)) {
1311-
zend_argument_value_error(arg_num, "must be between 0 and %d", INT_MAX);
1312-
return FAILURE;
1313-
}
1314-
return SUCCESS;
1315-
}
1316-
13171317
PHP_METHOD(BcMath_Number, __construct)
13181318
{
13191319
zend_string *str = NULL;

0 commit comments

Comments
 (0)