cvs: ZendEngine2 / zend_hash.c

From: Date: Mon, 25 Apr 2005 08:21:16 +0000
Subject: cvs: ZendEngine2 / zend_hash.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-3582@lists.php.net to get a copy of this message
sniper Mon Apr 25 04:21:16 2005 EDT Modified files: /ZendEngine2 zend_hash.c Log: ws http://cvs.php.net/diff.php/ZendEngine2/zend_hash.c?r1=1.117&r2=1.118&ty=u Index: ZendEngine2/zend_hash.c diff -u ZendEngine2/zend_hash.c:1.117 ZendEngine2/zend_hash.c:1.118 --- ZendEngine2/zend_hash.c:1.117 Mon Apr 25 02:13:57 2005 +++ ZendEngine2/zend_hash.c Mon Apr 25 04:21:15 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_hash.c,v 1.117 2005/04/25 06:13:57 dmitry Exp $ */ +/* $Id: zend_hash.c,v 1.118 2005/04/25 08:21:15 sniper Exp $ */ #include "zend.h" @@ -239,7 +239,7 @@ p = p->pNext; } - p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent); + p = (Bucket *) pemalloc(sizeof(Bucket) - 1 + nKeyLength, ht->persistent); if (!p) { return FAILURE; } @@ -304,7 +304,7 @@ p = p->pNext; } - p = (Bucket *) pemalloc(sizeof(Bucket)-1+nKeyLength, ht->persistent); + p = (Bucket *) pemalloc(sizeof(Bucket) - 1 + nKeyLength, ht->persistent); if (!p) { return FAILURE; } @@ -380,11 +380,11 @@ } p = p->pNext; } - p = (Bucket *) pemalloc_rel(sizeof(Bucket)-1, ht->persistent); + p = (Bucket *) pemalloc_rel(sizeof(Bucket) - 1, ht->persistent); if (!p) { return FAILURE; } - p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */ + p->nKeyLength = 0; /* Numeric indices are marked by making the nKeyLength == 0 */ p->h = h; INIT_DATA(ht, p, pData, nDataSize); if (pDest) { @@ -761,9 +761,9 @@ } else { zend_hash_index_update(target, p->h, p->pData, size, &new_entry); } - if (pCopyConstructor) { - pCopyConstructor(new_entry); - } + if (pCopyConstructor) { + pCopyConstructor(new_entry); + } p = p->pListNext; } target->pInternalPointer = target->pListHead; @@ -779,7 +779,7 @@ IS_CONSISTENT(source); IS_CONSISTENT(target); - p = source->pListHead; + p = source->pListHead; while (p) { if (p->nKeyLength>0) { if (_zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) { @@ -815,7 +815,7 @@ IS_CONSISTENT(source); IS_CONSISTENT(target); - p = source->pListHead; + p = source->pListHead; while (p) { if (zend_hash_replace_checker_wrapper(target, p->pData, p, pParam, pMergeSource)) { if (zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) { @@ -1046,7 +1046,7 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos) { Bucket *p; - + p = pos ? (*pos) : ht->pInternalPointer; IS_CONSISTENT(ht); @@ -1054,7 +1054,7 @@ if (p) { if (p->nKeyLength) { if (duplicate) { - *str_index = estrndup(p->arKey, p->nKeyLength-1); + *str_index = estrndup(p->arKey, p->nKeyLength - 1); } else { *str_index = p->arKey; } @@ -1074,7 +1074,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos) { Bucket *p; - + p = pos ? (*pos) : ht->pInternalPointer; IS_CONSISTENT(ht); @@ -1093,7 +1093,7 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos) { Bucket *p; - + p = pos ? (*pos) : ht->pInternalPointer; IS_CONSISTENT(ht); @@ -1140,17 +1140,17 @@ arTmp[0]->pListLast = NULL; if (i > 1) { - arTmp[0]->pListNext = arTmp[1]; - for (j = 1; j < i-1; j++) { - arTmp[j]->pListLast = arTmp[j-1]; - arTmp[j]->pListNext = arTmp[j+1]; - } - arTmp[j]->pListLast = ht->pListTail; - arTmp[j]->pListNext = NULL; - } else { - arTmp[0]->pListNext = NULL; - } - ht->pListTail = arTmp[i-1]; + arTmp[0]->pListNext = arTmp[1]; + for (j = 1; j < i-1; j++) { + arTmp[j]->pListLast = arTmp[j-1]; + arTmp[j]->pListNext = arTmp[j+1]; + } + arTmp[j]->pListLast = ht->pListTail; + arTmp[j]->pListNext = NULL; + } else { + arTmp[0]->pListNext = NULL; + } + ht->pListTail = arTmp[i-1]; pefree(arTmp, ht->persistent); HANDLE_UNBLOCK_INTERRUPTIONS();

« previous php.zend-engine.cvs (#3582) next »