com php-src: Fixed collator_sort: ext/intl/collator/colla tor_convert.c
| From: | Xinchen Hui | Date: | Sun, 29 Jun 2014 11:01:02 +0000 |
| Subject: | com php-src: Fixed collator_sort: ext/intl/collator/colla tor_convert.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79129@lists.php.net to get a copy of this message | ||
Commit: 477f565f80c0c396a99903081851ea6bf2223e0f
Author: Xinchen Hui <laruence@php.net> Sun, 29 Jun 2014 18:45:14 +0800
Parents: f2c83b774ae3fb101e000df16eeefbe59ba4a318
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=477f565f80c0c396a99903081851ea6bf2223e0f
Log:
Fixed collator_sort
Changed paths:
M ext/intl/collator/collator_convert.c
Diff:
diff --git a/ext/intl/collator/collator_convert.c b/ext/intl/collator/collator_convert.c
index de5d4ad..5827e4e 100644
--- a/ext/intl/collator/collator_convert..c
+++ b/ext/intl/collator/collator_convert.c
@@ -41,19 +41,15 @@
/* {{{ collator_convert_hash_item_from_utf8_to_utf16 */
static void collator_convert_hash_item_from_utf8_to_utf16(
- HashTable* hash, zend_string *hashKey, ulong hashIndex,
+ HashTable* hash, zval *hashData, zend_string *hashKey, ulong hashIndex,
UErrorCode* status )
{
const char* old_val;
int old_val_len;
UChar* new_val = NULL;
int new_val_len = 0;
- zval* hashData = NULL;
zval znew_val;
- /* Get current hash item. */
- hashData = zend_hash_get_current_data( hash );
-
/* Process string values only. */
if( Z_TYPE_P( hashData ) != IS_STRING )
return;
@@ -84,19 +80,15 @@ 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, zend_string* hashKey, ulong hashIndex,
+ HashTable* hash, zval * hashData, zend_string* hashKey, ulong hashIndex,
UErrorCode* status )
{
const char* old_val;
int old_val_len;
char* new_val = NULL;
int new_val_len = 0;
- zval* hashData = NULL;
zval znew_val;
- /* Get current hash item. */
- hashData = zend_hash_get_current_data( hash );
-
/* Process string values only. */
if( Z_TYPE_P( hashData ) != IS_STRING )
return;
@@ -132,12 +124,13 @@ static void collator_convert_hash_item_from_utf16_to_utf8(
void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status )
{
ulong hashIndex;
+ zval *hashData;
zend_string *hashKey;
- ZEND_HASH_FOREACH_KEY(hash, hashIndex, hashKey) {
+ ZEND_HASH_FOREACH_KEY_VAL(hash, hashIndex, hashKey, hashData) {
/* Convert current hash item from UTF-8 to UTF-16LE. */
collator_convert_hash_item_from_utf8_to_utf16(
- hash, hashKey, hashIndex, status );
+ hash, hashData, hashKey, hashIndex, status );
if( U_FAILURE( *status ) )
return;
} ZEND_HASH_FOREACH_END();
@@ -151,11 +144,12 @@ void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode*
stat
{
ulong hashIndex;
zend_string *hashKey;
+ zval *hashData;
- ZEND_HASH_FOREACH_KEY(hash, hashIndex, hashKey) {
+ ZEND_HASH_FOREACH_KEY_VAL(hash, hashIndex, hashKey, hashData) {
/* Convert current hash item from UTF-16LE to UTF-8. */
collator_convert_hash_item_from_utf16_to_utf8(
- hash, hashKey, hashIndex, status );
+ hash, hashData, hashKey, hashIndex, status );
if( U_FAILURE( *status ) ) {
return;
}