summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/com_variant.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
committerAnatol Belski <ab@php.net>2014-08-25 19:24:55 +0200
commitc3e3c98ec666812daaaca896cf5ef758a8a6df14 (patch)
treed82a76de5c8d117d1cf2dcca19bb30a283621870 /ext/com_dotnet/com_variant.c
parent0cf2dbdf58645b52cb6582b1b2571c5cd9e9e6b3 (diff)
downloadphp-git-c3e3c98ec666812daaaca896cf5ef758a8a6df14.tar.gz
master renames phase 1
Diffstat (limited to 'ext/com_dotnet/com_variant.c')
-rw-r--r--ext/com_dotnet/com_variant.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 27583e5dc9..9931e7182f 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -39,8 +39,8 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
HashPosition pos;
int keytype;
zend_string *strindex;
- php_int_t intindex = -1;
- php_int_t max_index = 0;
+ zend_long intindex = -1;
+ zend_long max_index = 0;
VARIANT *va;
zval *item;
@@ -145,9 +145,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
safe_array_from_zval(v, z, codepage TSRMLS_CC);
break;
- case IS_INT:
+ case IS_LONG:
V_VT(v) = VT_I4;
- V_I4(v) = Z_IVAL_P(z);
+ V_I4(v) = Z_LVAL_P(z);
break;
case IS_DOUBLE:
@@ -157,11 +157,11 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
- olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRSIZE_P(z), codepage TSRMLS_CC);
+ olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
} else {
- V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRSIZE_P(z) * sizeof(OLECHAR));
+ V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
}
efree(olestring);
break;
@@ -187,28 +187,28 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
ZVAL_NULL(z);
break;
case VT_UI1:
- ZVAL_INT(z, (php_int_t)V_UI1(v));
+ ZVAL_LONG(z, (zend_long)V_UI1(v));
break;
case VT_I1:
- ZVAL_INT(z, (php_int_t)V_I1(v));
+ ZVAL_LONG(z, (zend_long)V_I1(v));
break;
case VT_UI2:
- ZVAL_INT(z, (php_int_t)V_UI2(v));
+ ZVAL_LONG(z, (zend_long)V_UI2(v));
break;
case VT_I2:
- ZVAL_INT(z, (php_int_t)V_I2(v));
+ ZVAL_LONG(z, (zend_long)V_I2(v));
break;
case VT_UI4: /* TODO: promote to double if large? */
- ZVAL_INT(z, (php_int_t)V_UI4(v));
+ ZVAL_LONG(z, (zend_long)V_UI4(v));
break;
case VT_I4:
- ZVAL_INT(z, (php_int_t)V_I4(v));
+ ZVAL_LONG(z, (zend_long)V_I4(v));
break;
case VT_INT:
- ZVAL_INT(z, V_INT(v));
+ ZVAL_LONG(z, V_INT(v));
break;
case VT_UINT: /* TODO: promote to double if large? */
- ZVAL_INT(z, (php_int_t)V_UINT(v));
+ ZVAL_LONG(z, (zend_long)V_UINT(v));
break;
case VT_R4:
ZVAL_DOUBLE(z, (double)V_R4(v));
@@ -406,8 +406,8 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR
/* {{{ com_variant_create_instance - ctor for new VARIANT() */
PHP_FUNCTION(com_variant_create_instance)
{
- /* VARTYPE == unsigned short */ php_int_t vt = VT_EMPTY;
- php_int_t codepage = CP_ACP;
+ /* VARTYPE == unsigned short */ zend_long vt = VT_EMPTY;
+ zend_long codepage = CP_ACP;
zval *object = getThis();
php_com_dotnet_object *obj;
zval *zvalue = NULL;
@@ -421,7 +421,7 @@ PHP_FUNCTION(com_variant_create_instance)
obj = CDNO_FETCH(object);
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
- "z!|ii", &zvalue, &vt, &codepage)) {
+ "z!|ll", &zvalue, &vt, &codepage)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
}
@@ -444,7 +444,7 @@ PHP_FUNCTION(com_variant_create_instance)
but will probably fail (original behavior)
*/
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
- php_int_t orig_vt = vt;
+ zend_long orig_vt = vt;
vt &= ~VT_ARRAY;
if (vt) {
@@ -832,7 +832,7 @@ PHP_FUNCTION(variant_round)
zval *zleft = NULL;
php_com_dotnet_object *obj;
int codepage = CP_ACP;
- php_int_t decimals = 0;
+ zend_long decimals = 0;
VariantInit(&left_val);
VariantInit(&vres);
@@ -867,8 +867,8 @@ PHP_FUNCTION(variant_cmp)
zval *zleft = NULL, *zright = NULL;
php_com_dotnet_object *obj;
int codepage = CP_ACP;
- php_int_t lcid = LOCALE_SYSTEM_DEFAULT;
- php_int_t flags = 0;
+ zend_long lcid = LOCALE_SYSTEM_DEFAULT;
+ zend_long flags = 0;
/* it is safe to ignore the warning for this line; see the comments in com_handlers.c */
STDAPI VarCmp(LPVARIANT pvarLeft, LPVARIANT pvarRight, LCID lcid, DWORD flags);
@@ -876,28 +876,28 @@ PHP_FUNCTION(variant_cmp)
VariantInit(&right_val);
if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "OO|ii", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS() TSRMLS_CC, "OO|ll", &zleft, php_com_variant_class_entry,
&zright, php_com_variant_class_entry, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
obj = CDNO_FETCH(zright);
vright = &obj->v;
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ii", &zleft, php_com_variant_class_entry,
+ ZEND_NUM_ARGS() TSRMLS_CC, "Oz!|ll", &zleft, php_com_variant_class_entry,
&zright, &lcid, &flags)) {
obj = CDNO_FETCH(zleft);
vleft = &obj->v;
vright = &right_val;
php_com_variant_from_zval(vright, zright, codepage TSRMLS_CC);
} else if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET,
- ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ii", &zleft, &zright, php_com_variant_class_entry,
+ ZEND_NUM_ARGS() TSRMLS_CC, "z!O|ll", &zleft, &zright, php_com_variant_class_entry,
&lcid, &flags)) {
obj = CDNO_FETCH(zright);
vright = &obj->v;
vleft = &left_val;
php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
} else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
- "z!z!|ii", &zleft, &zright, &lcid, &flags)) {
+ "z!z!|ll", &zleft, &zright, &lcid, &flags)) {
vleft = &left_val;
php_com_variant_from_zval(vleft, zleft, codepage TSRMLS_CC);
@@ -909,7 +909,7 @@ PHP_FUNCTION(variant_cmp)
return;
}
- ZVAL_INT(return_value, VarCmp(vleft, vright, lcid, flags));
+ ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags));
VariantClear(&left_val);
VariantClear(&right_val);
@@ -948,7 +948,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
tmv.tm_isdst = -1;
tzset();
- RETVAL_INT(mktime(&tmv));
+ RETVAL_LONG(mktime(&tmv));
}
VariantClear(&vres);
@@ -959,13 +959,13 @@ PHP_FUNCTION(variant_date_to_timestamp)
Returns a variant date representation of a unix timestamp */
PHP_FUNCTION(variant_date_from_timestamp)
{
- php_int_t timestamp;
+ zend_long timestamp;
time_t ttstamp;
SYSTEMTIME systime;
struct tm *tmv;
VARIANT res;
- if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i",
+ if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
&timestamp)) {
return;
}
@@ -1010,7 +1010,7 @@ PHP_FUNCTION(variant_get_type)
}
obj = CDNO_FETCH(zobj);
- RETURN_INT(V_VT(&obj->v));
+ RETURN_LONG(V_VT(&obj->v));
}
/* }}} */
@@ -1020,11 +1020,11 @@ PHP_FUNCTION(variant_set_type)
{
zval *zobj;
php_com_dotnet_object *obj;
- /* VARTYPE == unsigned short */ php_int_t vt;
+ /* VARTYPE == unsigned short */ zend_long vt;
HRESULT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
- "Oi", &zobj, php_com_variant_class_entry, &vt)) {
+ "Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
obj = CDNO_FETCH(zobj);
@@ -1055,12 +1055,12 @@ PHP_FUNCTION(variant_cast)
{
zval *zobj;
php_com_dotnet_object *obj;
- /* VARTYPE == unsigned short */ php_int_t vt;
+ /* VARTYPE == unsigned short */ zend_long vt;
VARIANT vres;
HRESULT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
- "Oi", &zobj, php_com_variant_class_entry, &vt)) {
+ "Ol", &zobj, php_com_variant_class_entry, &vt)) {
return;
}
obj = CDNO_FETCH(zobj);