]> granicus.if.org Git - php/commitdiff
- Update after api changes
authorRob Richards <rrichards@php.net>
Wed, 10 May 2006 14:39:10 +0000 (14:39 +0000)
committerRob Richards <rrichards@php.net>
Wed, 10 May 2006 14:39:10 +0000 (14:39 +0000)
ext/com_dotnet/com_extension.c
ext/com_dotnet/com_handlers.c
ext/com_dotnet/com_iterator.c
ext/com_dotnet/com_saproxy.c
ext/com_dotnet/php_com_dotnet_internal.h

index f6f7ab44c0d48d27f555a42cbc50646727c3f7b0..93ef53039487ffe66d1f78a082791a881618f419 100644 (file)
@@ -192,7 +192,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
        php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
 
        INIT_CLASS_ENTRY(ce, "com_exception", NULL);
-       php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);
+       php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);
        php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
 /*     php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
 
index 052d9919ea5825d6a4e11c38df70c70c7f83b373..a710ada588a5b04381be59f62523ac5517023441 100644 (file)
@@ -486,17 +486,12 @@ static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
        return ret;
 }
 
-static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
 {
        php_com_dotnet_object *obj;
        VARIANT v;
        VARTYPE vt = VT_EMPTY;
-       zval free_obj;
        HRESULT res = S_OK;
-       
-       if (should_free) {
-               free_obj = *writeobj;
-       }
 
        obj = CDNO_FETCH(readobj);
        ZVAL_NULL(writeobj);
@@ -538,10 +533,6 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
 
        VariantClear(&v);
 
-       if (should_free) {
-               zval_dtor(&free_obj);
-       }
-
        if (SUCCEEDED(res)) {
                return SUCCESS;
        }
index 66dbfb4267deb7a891e6c25a274b418bd1d5bc5e..2527dacea2e896eebb605716d8e72fdbf53d3f88 100644 (file)
@@ -139,7 +139,7 @@ static zend_object_iterator_funcs com_iter_funcs = {
        NULL
 };
 
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
 {
        php_com_dotnet_object *obj;
        struct php_com_iterator *I;
@@ -149,6 +149,10 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS
        unsigned long n_fetched;
        zval *ptr;
 
+       if (by_ref) {
+               zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+       }
+
        obj = CDNO_FETCH(object);
 
        if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) {
index 9077c7bc1205f2efba16785f0a183e0e1339dce5..8cc0c5e64b66dd2abed60768a9eea94ace3ff227 100644 (file)
@@ -357,7 +357,7 @@ static int saproxy_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
        return -1;
 }
 
-static int saproxy_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
+static int saproxy_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC)
 {
        return FAILURE;
 }
@@ -554,12 +554,16 @@ static zend_object_iterator_funcs saproxy_iter_funcs = {
 };
 
 
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC)
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
 {
        php_com_saproxy *proxy = SA_FETCH(object);
        php_com_saproxy_iter *I;
        int i;
 
+       if (by_ref) {
+               zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
+       }
+
        I = ecalloc(1, sizeof(*I));
        I->iter.funcs = &saproxy_iter_funcs;
        I->iter.data = I;
index 4c442389f6fde10383a9bffd18a109535bf89e4e..2cd0c2b960cabd602809c119e98c30356a766eff 100644 (file)
@@ -82,7 +82,7 @@ zend_object_handlers php_com_object_handlers;
 void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC);
 
 /* com_saproxy.c */
-zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
 int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
 
 /* com_olechar.c */
@@ -177,7 +177,7 @@ ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj
 int php_com_process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid, int codepage TSRMLS_DC);
 
 /* com_iterator.c */
-zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
+zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
 
 
 #endif