diff options
| author | Thies C. Arntzen <thies@php.net> | 2000-01-16 09:45:10 +0000 |
|---|---|---|
| committer | Thies C. Arntzen <thies@php.net> | 2000-01-16 09:45:10 +0000 |
| commit | bd375505f7c609d9922adf5b3d2554b95447ad21 (patch) | |
| tree | c968fa49bdf17d08bd33a87f636e70874fd50627 | |
| parent | 3e5dc58f35e6c6ce90e5c7b917659a2b969169d6 (diff) | |
| download | php-git-bd375505f7c609d9922adf5b3d2554b95447ad21.tar.gz | |
make the ht->inconsistent stuff less ugly:)
| -rw-r--r-- | Zend/zend_hash.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 795c66f474..2d2053670d 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -71,8 +71,10 @@ static void _zend_is_inconsistent(HashTable *ht,char *file, int line) } } #define IS_CONSISTENT(a) _zend_is_inconsistent(a,__FILE__,__LINE__); +#define SET_INCONSISTENT(n) ht->inconsistent = n; #else #define IS_CONSISTENT(a) +#define SET_INCONSISTENT(n) #endif /* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */ @@ -103,9 +105,7 @@ ZEND_API int zend_hash_init(HashTable *ht, uint nSize, ulong(*pHashFunction) (ch { uint i; -#if ZEND_DEBUG - ht->inconsistent = 0; -#endif + SET_INCONSISTENT(0); for (i = 0; i < nNumPrimeNumbers; i++) { if (nSize <= PrimeNumbers[i]) { @@ -775,9 +775,7 @@ ZEND_API void zend_hash_destroy(HashTable *ht) IS_CONSISTENT(ht); -#if ZEND_DEBUG - ht->inconsistent=1; -#endif + SET_INCONSISTENT(1); p = ht->pListHead; while (p != NULL) { @@ -801,9 +799,7 @@ ZEND_API void zend_hash_destroy(HashTable *ht) } pefree(ht->arBuckets,ht->persistent); -#if ZEND_DEBUG - ht->inconsistent=2; -#endif + SET_INCONSISTENT(2); } @@ -813,9 +809,7 @@ ZEND_API void zend_hash_clean(HashTable *ht) IS_CONSISTENT(ht); -#if ZEND_DEBUG - ht->inconsistent=3; -#endif + SET_INCONSISTENT(3); p = ht->pListHead; while (p != NULL) { @@ -838,9 +832,7 @@ ZEND_API void zend_hash_clean(HashTable *ht) ht->nNextFreeElement = 0; ht->pInternalPointer = NULL; -#if ZEND_DEBUG - ht->inconsistent=0; /* OK - consistent again! */ -#endif + SET_INCONSISTENT(0); } |
