cvs: php4 /ext/standard array.c

From: Date: Thu, 01 Aug 2002 12:06:47 +0000
Subject: cvs: php4 /ext/standard array.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13078@lists.php.net to get a copy of this message
sniper Thu Aug 1 08:06:47 2002 EDT Modified files: /php4/ext/standard array.c Log: - Removed the DOS line endings - Changed the '//' comment (this is C, not C++) to /* */ # Brad, use some editor which works.. Index: php4/ext/standard/array.c diff -u php4/ext/standard/array.c:1.175 php4/ext/standard/array.c:1.176 --- php4/ext/standard/array.c:1.175 Thu Aug 1 00:38:11 2002 +++ php4/ext/standard/array.c Thu Aug 1 08:06:46 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.175 2002/08/01 04:38:11 rodif_bl Exp $ */ +/* $Id: array.c,v 1.176 2002/08/01 12:06:46 sniper Exp $ */ #include "php.h" #include "php_ini.h" @@ -1661,8 +1661,8 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) { zval **stack, /* Input stack */ - **val; /* Value to be popped */ - char *key = NULL; + **val; /* Value to be popped */ + char *key = NULL; int key_len, index; /* Get the arguments and do error-checking */ @@ -1690,25 +1690,25 @@ INIT_PZVAL(return_value); /* Delete the first or last value */ - zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), &key, &key_len, &index, 0, NULL); - zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, index, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX); - - // If we did a shift... re-index like it did before - if(!off_the_end) { - HANDLE_BLOCK_INTERRUPTIONS(); - { - int k = 0; - Bucket *p = Z_ARRVAL_PP(stack)->pListHead; - while (p != NULL) { - if (p->nKeyLength == 0) - p->h = k++; - p = p->pListNext; - } - Z_ARRVAL_PP(stack)->nNextFreeElement = k+1; - zend_hash_rehash(Z_ARRVAL_PP(stack)); - } - HANDLE_UNBLOCK_INTERRUPTIONS(); - } + zend_hash_get_current_key_ex(Z_ARRVAL_PP(stack), &key, &key_len, &index, 0, NULL); + zend_hash_del_key_or_index(Z_ARRVAL_PP(stack), key, key_len, index, (key) ? HASH_DEL_KEY : HASH_DEL_INDEX); + + /* If we did a shift... re-index like it did before */ + if(!off_the_end) { + HANDLE_BLOCK_INTERRUPTIONS(); + { + int k = 0; + Bucket *p = Z_ARRVAL_PP(stack)->pListHead; + while (p != NULL) { + if (p->nKeyLength == 0) + p->h = k++; + p = p->pListNext; + } + Z_ARRVAL_PP(stack)->nNextFreeElement = k+1; + zend_hash_rehash(Z_ARRVAL_PP(stack)); + } + HANDLE_UNBLOCK_INTERRUPTIONS(); + } } /* }}} */

« previous php.cvs (#13078) next »