com php-src: Make converter work on VS: ext/intl/converter/converter.c
| From: | Gustavo André dos Santos Lopes | Date: | Tue, 29 Jan 2013 18:19:49 +0000 |
| Subject: | com php-src: Make converter work on VS: ext/intl/converter/converter.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71063@lists.php.net to get a copy of this message | ||
Commit: 9d1bdaa569e0de0c36ee483784606246e106013f
Author: Gustavo Lopes <glopes@nebm.ist.utl.pt> Wed, 26 Dec 2012 00:51:45 +0000
Parents: 1da67fc65e4909c671a9ccffec7d8d314f1829f1
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9d1bdaa569e0de0c36ee483784606246e106013f
Log:
Make converter work on VS
Changed paths:
M ext/intl/converter/converter.c
Diff:
diff --git a/ext/intl/converter/converter.c b/ext/intl/converter/converter.c
index 8b578c4..09ea609 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);