Skip to content

Commit 7b75bd1

Browse files
committed
Zend: mark callable zval* as const
1 parent cd75300 commit 7b75bd1

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

Zend/zend_API.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4030,7 +4030,7 @@ static zend_always_inline bool zend_is_callable_check_func(const zval *callable,
40304030
}
40314031
/* }}} */
40324032

4033-
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object) /* {{{ */
4033+
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object) /* {{{ */
40344034
{
40354035
try_again:
40364036
switch (Z_TYPE_P(callable)) {
@@ -4088,7 +4088,7 @@ ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_objec
40884088
}
40894089
/* }}} */
40904090

4091-
ZEND_API zend_string *zend_get_callable_name(zval *callable) /* {{{ */
4091+
ZEND_API zend_string *zend_get_callable_name(const zval *callable) /* {{{ */
40924092
{
40934093
return zend_get_callable_name_ex(callable, NULL);
40944094
}
@@ -4205,7 +4205,7 @@ ZEND_API bool zend_is_callable_at_frame(
42054205
}
42064206
/* }}} */
42074207

4208-
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
4208+
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error) /* {{{ */
42094209
{
42104210
/* Determine callability at the first parent user frame. */
42114211
const zend_execute_data *frame = EG(current_execute_data);
@@ -4220,13 +4220,13 @@ ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t
42204220
return ret;
42214221
}
42224222

4223-
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
4223+
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name) /* {{{ */
42244224
{
42254225
return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL);
42264226
}
42274227
/* }}} */
42284228

4229-
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
4229+
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error) /* {{{ */
42304230
{
42314231
if (!zend_is_callable_ex(callable, NULL, check_flags, callable_name, fcc, error)) {
42324232
return FAILURE;

Zend/zend_API.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ ZEND_API ZEND_COLD void zend_wrong_property_read(const zval *object, zval *prope
410410
#define IS_CALLABLE_SUPPRESS_DEPRECATIONS (1<<1)
411411

412412
ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc);
413-
ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, const zend_object *object);
414-
ZEND_API zend_string *zend_get_callable_name(zval *callable);
413+
ZEND_API zend_string *zend_get_callable_name_ex(const zval *callable, const zend_object *object);
414+
ZEND_API zend_string *zend_get_callable_name(const zval *callable);
415415
ZEND_API bool zend_is_callable_at_frame(
416416
const zval *callable, zend_object *object, const zend_execute_data *frame,
417417
uint32_t check_flags, zend_fcall_info_cache *fcc, char **error);
418-
ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
419-
ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name);
418+
ZEND_API bool zend_is_callable_ex(const zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);
419+
ZEND_API bool zend_is_callable(const zval *callable, uint32_t check_flags, zend_string **callable_name);
420420
ZEND_API const char *zend_get_module_version(const char *module_name);
421421
ZEND_API zend_result zend_get_module_started(const char *module_name);
422422

@@ -701,7 +701,7 @@ ZEND_API zend_result _call_user_function_impl(zval *object, zval *function_name,
701701
* fci->params = NULL;
702702
* The callable_name argument may be NULL.
703703
*/
704-
ZEND_API zend_result zend_fcall_info_init(zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
704+
ZEND_API zend_result zend_fcall_info_init(const zval *callable, uint32_t check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_string **callable_name, char **error);
705705

706706
/** Clear arguments connected with zend_fcall_info *fci
707707
* If free_mem is not zero then the params array gets free'd as well
@@ -2482,7 +2482,7 @@ static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, b
24822482
return 1;
24832483
}
24842484

2485-
static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
2485+
static zend_always_inline bool zend_parse_arg_func(const zval *arg, zend_fcall_info *dest_fci, zend_fcall_info_cache *dest_fcc, bool check_null, char **error, bool free_trampoline)
24862486
{
24872487
if (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) {
24882488
dest_fci->size = 0;

0 commit comments

Comments
 (0)