Skip to content

Commit b9912d2

Browse files
committed
Zend/zend_compile: make pointers const
1 parent a308a0b commit b9912d2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Zend/zend_compile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ static inline bool class_name_refers_to_active_ce(zend_string *class_name, uint3
15921592
}
15931593
/* }}} */
15941594

1595-
uint32_t zend_get_class_fetch_type(zend_string *name) /* {{{ */
1595+
uint32_t zend_get_class_fetch_type(const zend_string *name) /* {{{ */
15961596
{
15971597
if (zend_string_equals_literal_ci(name, "self")) {
15981598
return ZEND_FETCH_CLASS_SELF;
@@ -8500,7 +8500,7 @@ static bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
85008500
}
85018501
/* }}} */
85028502

8503-
ZEND_API bool zend_is_op_long_compatible(zval *op)
8503+
ZEND_API bool zend_is_op_long_compatible(const zval *op)
85048504
{
85058505
if (Z_TYPE_P(op) == IS_ARRAY) {
85068506
return false;
@@ -8522,7 +8522,7 @@ ZEND_API bool zend_is_op_long_compatible(zval *op)
85228522
return true;
85238523
}
85248524

8525-
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2) /* {{{ */
8525+
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, const zval *op2) /* {{{ */
85268526
{
85278527
if ((opcode == ZEND_CONCAT || opcode == ZEND_FAST_CONCAT)) {
85288528
/* Array to string warning. */
@@ -8595,7 +8595,7 @@ static inline bool zend_try_ct_eval_binary_op(zval *result, uint32_t opcode, zva
85958595
}
85968596
/* }}} */
85978597

8598-
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, zval *op)
8598+
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op)
85998599
{
86008600
if (opcode == ZEND_BW_NOT) {
86018601
/* BW_NOT on string does not convert the string into an integer. */

Zend/zend_compile.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ ZEND_API void pass_two(zend_op_array *op_array);
895895
ZEND_API bool zend_is_compiling(void);
896896
ZEND_API char *zend_make_compiled_string_description(const char *name);
897897
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers);
898-
uint32_t zend_get_class_fetch_type(zend_string *name);
898+
uint32_t zend_get_class_fetch_type(const zend_string *name);
899899
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
900900
ZEND_API bool zend_is_smart_branch(const zend_op *opline);
901901

@@ -1204,8 +1204,8 @@ END_EXTERN_C()
12041204
/* The default value for CG(compiler_options) during eval() */
12051205
#define ZEND_COMPILE_DEFAULT_FOR_EVAL 0
12061206

1207-
ZEND_API bool zend_is_op_long_compatible(zval *op);
1208-
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, zval *op1, zval *op2);
1209-
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, zval *op);
1207+
ZEND_API bool zend_is_op_long_compatible(const zval *op);
1208+
ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, const zval *op2);
1209+
ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op);
12101210

12111211
#endif /* ZEND_COMPILE_H */

0 commit comments

Comments
 (0)