--- embedaddon/php/ext/com_dotnet/com_variant.c 2012/02/21 23:47:53 1.1.1.1 +++ embedaddon/php/ext/com_dotnet/com_variant.c 2013/10/14 08:02:09 1.1.1.4 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: com_variant.c,v 1.1.1.1 2012/02/21 23:47:53 misho Exp $ */ +/* $Id: com_variant.c,v 1.1.1.4 2013/10/14 08:02:09 misho Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -98,12 +98,13 @@ bogus: } } -PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) +PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) { OLECHAR *olestring; php_com_dotnet_object *obj; + zend_uchar ztype = (z == NULL ? IS_NULL : Z_TYPE_P(z)); - switch (Z_TYPE_P(z)) { + switch (ztype) { case IS_NULL: V_VT(v) = VT_NULL; break; @@ -166,7 +167,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval } } -PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC) +PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC) { OLECHAR *olestring = NULL; int ret = SUCCESS; @@ -258,7 +259,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT } -PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC) +PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC) { int ret = SUCCESS; @@ -429,7 +430,7 @@ PHP_FUNCTION(com_variant_create_instance) /* If already an array and VT_ARRAY is passed then: - if only VT_ARRAY passed then do not perform a conversion - if VT_ARRAY plus other type passed then perform conversion - but will probably fail (origional behavior) + but will probably fail (original behavior) */ if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) { long orig_vt = vt; @@ -446,7 +447,7 @@ PHP_FUNCTION(com_variant_create_instance) if (FAILED(res)) { char *werr, *msg; - werr = php_win_err(res); + werr = php_win32_error_to_msg(res); spprintf(&msg, 0, "Variant type conversion failed: %s", werr); LocalFree(werr); @@ -1027,7 +1028,7 @@ PHP_FUNCTION(variant_set_type) } else { char *werr, *msg; - werr = php_win_err(res); + werr = php_win32_error_to_msg(res); spprintf(&msg, 0, "Variant type conversion failed: %s", werr); LocalFree(werr); @@ -1061,7 +1062,7 @@ PHP_FUNCTION(variant_cast) } else { char *werr, *msg; - werr = php_win_err(res); + werr = php_win32_error_to_msg(res); spprintf(&msg, 0, "Variant type conversion failed: %s", werr); LocalFree(werr);