diff options
Diffstat (limited to 'ext/intl/collator/collator_convert.c')
| -rw-r--r-- | ext/intl/collator/collator_convert.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c index 89224d0341..5a572067f6 100644 --- a/ext/intl/collator/collator_convert.c +++ b/ext/intl/collator/collator_convert.c @@ -41,7 +41,7 @@ /* {{{ collator_convert_hash_item_from_utf8_to_utf16 */ static void collator_convert_hash_item_from_utf8_to_utf16( - HashTable* hash, zval *hashData, zend_string *hashKey, php_uint_t hashIndex, + HashTable* hash, zval *hashData, zend_string *hashKey, zend_ulong hashIndex, UErrorCode* status ) { const char* old_val; @@ -55,7 +55,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16( return; old_val = Z_STRVAL_P( hashData ); - old_val_len = Z_STRSIZE_P( hashData ); + old_val_len = Z_STRLEN_P( hashData ); /* Convert it from UTF-8 to UTF-16LE and save the result to new_val[_len]. */ intl_convert_utf8_to_utf16( &new_val, &new_val_len, old_val, old_val_len, status ); @@ -67,13 +67,13 @@ static void collator_convert_hash_item_from_utf8_to_utf16( //??? efree(new_val); /* hack to fix use of initialized value */ - Z_STRSIZE(znew_val) = Z_STRSIZE(znew_val) - UBYTES(1); + Z_STRLEN(znew_val) = Z_STRLEN(znew_val) - UBYTES(1); if( hashKey) { zend_hash_update( hash, hashKey, &znew_val); } - else /* hashKeyType == HASH_KEY_IS_INT */ + else /* hashKeyType == HASH_KEY_IS_LONG */ { zend_hash_index_update( hash, hashIndex, &znew_val); } @@ -82,7 +82,7 @@ static void collator_convert_hash_item_from_utf8_to_utf16( /* {{{ collator_convert_hash_item_from_utf16_to_utf8 */ static void collator_convert_hash_item_from_utf16_to_utf8( - HashTable* hash, zval * hashData, zend_string* hashKey, php_uint_t hashIndex, + HashTable* hash, zval * hashData, zend_string* hashKey, zend_ulong hashIndex, UErrorCode* status ) { const char* old_val; @@ -96,7 +96,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( return; old_val = Z_STRVAL_P( hashData ); - old_val_len = Z_STRSIZE_P( hashData ); + old_val_len = Z_STRLEN_P( hashData ); /* Convert it from UTF-16LE to UTF-8 and save the result to new_val[_len]. */ intl_convert_utf16_to_utf8( &new_val, &new_val_len, @@ -113,7 +113,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( { zend_hash_update( hash, hashKey, &znew_val); } - else /* hashKeyType == HASH_KEY_IS_INT */ + else /* hashKeyType == HASH_KEY_IS_LONG */ { zend_hash_index_update( hash, hashIndex, &znew_val); } @@ -125,7 +125,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8( */ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status ) { - php_uint_t hashIndex; + zend_ulong hashIndex; zval *hashData; zend_string *hashKey; @@ -144,7 +144,7 @@ void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* stat */ void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status ) { - php_uint_t hashIndex; + zend_ulong hashIndex; zend_string *hashKey; zval *hashData; @@ -176,7 +176,7 @@ zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv ) /* Convert to utf8 then. */ intl_convert_utf16_to_utf8( &str, &str_len, - (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRSIZE_P(utf16_zval) ), &status ); + (UChar*) Z_STRVAL_P(utf16_zval), UCHARS( Z_STRLEN_P(utf16_zval) ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error converting utf16 to utf8 in collator_convert_zval_utf16_to_utf8()" ); @@ -207,7 +207,7 @@ zval* collator_convert_zstr_utf8_to_utf16( zval* utf8_zval, zval *rv ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( utf8_zval ), Z_STRSIZE_P( utf8_zval ), + Z_STRVAL_P( utf8_zval ), Z_STRLEN_P( utf8_zval ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_zstr_utf8_to_utf16()" ); @@ -282,7 +282,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv TSRMLS_DC ) /* Convert the string to UTF-16. */ intl_convert_utf8_to_utf16( &ustr, &ustr_len, - Z_STRVAL_P( zstr ), Z_STRSIZE_P( zstr ), + Z_STRVAL_P( zstr ), Z_STRLEN_P( zstr ), &status ); if( U_FAILURE( status ) ) php_error( E_WARNING, "Error casting object to string in collator_convert_object_to_string()" ); @@ -320,7 +320,7 @@ zval* collator_convert_string_to_number( zval* str, zval *rv ) zval_ptr_dtor( num ); num = rv; - ZVAL_INT( num, 0 ); + ZVAL_LONG( num, 0 ); } return num; @@ -338,9 +338,9 @@ zval* collator_convert_string_to_number( zval* str, zval *rv ) zval* collator_convert_string_to_double( zval* str, zval *rv ) { zval* num = collator_convert_string_to_number( str, rv ); - if( Z_TYPE_P(num) == IS_INT ) + if( Z_TYPE_P(num) == IS_LONG ) { - ZVAL_DOUBLE( num, Z_IVAL_P( num ) ); + ZVAL_DOUBLE( num, Z_LVAL_P( num ) ); } return num; @@ -359,7 +359,7 @@ zval* collator_convert_string_to_double( zval* str, zval *rv ) zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) { int is_numeric = 0; - php_int_t lval = 0; + zend_long lval = 0; double dval = 0; if( Z_TYPE_P( str ) != IS_STRING ) @@ -367,10 +367,10 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv ) COLLATOR_CONVERT_RETURN_FAILED( str ); } - if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRSIZE_P(str) ), &lval, &dval, 1 ) ) ) + if( ( is_numeric = collator_is_numeric( (UChar*) Z_STRVAL_P(str), UCHARS( Z_STRLEN_P(str) ), &lval, &dval, 1 ) ) ) { - if( is_numeric == IS_INT ) { - ZVAL_INT(rv, lval); + if( is_numeric == IS_LONG ) { + ZVAL_LONG(rv, lval); } if( is_numeric == IS_DOUBLE ) ZVAL_DOUBLE(rv, dval); |
