@@ -1285,33 +1285,15 @@ static int bcmath_number_compare(zval *op1, zval *op2)
1285
1285
return zend_std_compare_objects (op1 , op2 );
1286
1286
}
1287
1287
1288
- #define BCMATH_PARSE_PARAMETERS_START (min_num_args , max_num_args ) \
1289
- bool bc_num_arg_error = false; \
1290
- ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
1291
-
1292
1288
#define BCMATH_PARAM_NUMBER_OR_STR_OR_LONG (dest_obj , ce , dest_str , dest_long ) \
1293
1289
Z_PARAM_PROLOGUE(0, 0); \
1294
- if (UNEXPECTED(!(zend_parse_arg_obj(_arg, &dest_obj, ce, 0) || \
1295
- zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &_dummy, 0, _i)))) { \
1296
- bc_num_arg_error = true;\
1297
- break; \
1298
- }
1299
-
1300
- #define BCMATH_PARSE_PARAMETERS_END () \
1301
- ZEND_ASSERT(_i == _max_num_args || _max_num_args == (uint32_t) -1); \
1302
- } while (0); \
1303
- if (UNEXPECTED(bc_num_arg_error)) { \
1304
- if (EG(exception)) { \
1305
- return; \
1306
- } \
1307
- zend_argument_type_error(_i, "must be of type int, string, or %s, %s given", \
1308
- ZSTR_VAL(bcmath_number_ce->name), zend_zval_value_name(_arg)); \
1309
- return; \
1310
- } else if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \
1311
- zend_wrong_parameter_error(_error_code, _i, _error, _expected_type, _arg); \
1312
- return; \
1313
- } \
1314
- } while (0)
1290
+ if (UNEXPECTED(!(zend_parse_arg_obj(_arg, &(dest_obj), ce, 0) || \
1291
+ zend_parse_arg_str_or_long(_arg, &(dest_str), &(dest_long), &_dummy, 0, _i)))) { \
1292
+ zend_argument_type_error(_i, "must be of type int, string, or %s, %s given", \
1293
+ ZSTR_VAL(bcmath_number_ce->name), zend_zval_value_name(_arg)); \
1294
+ _error_code = ZPP_ERROR_FAILURE; \
1295
+ break; \
1296
+ }
1315
1297
1316
1298
static zend_always_inline zend_result bc_num_from_obj_or_str_or_long_with_err (
1317
1299
bc_num * num , size_t * scale , zend_object * obj , zend_string * str , zend_long lval , uint32_t arg_num )
@@ -1366,11 +1348,11 @@ static void bcmath_number_calc_method(INTERNAL_FUNCTION_PARAMETERS, uint8_t opco
1366
1348
zend_long scale_lval = 0 ;
1367
1349
bool scale_is_null = true;
1368
1350
1369
- BCMATH_PARSE_PARAMETERS_START (1 , 2 )
1351
+ ZEND_PARSE_PARAMETERS_START (1 , 2 )
1370
1352
BCMATH_PARAM_NUMBER_OR_STR_OR_LONG (num_obj , bcmath_number_ce , num_str , num_lval );
1371
1353
Z_PARAM_OPTIONAL
1372
1354
Z_PARAM_LONG_OR_NULL (scale_lval , scale_is_null );
1373
- BCMATH_PARSE_PARAMETERS_END ();
1355
+ ZEND_PARSE_PARAMETERS_END ();
1374
1356
1375
1357
bc_num num = NULL ;
1376
1358
size_t num_full_scale ;
@@ -1472,12 +1454,12 @@ PHP_METHOD(BcMath_Number, powmod)
1472
1454
zend_long scale_lval = 0 ;
1473
1455
bool scale_is_null = true;
1474
1456
1475
- BCMATH_PARSE_PARAMETERS_START (2 , 3 )
1457
+ ZEND_PARSE_PARAMETERS_START (2 , 3 )
1476
1458
BCMATH_PARAM_NUMBER_OR_STR_OR_LONG (exponent_obj , bcmath_number_ce , exponent_str , exponent_lval );
1477
1459
BCMATH_PARAM_NUMBER_OR_STR_OR_LONG (modulus_obj , bcmath_number_ce , modulus_str , modulus_lval );
1478
1460
Z_PARAM_OPTIONAL
1479
1461
Z_PARAM_LONG_OR_NULL (scale_lval , scale_is_null );
1480
- BCMATH_PARSE_PARAMETERS_END ();
1462
+ ZEND_PARSE_PARAMETERS_END ();
1481
1463
1482
1464
bc_num exponent_num = NULL ;
1483
1465
bc_num modulus_num = NULL ;
@@ -1591,11 +1573,11 @@ PHP_METHOD(BcMath_Number, compare)
1591
1573
zend_long scale_lval = 0 ;
1592
1574
bool scale_is_null = true;
1593
1575
1594
- BCMATH_PARSE_PARAMETERS_START (1 , 2 )
1576
+ ZEND_PARSE_PARAMETERS_START (1 , 2 )
1595
1577
BCMATH_PARAM_NUMBER_OR_STR_OR_LONG (num_obj , bcmath_number_ce , num_str , num_lval );
1596
1578
Z_PARAM_OPTIONAL
1597
1579
Z_PARAM_LONG_OR_NULL (scale_lval , scale_is_null );
1598
- BCMATH_PARSE_PARAMETERS_END ();
1580
+ ZEND_PARSE_PARAMETERS_END ();
1599
1581
1600
1582
bc_num num = NULL ;
1601
1583
size_t num_full_scale ;
0 commit comments