From 93f9ee7217c55c23b10a5ae01df677502ac51773 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 22 Aug 2018 14:01:14 +0300 Subject: [PATCH] Use zend_class_entry/zend_function type names instead of _zend_class_entry/_zend_function tags. --- Zend/zend.h | 30 +++++++++++++++--------------- Zend/zend_builtin_functions.c | 2 +- Zend/zend_compile.h | 2 +- Zend/zend_iterators.h | 12 ++++++------ ext/com_dotnet/com_handlers.c | 8 ++++---- ext/com_dotnet/com_saproxy.c | 4 ++-- ext/opcache/zend_persist.c | 2 +- ext/pdo/pdo_dbh.c | 2 +- ext/pdo/pdo_stmt.c | 6 +++--- ext/soap/soap.c | 2 +- ext/spl/spl_iterators.c | 8 ++++---- ext/standard/incomplete_class.c | 2 +- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index 2a6e93c0f26..d303e4c0e54 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -110,7 +110,7 @@ typedef struct _zend_trait_alias { struct _zend_class_entry { char type; zend_string *name; - struct _zend_class_entry *parent; + zend_class_entry *parent; int refcount; uint32_t ce_flags; @@ -123,19 +123,19 @@ struct _zend_class_entry { HashTable properties_info; HashTable constants_table; - union _zend_function *constructor; - union _zend_function *destructor; - union _zend_function *clone; - union _zend_function *__get; - union _zend_function *__set; - union _zend_function *__unset; - union _zend_function *__isset; - union _zend_function *__call; - union _zend_function *__callstatic; - union _zend_function *__tostring; - union _zend_function *__debugInfo; - union _zend_function *serialize_func; - union _zend_function *unserialize_func; + zend_function *constructor; + zend_function *destructor; + zend_function *clone; + zend_function *__get; + zend_function *__set; + zend_function *__unset; + zend_function *__isset; + zend_function *__call; + zend_function *__callstatic; + zend_function *__tostring; + zend_function *__debugInfo; + zend_function *serialize_func; + zend_function *unserialize_func; /* allocated only if class implements Iterator or IteratorAggregate interface */ zend_class_iterator_funcs *iterator_funcs_ptr; @@ -146,7 +146,7 @@ struct _zend_class_entry { int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */ }; zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref); - union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method); + zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method); /* serializer callbacks */ int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 4989b4b5b53..5b7ecd8c866 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1348,7 +1348,7 @@ ZEND_FUNCTION(method_exists) zend_string_release_ex(lcname, 0); RETURN_TRUE; } else { - union _zend_function *func = NULL; + zend_function *func = NULL; if (Z_TYPE_P(klass) == IS_OBJECT && Z_OBJ_HT_P(klass)->get_method != NULL diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index eead395b23c..722ad40c1f3 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -466,7 +466,7 @@ union _zend_function { uint32_t fn_flags; zend_string *function_name; zend_class_entry *scope; - union _zend_function *prototype; + zend_function *prototype; uint32_t num_args; uint32_t required_num_args; zend_arg_info *arg_info; diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index 15c828abd11..5991f506bbd 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -60,12 +60,12 @@ struct _zend_object_iterator { }; typedef struct _zend_class_iterator_funcs { - union _zend_function *zf_new_iterator; - union _zend_function *zf_valid; - union _zend_function *zf_current; - union _zend_function *zf_key; - union _zend_function *zf_next; - union _zend_function *zf_rewind; + zend_function *zf_new_iterator; + zend_function *zf_valid; + zend_function *zf_current; + zend_function *zf_key; + zend_function *zf_next; + zend_function *zf_rewind; } zend_class_iterator_funcs; BEGIN_EXTERN_C() diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 8a94d00d6bd..8424c3acfc0 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -253,10 +253,10 @@ static PHP_FUNCTION(com_method_handler) INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static union _zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key) +static zend_function *com_method_get(zend_object **object_ptr, zend_string *name, const zval *key) { zend_internal_function f, *fptr = NULL; - union _zend_function *func; + zend_function *func; DISPID dummy; php_com_dotnet_object *obj = (php_com_dotnet_object*)*object_ptr; @@ -388,7 +388,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU return ret; } -static union _zend_function *com_constructor_get(zend_object *object) +static zend_function *com_constructor_get(zend_object *object) { php_com_dotnet_object *obj = (php_com_dotnet_object *) object; static zend_internal_function c, d, v; @@ -401,7 +401,7 @@ static union _zend_function *com_constructor_get(zend_object *object) f.num_args = 0; \ f.fn_flags = 0; \ f.handler = ZEND_FN(fn); \ - return (union _zend_function*)&f; + return (zend_function*)&f; switch (obj->ce->name->val[0]) { #if HAVE_MSCOREE_H diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index 68c814f4b4a..2c7556b5f9a 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -314,7 +314,7 @@ static HashTable *saproxy_properties_get(zval *object) return NULL; } -static union _zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key) +static zend_function *saproxy_method_get(zend_object **object, zend_string *name, const zval *key) { /* no methods */ return NULL; @@ -325,7 +325,7 @@ static int saproxy_call_method(zend_string *method, zend_object *object, INTERNA return FAILURE; } -static union _zend_function *saproxy_constructor_get(zend_object *object) +static zend_function *saproxy_constructor_get(zend_object *object) { /* user cannot instantiate */ return NULL; diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index f7310232e5c..9620420ab33 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -610,7 +610,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc /* "prototype" may be undefined if "scope" isn't set */ if (op_array->scope && op_array->prototype) { if ((persist_ptr = zend_shared_alloc_get_xlat_entry(op_array->prototype))) { - op_array->prototype = (union _zend_function*)persist_ptr; + op_array->prototype = (zend_function*)persist_ptr; } } else { op_array->prototype = NULL; diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 8d2286812a4..10aa039086e 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -1335,7 +1335,7 @@ int pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind) return 1; } -static union _zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key) +static zend_function *dbh_method_get(zend_object **object, zend_string *method_name, const zval *key) { zend_function *fbc = NULL; pdo_dbh_object_t *dbh_obj = php_pdo_dbh_fetch_object(*object); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 689f552fc9b..f38d34e36ec 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2213,7 +2213,7 @@ static void dbstmt_prop_delete(zval *object, zval *member, void **cache_slot) } } -static union _zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key) +static zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *method_name, const zval *key) { zend_function *fbc = NULL; zend_string *lc_method_name; @@ -2625,7 +2625,7 @@ static HashTable *row_get_properties(zval *object) return stmt->std.properties; } -static union _zend_function *row_method_get( +static zend_function *row_method_get( zend_object **object_pp, zend_string *method_name, const zval *key) { @@ -2649,7 +2649,7 @@ static int row_call_method(zend_string *method, zend_object *object, INTERNAL_FU return FAILURE; } -static union _zend_function *row_get_ctor(zend_object *object) +static zend_function *row_get_ctor(zend_object *object) { zend_throw_exception_ex(php_pdo_get_exception(), 0, "You may not create a PDORow manually"); return NULL; diff --git a/ext/soap/soap.c b/ext/soap/soap.c index d22ed14da18..b21273e2973 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -643,7 +643,7 @@ PHP_MINIT_FUNCTION(soap) /* Register SoapClient class */ /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated. - soap_call_function_handler should be of type struct _zend_function, not (*handle_function_call). + soap_call_function_handler should be of type zend_function, not (*handle_function_call). */ { INIT_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions); diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 23fa58a4b19..f1688dbf16f 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -882,9 +882,9 @@ SPL_METHOD(RecursiveIteratorIterator, getMaxDepth) } } /* }}} */ -static union _zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key) +static zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_string *method, const zval *key) { - union _zend_function *function_handler; + zend_function *function_handler; spl_recursive_it_object *object = spl_recursive_it_from_obj(*zobject); zend_long level = object->level; zval *zobj; @@ -1361,9 +1361,9 @@ static int spl_dual_it_gets_implemented(zend_class_entry *interface, zend_class_ } #endif -static union _zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key) +static zend_function *spl_dual_it_get_method(zend_object **object, zend_string *method, const zval *key) { - union _zend_function *function_handler; + zend_function *function_handler; spl_dual_it_object *intern; intern = spl_dual_it_from_obj(*object); diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 120da552e10..943dafaa430 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -86,7 +86,7 @@ static int incomplete_class_has_property(zval *object, zval *member, int check_e } /* }}} */ -static union _zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */ +static zend_function *incomplete_class_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */ { zval zobject;