Skip to content

Commit d55c85d

Browse files
committed
fix return of hash num elements
1 parent 33b5108 commit d55c85d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Zend/zend_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ ZEND_API int zend_hash_index_exists(const HashTable *ht, zend_uint_t h)
991991
}
992992

993993

994-
ZEND_API int zend_hash_num_elements(const HashTable *ht)
994+
ZEND_API zend_uint_t zend_hash_num_elements(const HashTable *ht)
995995
{
996996
IS_CONSISTENT(ht);
997997

@@ -1440,7 +1440,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
14401440
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
14411441
{
14421442
Bucket *p1, *p2 = NULL;
1443-
int result;
1443+
ptrdiff_t result;
14441444
void *pData2;
14451445

14461446
IS_CONSISTENT(ht1);

Zend/zend_hash.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
224224
#define zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite) \
225225
_zend_hash_merge(target, source, pCopyConstructor, tmp, size, overwrite ZEND_FILE_LINE_CC)
226226

227-
ZEND_API int zend_hash_num_elements(const HashTable *ht);
227+
ZEND_API zend_uint_t zend_hash_num_elements(const HashTable *ht);
228228

229229
ZEND_API int zend_hash_rehash(HashTable *ht);
230230

@@ -263,7 +263,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht);
263263

264264
static inline zend_uint_t zend_inline_hash_func(const char *arKey, zend_size_t nKeyLength)
265265
{
266-
register zend_uint_t hash = 5381;
266+
register zend_uint_t hash = Z_UI(5381);
267267

268268
/* variant with the hash unrolled eight times */
269269
for (; nKeyLength >= 8; nKeyLength -= 8) {

0 commit comments

Comments
 (0)