}
/* }}} */
-ZEND_API int ZEND_FASTCALL zend_parse_arg_long_cap_weak(zval *arg, zend_long *dest) /* {{{ */
-{
- if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) {
- if (UNEXPECTED(zend_isnan(Z_DVAL_P(arg)))) {
- return 0;
- }
- *dest = zend_dval_to_lval_cap(Z_DVAL_P(arg));
- } else if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
- double d;
- int type;
-
- if (UNEXPECTED((type = is_numeric_str_function(Z_STR_P(arg), dest, &d)) != IS_LONG)) {
- if (EXPECTED(type != 0)) {
- if (UNEXPECTED(zend_isnan(d))) {
- return 0;
- }
- *dest = zend_dval_to_lval_cap(d);
- } else {
- return 0;
- }
- }
- } else if (EXPECTED(Z_TYPE_P(arg) < IS_TRUE)) {
- *dest = 0;
- } else if (EXPECTED(Z_TYPE_P(arg) == IS_TRUE)) {
- *dest = 1;
- } else {
- return 0;
- }
- return 1;
-}
-/* }}} */
-
-ZEND_API int ZEND_FASTCALL zend_parse_arg_long_cap_slow(zval *arg, zend_long *dest) /* {{{ */
-{
- if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
- return 0;
- }
- return zend_parse_arg_long_cap_weak(arg, dest);
-}
-/* }}} */
-
ZEND_API int ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest) /* {{{ */
{
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
switch (c) {
case 'l':
- case 'L':
{
zend_long *p = va_arg(*va, zend_long *);
zend_bool *is_null = NULL;
is_null = va_arg(*va, zend_bool *);
}
- if (!zend_parse_arg_long(arg, p, is_null, check_null, c == 'L')) {
+ if (!zend_parse_arg_long(arg, p, is_null, check_null)) {
return "int";
}
}
}
break;
- case 'Z':
- /* 'Z' iz not supported anymore and should be replaced with 'z' */
- ZEND_ASSERT(c != 'Z');
+ case 'Z': /* replace with 'z' */
+ case 'L': /* replace with 'l' */
+ ZEND_ASSERT(0 && "ZPP modifier no longer supported");
default:
return "unknown";
}
/* old "l" */
#define Z_PARAM_LONG_EX2(dest, is_null, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
- if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, 0))) { \
+ if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null))) { \
_expected_type = Z_EXPECTED_LONG; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
#define Z_PARAM_LONG(dest) \
Z_PARAM_LONG_EX(dest, _dummy, 0, 0)
-/* old "L" */
-#define Z_PARAM_STRICT_LONG_EX2(dest, is_null, check_null, deref, separate) \
- Z_PARAM_PROLOGUE(deref, separate); \
- if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, 1))) { \
- _expected_type = Z_EXPECTED_LONG; \
- _error_code = ZPP_ERROR_WRONG_ARG; \
- break; \
- }
-
-#define Z_PARAM_STRICT_LONG_EX(dest, is_null, check_null, separate) \
- Z_PARAM_STRICT_LONG_EX2(dest, is_null, check_null, separate, separate)
-
-#define Z_PARAM_STRICT_LONG(dest) \
- Z_PARAM_STRICT_LONG_EX(dest, _dummy, 0, 0)
-
/* old "o" */
#define Z_PARAM_OBJECT_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest);
ZEND_API int ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest);
ZEND_API int ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest);
-ZEND_API int ZEND_FASTCALL zend_parse_arg_long_cap_slow(zval *arg, zend_long *dest);
-ZEND_API int ZEND_FASTCALL zend_parse_arg_long_cap_weak(zval *arg, zend_long *dest);
ZEND_API int ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest);
ZEND_API int ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest);
ZEND_API int ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest);
return 1;
}
-static zend_always_inline int zend_parse_arg_long(zval *arg, zend_long *dest, zend_bool *is_null, int check_null, int cap)
+static zend_always_inline int zend_parse_arg_long(zval *arg, zend_long *dest, zend_bool *is_null, int check_null)
{
if (check_null) {
*is_null = 0;
} else if (check_null && Z_TYPE_P(arg) == IS_NULL) {
*is_null = 1;
*dest = 0;
- } else if (cap) {
- return zend_parse_arg_long_cap_slow(arg, dest);
} else {
return zend_parse_arg_long_slow(arg, dest);
}