zeev Tue Oct 7 11:47:24 2003 EDT Modified files: /php-src/ext/com_dotnet com_handlers.c /php-src/ext/mono php_mono.c /php-src/ext/simplexml simplexml.c Log: Fix cast callbacks Index: php-src/ext/com_dotnet/com_handlers.c diff -u php-src/ext/com_dotnet/com_handlers.c:1.3 php-src/ext/com_dotnet/com_handlers.c:1.4 --- php-src/ext/com_dotnet/com_handlers.c:1.3 Sun Oct 5 04:08:44 2003 +++ php-src/ext/com_dotnet/com_handlers.c Tue Oct 7 11:47:22 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_handlers.c,v 1.3 2003/10/05 08:08:44 zeev Exp $ */ +/* $Id: com_handlers.c,v 1.4 2003/10/07 15:47:22 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -445,7 +445,7 @@ 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 @@ 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 @@ php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC); VariantClear(&v); + return SUCCESS; } zend_object_handlers php_com_object_handlers = { Index: php-src/ext/mono/php_mono.c diff -u php-src/ext/mono/php_mono.c:1.9 php-src/ext/mono/php_mono.c:1.10 --- php-src/ext/mono/php_mono.c:1.9 Sun Oct 5 04:08:47 2003 +++ php-src/ext/mono/php_mono.c Tue Oct 7 11:47:22 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mono.c,v 1.9 2003/10/05 08:08:47 zeev Exp $ */ +/* $Id: php_mono.c,v 1.10 2003/10/07 15:47:22 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -712,7 +712,7 @@ return mono_class_entry; } -static void +static int cast_object(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC) { php_mono_object *pm; @@ -729,7 +729,10 @@ case IS_DOUBLE: php_call_mono_method(pm, "ToDouble", sizeof("ToDouble")-1, (void **) NULL, 0, &writeobj TSRMLS_CC); break; - } + default: + return FAILURE; + } + return SUCCESS; } static zend_object_handlers mono_object_handlers[] = { Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.63 php-src/ext/simplexml/simplexml.c:1.64 --- php-src/ext/simplexml/simplexml.c:1.63 Sun Oct 5 21:04:49 2003 +++ php-src/ext/simplexml/simplexml.c Tue Oct 7 11:47:23 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.63 2003/10/06 01:04:49 moriyoshi Exp $ */ +/* $Id: simplexml.c,v 1.64 2003/10/07 15:47:23 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -724,7 +724,7 @@ /* {{{ cast_object() */ -static void +static int cast_object(zval *object, int type, char *contents TSRMLS_DC) { if (contents) { @@ -744,18 +744,22 @@ 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 @@ } } - cast_object(writeobj, type, contents TSRMLS_CC); + rv = cast_object(writeobj, type, contents TSRMLS_CC); if (contents) { xmlFree(contents); @@ -782,6 +786,7 @@ if (should_free) { zval_dtor(&free_obj); } + return rv; } /* }}} */ @@ -1070,7 +1075,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.63 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.64 $"); php_info_print_table_end(); } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php