Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#if PHP_VERSION_ID >= 70200
#define PHP_DECIMAL_ARGINFO_RETURN_NUMBER(cls, name, required_num_args) \
static const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_NUMBER_FQCN, 0), 0, 0},
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST(PHP_DECIMAL_NUMBER_FQCN, 0, 0), 0},
#else
#define PHP_DECIMAL_ARGINFO_RETURN_NUMBER(cls, name, required_num_args) \
static const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
Expand All @@ -52,7 +52,7 @@
#if PHP_VERSION_ID >= 70200
#define PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(cls, name, required_num_args) \
const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_DECIMAL_FQCN, 0), 0, 0},
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST(PHP_DECIMAL_DECIMAL_FQCN, 0, 0), 0},
#else
#define PHP_DECIMAL_ARGINFO_RETURN_DECIMAL(cls, name, required_num_args) \
const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
Expand All @@ -62,7 +62,7 @@
#if PHP_VERSION_ID >= 70200
#define PHP_DECIMAL_ARGINFO_RETURN_RATIONAL(cls, name, required_num_args) \
const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0},
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0, 0), 0},
#else
#define PHP_DECIMAL_ARGINFO_RETURN_RATIONAL(cls, name, required_num_args) \
const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
Expand All @@ -73,7 +73,7 @@
#if PHP_VERSION_ID >= 70200
#define PHP_DECIMAL_ARGINFO_RETURN_NUMBER(cls, name, required_num_args) \
static const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_ENCODE_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0), 0, 0},
{(const char*)(zend_uintptr_t)(required_num_args), ZEND_TYPE_INIT_CLASS_CONST(PHP_DECIMAL_RATIONAL_FQCN, 0, 0), 0},
#else
#define PHP_DECIMAL_ARGINFO_RETURN_NUMBER(cls, name, required_num_args) \
static const zend_internal_arg_info PHP_DECIMAL_ARGINFO_NAME(cls, name)[] = { \
Expand Down
12 changes: 6 additions & 6 deletions src/decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ PHP_DECIMAL_METHOD(Decimal, valueOf)
PHP_DECIMAL_PARSE_PARAMS(1, 2)
Z_PARAM_ZVAL(val)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(prec)
Z_PARAM_LONG(prec)
PHP_DECIMAL_PARSE_PARAMS_END()

if (ZEND_NUM_ARGS() == 1) {
Expand Down Expand Up @@ -663,8 +663,8 @@ PHP_DECIMAL_METHOD(Decimal, round)

PHP_DECIMAL_PARSE_PARAMS(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(places)
Z_PARAM_STRICT_LONG(mode)
Z_PARAM_LONG(places)
Z_PARAM_LONG(mode)
PHP_DECIMAL_PARSE_PARAMS_END()
{
php_decimal_t *obj = THIS_DECIMAL();
Expand Down Expand Up @@ -912,9 +912,9 @@ PHP_DECIMAL_METHOD(Decimal, toFixed)

PHP_DECIMAL_PARSE_PARAMS(0, 3)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(places)
Z_PARAM_LONG(places)
Z_PARAM_BOOL(commas)
Z_PARAM_STRICT_LONG(mode)
Z_PARAM_LONG(mode)
PHP_DECIMAL_PARSE_PARAMS_END()

RETURN_STR(php_decimal_mpd_to_fixed(THIS_DECIMAL_MPD(), places, commas, mode));
Expand Down Expand Up @@ -978,7 +978,7 @@ PHP_DECIMAL_METHOD(Decimal, toDecimal)
zend_long prec;

PHP_DECIMAL_PARSE_PARAMS(1, 1)
Z_PARAM_STRICT_LONG(prec)
Z_PARAM_LONG(prec)
PHP_DECIMAL_PARSE_PARAMS_END()

if (php_decimal_validate_prec(prec)) {
Expand Down
2 changes: 1 addition & 1 deletion src/number.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ PHP_DECIMAL_METHOD(Number, toDecimal)
zend_long prec;

PHP_DECIMAL_PARSE_PARAMS(1, 1)
Z_PARAM_STRICT_LONG(prec)
Z_PARAM_LONG(prec)
PHP_DECIMAL_PARSE_PARAMS_END()
{
if (EXPECTED(php_decimal_validate_prec(prec))) {
Expand Down
12 changes: 6 additions & 6 deletions src/rational.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,8 @@ PHP_DECIMAL_METHOD(Rational, round)

PHP_DECIMAL_PARSE_PARAMS(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(places)
Z_PARAM_STRICT_LONG(mode)
Z_PARAM_LONG(places)
Z_PARAM_LONG(mode)
PHP_DECIMAL_PARSE_PARAMS_END()
{
php_rational_t *res = php_rational();
Expand Down Expand Up @@ -846,9 +846,9 @@ PHP_DECIMAL_METHOD(Rational, toFixed)

PHP_DECIMAL_PARSE_PARAMS(0, 3)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(places)
Z_PARAM_LONG(places)
Z_PARAM_BOOL(commas)
Z_PARAM_STRICT_LONG(mode)
Z_PARAM_LONG(mode)
PHP_DECIMAL_PARSE_PARAMS_END()

RETURN_STR(php_decimal_rational_to_fixed(THIS_RATIONAL(), places, commas, mode));
Expand All @@ -866,7 +866,7 @@ PHP_DECIMAL_METHOD(Rational, toSci)

PHP_DECIMAL_PARSE_PARAMS(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_STRICT_LONG(prec)
Z_PARAM_LONG(prec)
PHP_DECIMAL_PARSE_PARAMS_END()

RETURN_STR(php_decimal_rational_to_sci(THIS_RATIONAL(), prec));
Expand Down Expand Up @@ -918,7 +918,7 @@ PHP_DECIMAL_METHOD(Rational, toDecimal)
zend_long prec;

PHP_DECIMAL_PARSE_PARAMS(1, 1)
Z_PARAM_STRICT_LONG(prec)
Z_PARAM_LONG(prec)
PHP_DECIMAL_PARSE_PARAMS_END()

if (php_decimal_validate_prec(prec)) {
Expand Down