From: Andi Gutmans Date: Sat, 28 Jul 2001 18:55:49 +0000 (+0000) Subject: - More Object macro work. I couldn't test this one so let me know if it X-Git-Tag: PRE_ENGINE2_SPLIT~232 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8eccca0b18a0122b669a176078460e71e9fe7b0;p=php - More Object macro work. I couldn't test this one so let me know if it breaks the Windows build. --- diff --git a/ext/com/COM.c b/ext/com/COM.c index 35b0ee3e4d..93762ccd02 100644 --- a/ext/com/COM.c +++ b/ext/com/COM.c @@ -1155,7 +1155,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer ZVAL_NULL(&return_value); /* fetch the IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type); if(!obj || (type != IS_COM)) { @@ -1246,7 +1246,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere /* fetch the IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); if(!obj || (type != IS_COM)) { @@ -1319,7 +1319,7 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro *object_handle = *return_value; pval_copy_constructor(object_handle); INIT_PZVAL(object_handle); - zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL); + zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); pval_destructor(&function_name->element); return; @@ -1335,8 +1335,8 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro pval_destructor(&function_name->element); return; } - zend_hash_index_find(property.value.obj.properties, 0, (void **) &handle); - obj = (comval *)zend_list_find((*handle)->value.lval,&type); + zend_hash_index_find(Z_OBJPROP(property), 0, (void **) &handle); + obj = (comval *)zend_list_find(Z_LVAL_PP(handle), &type); if(!obj || (type != IS_COM)) { @@ -1674,8 +1674,8 @@ PHP_FUNCTION(com_isenum) getParameters(ht, 1, &object); /* obtain IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); - obj = (comval *) zend_list_find((*comval_handle)->value.lval, &type); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); + obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type); if(!obj || (type != IS_COM)) { php_error(E_WARNING,"%s is not a COM object handler", ""); diff --git a/ext/com/VARIANT.c b/ext/com/VARIANT.c index 49a7335ca0..9eaca8d23b 100644 --- a/ext/com/VARIANT.c +++ b/ext/com/VARIANT.c @@ -169,8 +169,8 @@ void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper *object_handle = *return_value; pval_copy_constructor(object_handle); INIT_PZVAL(object_handle); - zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL); - pval_destructor(&function_name->element); + zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); + zval_dtor(&function_name->element); } } @@ -184,7 +184,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc VARIANT *var_arg; /* fetch the VARIANT structure */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &var_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if(!var_arg || (type != IS_VARIANT)) @@ -220,7 +220,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc php_error(E_WARNING, "Unknown method."); break; - pval_destructor(&overloaded_property->element); + zval_dtor(&overloaded_property->element); } } @@ -236,7 +236,7 @@ int php_VARIANT_set_property_handler(zend_property_reference *property_reference VARIANT *var_arg; /* fetch the VARIANT structure */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &var_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if(!var_arg || (type != IS_VARIANT)) @@ -244,7 +244,7 @@ int php_VARIANT_set_property_handler(zend_property_reference *property_reference overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; do_VARIANT_propset(var_arg, &overloaded_property->element, value); - pval_destructor(&overloaded_property->element); + zval_dtor(&overloaded_property->element); return SUCCESS; } diff --git a/ext/rpc/com/com_wrapper.c b/ext/rpc/com/com_wrapper.c index 35b0ee3e4d..93762ccd02 100644 --- a/ext/rpc/com/com_wrapper.c +++ b/ext/rpc/com/com_wrapper.c @@ -1155,7 +1155,7 @@ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_refer ZVAL_NULL(&return_value); /* fetch the IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type); if(!obj || (type != IS_COM)) { @@ -1246,7 +1246,7 @@ PHPAPI int php_COM_set_property_handler(zend_property_reference *property_refere /* fetch the IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); if(!obj || (type != IS_COM)) { @@ -1319,7 +1319,7 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro *object_handle = *return_value; pval_copy_constructor(object_handle); INIT_PZVAL(object_handle); - zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL); + zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); pval_destructor(&function_name->element); return; @@ -1335,8 +1335,8 @@ PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_pro pval_destructor(&function_name->element); return; } - zend_hash_index_find(property.value.obj.properties, 0, (void **) &handle); - obj = (comval *)zend_list_find((*handle)->value.lval,&type); + zend_hash_index_find(Z_OBJPROP(property), 0, (void **) &handle); + obj = (comval *)zend_list_find(Z_LVAL_PP(handle), &type); if(!obj || (type != IS_COM)) { @@ -1674,8 +1674,8 @@ PHP_FUNCTION(com_isenum) getParameters(ht, 1, &object); /* obtain IDispatch interface */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &comval_handle); - obj = (comval *) zend_list_find((*comval_handle)->value.lval, &type); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); + obj = (comval *) zend_list_find(Z_LVAL_PP(comval_handle), &type); if(!obj || (type != IS_COM)) { php_error(E_WARNING,"%s is not a COM object handler", ""); diff --git a/ext/rpc/com/variant.c b/ext/rpc/com/variant.c index 49a7335ca0..9eaca8d23b 100644 --- a/ext/rpc/com/variant.c +++ b/ext/rpc/com/variant.c @@ -169,8 +169,8 @@ void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_proper *object_handle = *return_value; pval_copy_constructor(object_handle); INIT_PZVAL(object_handle); - zend_hash_index_update(object->value.obj.properties, 0, &object_handle, sizeof(pval *), NULL); - pval_destructor(&function_name->element); + zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); + zval_dtor(&function_name->element); } } @@ -184,7 +184,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc VARIANT *var_arg; /* fetch the VARIANT structure */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &var_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if(!var_arg || (type != IS_VARIANT)) @@ -220,7 +220,7 @@ pval php_VARIANT_get_property_handler(zend_property_reference *property_referenc php_error(E_WARNING, "Unknown method."); break; - pval_destructor(&overloaded_property->element); + zval_dtor(&overloaded_property->element); } } @@ -236,7 +236,7 @@ int php_VARIANT_set_property_handler(zend_property_reference *property_reference VARIANT *var_arg; /* fetch the VARIANT structure */ - zend_hash_index_find(object->value.obj.properties, 0, (void **) &var_handle); + zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if(!var_arg || (type != IS_VARIANT)) @@ -244,7 +244,7 @@ int php_VARIANT_set_property_handler(zend_property_reference *property_reference overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; do_VARIANT_propset(var_arg, &overloaded_property->element, value); - pval_destructor(&overloaded_property->element); + zval_dtor(&overloaded_property->element); return SUCCESS; }