Skip to content

Commit 4a55d63

Browse files
committed
Zend/zend_API: make several pointers const
1 parent 7ccb785 commit 4a55d63

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Zend/zend_API.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32
477477
return !EG(exception);
478478
}
479479

480-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num) /* {{{ */
480+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, bool *dest, uint32_t arg_num) /* {{{ */
481481
{
482482
if (EXPECTED(Z_TYPE_P(arg) <= IS_STRING)) {
483483
if (UNEXPECTED(Z_TYPE_P(arg) == IS_NULL) && !zend_null_arg_deprecated("bool", arg_num)) {
@@ -491,7 +491,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint
491491
}
492492
/* }}} */
493493

494-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num) /* {{{ */
494+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, bool *dest, uint32_t arg_num) /* {{{ */
495495
{
496496
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
497497
return 0;
@@ -500,7 +500,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint
500500
}
501501
/* }}} */
502502

503-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */
503+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */
504504
{
505505
if (EXPECTED(Z_TYPE_P(arg) == IS_DOUBLE)) {
506506
if (UNEXPECTED(zend_isnan(Z_DVAL_P(arg)))) {
@@ -570,7 +570,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest,
570570
}
571571
/* }}} */
572572

573-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */
573+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(const zval *arg, zend_long *dest, uint32_t arg_num) /* {{{ */
574574
{
575575
if (UNEXPECTED(ZEND_ARG_USES_STRICT_TYPES())) {
576576
return 0;
@@ -579,7 +579,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest,
579579
}
580580
/* }}} */
581581

582-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num) /* {{{ */
582+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double *dest, uint32_t arg_num) /* {{{ */
583583
{
584584
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
585585
*dest = (double)Z_LVAL_P(arg);
@@ -611,7 +611,7 @@ ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest,
611611
}
612612
/* }}} */
613613

614-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num) /* {{{ */
614+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(const zval *arg, double *dest, uint32_t arg_num) /* {{{ */
615615
{
616616
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
617617
/* SSTH Exception: IS_LONG may be accepted instead as IS_DOUBLE */
@@ -4884,7 +4884,7 @@ ZEND_API ZEND_COLD const char *zend_get_object_type_case(const zend_class_entry
48844884
}
48854885
/* }}} */
48864886

4887-
ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
4887+
ZEND_API bool zend_is_iterable(const zval *iterable) /* {{{ */
48884888
{
48894889
switch (Z_TYPE_P(iterable)) {
48904890
case IS_ARRAY:
@@ -4897,7 +4897,7 @@ ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
48974897
}
48984898
/* }}} */
48994899

4900-
ZEND_API bool zend_is_countable(zval *countable) /* {{{ */
4900+
ZEND_API bool zend_is_countable(const zval *countable) /* {{{ */
49014901
{
49024902
switch (Z_TYPE_P(countable)) {
49034903
case IS_ARRAY:

Zend/zend_API.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,9 @@ static zend_always_inline const char *zend_get_object_type_uc(const zend_class_e
807807
return zend_get_object_type_case(ce, true);
808808
}
809809

810-
ZEND_API bool zend_is_iterable(zval *iterable);
810+
ZEND_API bool zend_is_iterable(const zval *iterable);
811811

812-
ZEND_API bool zend_is_countable(zval *countable);
812+
ZEND_API bool zend_is_countable(const zval *countable);
813813

814814
ZEND_API zend_result zend_get_default_from_internal_arg_info(
815815
zval *default_value_zval, zend_internal_arg_info *arg_info);
@@ -2030,18 +2030,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
20302030
/* Inlined implementations shared by new and old parameter parsing APIs */
20312031

20322032
ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null);
2033-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num);
2034-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num);
2035-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num);
2036-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num);
2037-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num);
2038-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num);
2033+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, bool *dest, uint32_t arg_num);
2034+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, bool *dest, uint32_t arg_num);
2035+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(const zval *arg, zend_long *dest, uint32_t arg_num);
2036+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long *dest, uint32_t arg_num);
2037+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(const zval *arg, double *dest, uint32_t arg_num);
2038+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double *dest, uint32_t arg_num);
20392039
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num);
20402040
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num);
20412041
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num);
20422042
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num);
20432043

2044-
static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num)
2044+
static zend_always_inline bool zend_parse_arg_bool(const zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num)
20452045
{
20462046
if (check_null) {
20472047
*is_null = 0;
@@ -2075,7 +2075,7 @@ static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, b
20752075
return 1;
20762076
}
20772077

2078-
static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num)
2078+
static zend_always_inline bool zend_parse_arg_double(const zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num)
20792079
{
20802080
if (check_null) {
20812081
*is_null = 0;
@@ -2186,7 +2186,7 @@ static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool
21862186
return 1;
21872187
}
21882188

2189-
static zend_always_inline bool zend_parse_arg_array_ht(zval *arg, HashTable **dest, bool check_null, bool or_object, bool separate)
2189+
static zend_always_inline bool zend_parse_arg_array_ht(const zval *arg, HashTable **dest, bool check_null, bool or_object, bool separate)
21902190
{
21912191
if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) {
21922192
*dest = Z_ARRVAL_P(arg);
@@ -2245,7 +2245,7 @@ static zend_always_inline bool zend_parse_arg_object(zval *arg, zval **dest, zen
22452245
return 1;
22462246
}
22472247

2248-
static zend_always_inline bool zend_parse_arg_obj(zval *arg, zend_object **dest, zend_class_entry *ce, bool check_null)
2248+
static zend_always_inline bool zend_parse_arg_obj(const zval *arg, zend_object **dest, zend_class_entry *ce, bool check_null)
22492249
{
22502250
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) &&
22512251
(!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0))) {

0 commit comments

Comments
 (0)