summaryrefslogtreecommitdiff
path: root/ext/com_dotnet
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-10-07 17:57:49 +0300
committerDmitry Stogov <dmitry@zend.com>2019-10-07 17:57:49 +0300
commitb02b81299ccef7de244bac7ffc605e3d2943fa88 (patch)
treef07036f89b7f4c8f3162f20702881061d59a13a3 /ext/com_dotnet
parente2100619ac064fdd4e7fe79e296a2ca087409e7d (diff)
downloadphp-git-b02b81299ccef7de244bac7ffc605e3d2943fa88.tar.gz
Comparison cleanup:
- introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval) - remove compare_objects() object handler, and keep only compare() handler
Diffstat (limited to 'ext/com_dotnet')
-rw-r--r--ext/com_dotnet/com_handlers.c6
-rw-r--r--ext/com_dotnet/com_saproxy.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 788db3768c..c9b7d898ed 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -422,6 +422,8 @@ static int com_objects_compare(zval *object1, zval *object2)
* So, we have this declaration here to fix it */
STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags);
+ ZEND_COMPARE_OBJECTS_FALLBACK(object1, object2);
+
obja = CDNO_FETCH(object1);
objb = CDNO_FETCH(object2);
@@ -538,12 +540,14 @@ zend_object_handlers php_com_object_handlers = {
com_method_get,
com_constructor_get,
com_class_name_get,
- com_objects_compare,
com_object_cast,
com_object_count,
NULL, /* get_debug_info */
NULL, /* get_closure */
zend_std_get_gc, /* get_gc */
+ NULL, /* do_operation */
+ com_objects_compare, /* compare */
+ NULL, /* get_properties_for */
};
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable)
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index 106cde856e..9ddcea3d9a 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -319,6 +319,7 @@ static zend_string* saproxy_class_name_get(const zend_object *object)
static int saproxy_objects_compare(zval *object1, zval *object2)
{
+ ZEND_COMPARE_OBJECTS_FALLBACK(object1, object2);
return -1;
}
@@ -395,9 +396,14 @@ zend_object_handlers php_com_saproxy_handlers = {
saproxy_method_get,
saproxy_constructor_get,
saproxy_class_name_get,
- saproxy_objects_compare,
saproxy_object_cast,
saproxy_count_elements
+ NULL, /* get_debug_info */
+ NULL, /* get_closure */
+ NULL, /* get_gc */
+ NULL, /* do_operation */
+ saproxy_objects_compare, /* compare */
+ NULL, /* get_properties_for */
};
int php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index)