From: Andi Gutmans Date: Tue, 11 Dec 2001 18:46:43 +0000 (+0000) Subject: - Rename zend_class_entry.constants -> zend_class_entry.constants_table X-Git-Tag: ChangeLog~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cb97fa3b9869883a645e6ef807965c570570afa;p=php - Rename zend_class_entry.constants -> zend_class_entry.constants_table --- diff --git a/Zend/zend.c b/Zend/zend.c index 56ac51e6a0..d075cce732 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -249,7 +249,7 @@ static void register_standard_class(void) zend_standard_class_def.parent = NULL; zend_hash_init_ex(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0); zend_hash_init_ex(&zend_standard_class_def.static_members, 0, NULL, ZVAL_PTR_DTOR, 1, 0); - zend_hash_init_ex(&zend_standard_class_def.constants, 0, NULL, ZVAL_PTR_DTOR, 1, 0); + zend_hash_init_ex(&zend_standard_class_def.constants_table, 0, NULL, ZVAL_PTR_DTOR, 1, 0); zend_hash_init_ex(&zend_standard_class_def.class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0); zend_hash_init_ex(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1, 0); zend_standard_class_def.constructor = NULL; diff --git a/Zend/zend.h b/Zend/zend.h index 37783dc26e..b40eb67faf 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -298,7 +298,7 @@ struct _zend_class_entry { HashTable default_properties; HashTable class_table; HashTable static_members; - HashTable constants; + HashTable constants_table; zend_function_entry *builtin_functions; union _zend_function *constructor; diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 53a990fc89..2e433d68c5 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1218,7 +1218,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_ class_entry->is_namespace = 0; zend_hash_init(&class_entry->default_properties, 0, NULL, ZVAL_PTR_DTOR, 1); zend_hash_init(&class_entry->static_members, 0, NULL, ZVAL_PTR_DTOR, 1); - zend_hash_init(&class_entry->constants, 0, NULL, ZVAL_PTR_DTOR, 1); + zend_hash_init(&class_entry->constants_table, 0, NULL, ZVAL_PTR_DTOR, 1); zend_hash_init(&class_entry->function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1); zend_hash_init(&class_entry->class_table, 10, NULL, ZEND_CLASS_DTOR, 1); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 8ac58e49fc..2e348116b0 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1281,7 +1281,7 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce) zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); /* STATIC_MEMBERS_FIXME */ zend_hash_merge(&ce->static_members, &parent_ce->static_members, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); - zend_hash_merge(&ce->constants, &parent_ce->constants, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); + zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0); zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0); ce->parent = parent_ce; if (!ce->handle_property_get) @@ -1389,7 +1389,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->default_properties); zend_hash_destroy(&ce->static_members); - zend_hash_destroy(&ce->constants); + zend_hash_destroy(&ce->constants_table); return FAILURE; } return SUCCESS; @@ -1723,7 +1723,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod zend_hash_init(&new_class_entry.class_table, 10, NULL, ZEND_CLASS_DTOR, 0); zend_hash_init(&new_class_entry.default_properties, 10, NULL, ZVAL_PTR_DTOR, 0); zend_hash_init(&new_class_entry.static_members, 10, NULL, ZVAL_PTR_DTOR, 0); - zend_hash_init(&new_class_entry.constants, 10, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_init(&new_class_entry.constants_table, 10, NULL, ZVAL_PTR_DTOR, 0); new_class_entry.constructor = NULL; @@ -1752,7 +1752,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod zend_hash_copy(&new_class_entry.static_members, &parent_class->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); /* copy constants */ - zend_hash_copy(&new_class_entry.constants, &parent_class->constants, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + zend_hash_copy(&new_class_entry.constants_table, &parent_class->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); new_class_entry.constructor = parent_class->constructor; @@ -1839,7 +1839,7 @@ void zend_do_declare_property(znode *var_name, znode *value, int declaration_typ zend_hash_update(&CG(active_class_entry)->static_members, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); break; case T_CONST: - zend_hash_update(&CG(active_class_entry)->constants, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); + zend_hash_update(&CG(active_class_entry)->constants_table, var_name->u.constant.value.str.val, var_name->u.constant.value.str.len+1, &property, sizeof(zval *), NULL); break; } } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 5e53d005b3..68176524cc 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2076,7 +2076,7 @@ send_by_ref: if (EX(opline)->op1.op_type == IS_UNUSED) { if (EG(namespace)) { ce = EG(namespace); - if (zend_hash_find(&ce->constants, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { + if (zend_hash_find(&ce->constants_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { zval_update_constant(value, (void *) 1 TSRMLS_CC); EX(Ts)[EX(opline)->result.u.var].tmp_var = **value; zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); @@ -2095,7 +2095,7 @@ send_by_ref: ce = EX(Ts)[EX(opline)->op1.u.var].EA.class_entry; - if (zend_hash_find(&ce->constants, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { + if (zend_hash_find(&ce->constants_table, EX(opline)->op2.u.constant.value.str.val, EX(opline)->op2.u.constant.value.str.len+1, (void **) &value) == SUCCESS) { zval_update_constant(value, (void *) 1 TSRMLS_CC); EX(Ts)[EX(opline)->result.u.var].tmp_var = **value; zval_copy_ctor(&EX(Ts)[EX(opline)->result.u.var].tmp_var); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ea9c3dee4a..a9ea4469a7 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -328,7 +328,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) } last = cur; } - if (zend_hash_find(&ce->constants, last, strlen(last)+1, (void **) &value) == FAILURE) { + if (zend_hash_find(&ce->constants_table, last, strlen(last)+1, (void **) &value) == FAILURE) { zend_error(E_ERROR, "Invalid class! Improve this error message"); } const_value = **value; diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 788d359125..edefcafa02 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -118,7 +118,7 @@ ZEND_API void destroy_zend_class(zend_class_entry *ce) zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->default_properties); zend_hash_destroy(&ce->static_members); - zend_hash_destroy(&ce->constants); + zend_hash_destroy(&ce->constants_table); zend_hash_destroy(&ce->class_table); break; case ZEND_INTERNAL_CLASS: @@ -127,7 +127,7 @@ ZEND_API void destroy_zend_class(zend_class_entry *ce) zend_hash_destroy(&ce->function_table); zend_hash_destroy(&ce->default_properties); zend_hash_destroy(&ce->static_members); - zend_hash_destroy(&ce->constants); + zend_hash_destroy(&ce->constants_table); zend_hash_destroy(&ce->class_table); break; }