Skip to content

Commit a9bb7f1

Browse files
committed
Zend/zend_API: make several pointers const
1 parent e04a127 commit a9bb7f1

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
@@ -478,7 +478,7 @@ static ZEND_COLD bool zend_null_arg_deprecated(const char *fallback_type, uint32
478478
return !EG(exception);
479479
}
480480

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

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

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

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

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

615-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num) /* {{{ */
615+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(const zval *arg, double *dest, uint32_t arg_num) /* {{{ */
616616
{
617617
if (EXPECTED(Z_TYPE_P(arg) == IS_LONG)) {
618618
/* SSTH Exception: IS_LONG may be accepted instead as IS_DOUBLE */
@@ -4925,7 +4925,7 @@ ZEND_API ZEND_COLD const char *zend_get_object_type_case(const zend_class_entry
49254925
}
49264926
/* }}} */
49274927

4928-
ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
4928+
ZEND_API bool zend_is_iterable(const zval *iterable) /* {{{ */
49294929
{
49304930
switch (Z_TYPE_P(iterable)) {
49314931
case IS_ARRAY:
@@ -4938,7 +4938,7 @@ ZEND_API bool zend_is_iterable(zval *iterable) /* {{{ */
49384938
}
49394939
/* }}} */
49404940

4941-
ZEND_API bool zend_is_countable(zval *countable) /* {{{ */
4941+
ZEND_API bool zend_is_countable(const zval *countable) /* {{{ */
49424942
{
49434943
switch (Z_TYPE_P(countable)) {
49444944
case IS_ARRAY:

Zend/zend_API.h

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

816-
ZEND_API bool zend_is_iterable(zval *iterable);
816+
ZEND_API bool zend_is_iterable(const zval *iterable);
817817

818-
ZEND_API bool zend_is_countable(zval *countable);
818+
ZEND_API bool zend_is_countable(const zval *countable);
819819

820820
ZEND_API zend_result zend_get_default_from_internal_arg_info(
821821
zval *default_value_zval, zend_internal_arg_info *arg_info);
@@ -2036,18 +2036,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
20362036
/* Inlined implementations shared by new and old parameter parsing APIs */
20372037

20382038
ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null);
2039-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num);
2040-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num);
2041-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num);
2042-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num);
2043-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num);
2044-
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num);
2039+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(const zval *arg, bool *dest, uint32_t arg_num);
2040+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(const zval *arg, bool *dest, uint32_t arg_num);
2041+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(const zval *arg, zend_long *dest, uint32_t arg_num);
2042+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(const zval *arg, zend_long *dest, uint32_t arg_num);
2043+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(const zval *arg, double *dest, uint32_t arg_num);
2044+
ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(const zval *arg, double *dest, uint32_t arg_num);
20452045
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num);
20462046
ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num);
20472047
ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num);
20482048
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);
20492049

2050-
static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num)
2050+
static zend_always_inline bool zend_parse_arg_bool(const zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num)
20512051
{
20522052
if (check_null) {
20532053
*is_null = 0;
@@ -2081,7 +2081,7 @@ static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, b
20812081
return 1;
20822082
}
20832083

2084-
static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num)
2084+
static zend_always_inline bool zend_parse_arg_double(const zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num)
20852085
{
20862086
if (check_null) {
20872087
*is_null = 0;
@@ -2192,7 +2192,7 @@ static zend_always_inline bool zend_parse_arg_array(zval *arg, zval **dest, bool
21922192
return 1;
21932193
}
21942194

2195-
static zend_always_inline bool zend_parse_arg_array_ht(zval *arg, HashTable **dest, bool check_null, bool or_object, bool separate)
2195+
static zend_always_inline bool zend_parse_arg_array_ht(const zval *arg, HashTable **dest, bool check_null, bool or_object, bool separate)
21962196
{
21972197
if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) {
21982198
*dest = Z_ARRVAL_P(arg);
@@ -2251,7 +2251,7 @@ static zend_always_inline bool zend_parse_arg_object(zval *arg, zval **dest, zen
22512251
return 1;
22522252
}
22532253

2254-
static zend_always_inline bool zend_parse_arg_obj(zval *arg, zend_object **dest, zend_class_entry *ce, bool check_null)
2254+
static zend_always_inline bool zend_parse_arg_obj(const zval *arg, zend_object **dest, zend_class_entry *ce, bool check_null)
22552255
{
22562256
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT) &&
22572257
(!ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), ce) != 0))) {

0 commit comments

Comments
 (0)