Skip to content

Commit 6880a6c

Browse files
committed
Zend: mark scope parameter of zend_type_to_string_resolved() const
And propagate const qualifier to use sites of this function.
1 parent 8bff644 commit 6880a6c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ static zend_string *add_intersection_type(zend_string *str,
14421442
return str;
14431443
}
14441444

1445-
zend_string *zend_type_to_string_resolved(const zend_type type, zend_class_entry *scope) {
1445+
zend_string *zend_type_to_string_resolved(const zend_type type, const zend_class_entry *scope) {
14461446
zend_string *str = NULL;
14471447

14481448
/* Pure intersection type */

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ int ZEND_FASTCALL zendlex(zend_parser_stack_elem *elem);
10341034

10351035
void zend_assert_valid_class_name(const zend_string *const_name, const char *type);
10361036

1037-
zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scope);
1037+
zend_string *zend_type_to_string_resolved(zend_type type, const zend_class_entry *scope);
10381038
ZEND_API zend_string *zend_type_to_string(zend_type type);
10391039

10401040
/* class fetches */

Zend/zend_inheritance.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ static void add_property_hook_obligation(
6060
zend_class_entry *ce, const zend_property_info *hooked_prop, const zend_function *hook_func);
6161

6262
static void ZEND_COLD emit_incompatible_method_error(
63-
const zend_function *child, zend_class_entry *child_scope,
64-
const zend_function *parent, zend_class_entry *parent_scope,
63+
const zend_function *child, const zend_class_entry *child_scope,
64+
const zend_function *parent, const zend_class_entry *parent_scope,
6565
inheritance_status status);
6666

6767
static void zend_type_copy_ctor(zend_type *const type, bool use_arena, bool persistent);
@@ -897,7 +897,7 @@ static inheritance_status zend_do_perform_implementation_check(
897897
/* }}} */
898898

899899
static ZEND_COLD void zend_append_type_hint(
900-
smart_str *str, zend_class_entry *scope, const zend_arg_info *arg_info, bool return_hint) /* {{{ */
900+
smart_str *str, const zend_class_entry *scope, const zend_arg_info *arg_info, bool return_hint) /* {{{ */
901901
{
902902
if (ZEND_TYPE_IS_SET(arg_info->type)) {
903903
zend_string *type_str = zend_type_to_string_resolved(arg_info->type, scope);
@@ -911,7 +911,7 @@ static ZEND_COLD void zend_append_type_hint(
911911
/* }}} */
912912

913913
static ZEND_COLD zend_string *zend_get_function_declaration(
914-
const zend_function *fptr, zend_class_entry *scope) /* {{{ */
914+
const zend_function *fptr, const zend_class_entry *scope) /* {{{ */
915915
{
916916
smart_str str = {0};
917917

@@ -1054,8 +1054,8 @@ static zend_always_inline uint32_t func_lineno(const zend_function *fn) {
10541054
}
10551055

10561056
static void ZEND_COLD emit_incompatible_method_error(
1057-
const zend_function *child, zend_class_entry *child_scope,
1058-
const zend_function *parent, zend_class_entry *parent_scope,
1057+
const zend_function *child, const zend_class_entry *child_scope,
1058+
const zend_function *parent, const zend_class_entry *parent_scope,
10591059
inheritance_status status) {
10601060
zend_string *parent_prototype = zend_get_function_declaration(parent, parent_scope);
10611061
zend_string *child_prototype = zend_get_function_declaration(child, child_scope);

0 commit comments

Comments
 (0)