]> granicus.if.org Git - php/commitdiff
Fix cast callbacks
authorZeev Suraski <zeev@php.net>
Tue, 7 Oct 2003 15:47:25 +0000 (15:47 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 7 Oct 2003 15:47:25 +0000 (15:47 +0000)
ext/com_dotnet/com_handlers.c
ext/simplexml/simplexml.c

index 0b759ecc0e382354297619e94c10b4fe476a7b7e..7a51777023a10326ebb88b6927055c05b338c666 100644 (file)
@@ -445,7 +445,7 @@ static int com_objects_compare(zval *object1, zval *object2 TSRMLS_DC)
        return ret;
 }
 
-static void 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, int should_free TSRMLS_DC)
 {
        php_com_dotnet_object *obj;
        VARIANT v;
@@ -463,12 +463,12 @@ static void com_object_cast(zval *readobj, zval *writeobj, int type, int should_
        if (V_VT(&obj->v) == VT_DISPATCH) {
 
                if (!obj->have_default_bind && !com_get_default_binding(obj TSRMLS_CC)) {
-                       return;
+                       return FAILURE;
                }
 
                if (FAILURE == php_com_do_invoke_by_id(obj, obj->default_bind,
                                DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC)) {
-                       return;
+                       return FAILURE;
                }
        } else {
                VariantCopy(&v, &obj->v);
@@ -495,6 +495,7 @@ static void com_object_cast(zval *readobj, zval *writeobj, int type, int should_
 
        php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
        VariantClear(&v);
+       return SUCCESS;
 }
 
 zend_object_handlers php_com_object_handlers = {
index 7316ad9ebc459b50f1479fea4e14a8286b8eea13..da3968f753c09c85d3cb69d84d28405f47b0fc9c 100644 (file)
@@ -724,7 +724,7 @@ sxe_class_name_get(zval *object, char **class_name, zend_uint *class_name_len, i
 
 /* {{{ cast_object()
  */
-static void
+static int
 cast_object(zval *object, int type, char *contents TSRMLS_DC)
 {
        if (contents) {
@@ -744,18 +744,22 @@ cast_object(zval *object, int type, char *contents TSRMLS_DC)
                case IS_DOUBLE:
                        convert_to_double(object);
                        break;
+               default:
+                       return FAILURE;
        }
+       return SUCCESS;
 }
 /* }}} */
 
 /* {{{ sxe_object_cast()
  */
-static void
+static int
 sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
 {
        php_sxe_object *sxe;
        char           *contents = NULL;
        zval free_obj;
+       int rv;
 
        sxe = php_sxe_fetch_object(readobj TSRMLS_CC);
        if (should_free) {
@@ -774,7 +778,7 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_
                }
        } 
 
-       cast_object(writeobj, type, contents TSRMLS_CC);
+       rv = cast_object(writeobj, type, contents TSRMLS_CC);
 
        if (contents) {
                xmlFree(contents);
@@ -782,6 +786,7 @@ sxe_object_cast(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_
        if (should_free) {
                zval_dtor(&free_obj);
        }
+       return rv;
 }
 /* }}} */