]> granicus.if.org Git - php/commitdiff
Make converter work on VS
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Wed, 26 Dec 2012 00:51:45 +0000 (00:51 +0000)
committerGustavo Lopes <glopes@nebm.ist.utl.pt>
Tue, 29 Jan 2013 18:19:49 +0000 (19:19 +0100)
ext/intl/converter/converter.c

index 8b578c43af3dee1eca324736555ea16d8c4ca886..09ea609e8c1007b9a392e82906d4dcba5180d6a4 100644 (file)
@@ -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);