diff options
| author | Gustavo Lopes <glopes@nebm.ist.utl.pt> | 2012-12-26 00:51:45 +0000 |
|---|---|---|
| committer | Gustavo Lopes <glopes@nebm.ist.utl.pt> | 2013-01-29 19:19:49 +0100 |
| commit | 9d1bdaa569e0de0c36ee483784606246e106013f (patch) | |
| tree | d551e9a65e2b46b4e4bc48eda8d385c9abe18fc7 /ext | |
| parent | 1da67fc65e4909c671a9ccffec7d8d314f1829f1 (diff) | |
| download | php-git-9d1bdaa569e0de0c36ee483784606246e106013f.tar.gz | |
Make converter work on VS
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/intl/converter/converter.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c index 8b578c43af..09ea609e8c 100644 --- a/ext/intl/converter/converter.c +++ b/ext/intl/converter/converter.c @@ -673,9 +673,11 @@ static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, in UConverter *src_cnv, const char *src, int32_t src_len, php_converter_object *objval TSRMLS_DC) { - UErrorCode error = U_ZERO_ERROR; - int32_t dest_len; - char *dest; + UErrorCode error = U_ZERO_ERROR; + int32_t dest_len, + temp_len; + char *dest; + UChar *temp; if (!src_cnv || !dest_cnv) { php_converter_throw_failure(objval, U_INVALID_STATE_ERROR TSRMLS_CC, @@ -684,12 +686,12 @@ static zend_bool php_converter_do_convert(UConverter *dest_cnv, char **pdest, in } /* Get necessary buffer size first */ - int32_t temp_len = 1 + ucnv_toUChars(src_cnv, NULL, 0, src, src_len, &error); + temp_len = 1 + ucnv_toUChars(src_cnv, NULL, 0, src, src_len, &error); if (U_FAILURE(error) && error != U_BUFFER_OVERFLOW_ERROR) { THROW_UFAILURE(objval, "ucnv_toUChars", error); return 0; } - UChar *temp = safe_emalloc(sizeof(UChar), temp_len, sizeof(UChar)); + temp = safe_emalloc(sizeof(UChar), temp_len, sizeof(UChar)); /* Convert to intermediate UChar* array */ error = U_ZERO_ERROR; @@ -941,8 +943,10 @@ static PHP_METHOD(UConverter, getAliases) { array_init(return_value); for(i = 0; i < count; i++) { + const char *alias; + error = U_ZERO_ERROR; - const char *alias = ucnv_getAlias(name, i, &error); + alias = ucnv_getAlias(name, i, &error); if (U_FAILURE(error)) { THROW_UFAILURE(NULL, "ucnv_getAlias", error); zval_dtor(return_value); |
