26
26
#include "zend_string.h"
27
27
#include "zend_sort.h"
28
28
29
- #define HASH_KEY_IS_STRING 1
30
- #define HASH_KEY_IS_LONG 2
31
- #define HASH_KEY_NON_EXISTENT 3
29
+ typedef enum {
30
+ HASH_KEY_IS_STRING = 1 ,
31
+ HASH_KEY_IS_LONG ,
32
+ HASH_KEY_NON_EXISTENT
33
+ } zend_hash_key_type ;
32
34
33
35
#define HASH_UPDATE (1<<0) /* Create new entry, or update the existing one. */
34
36
#define HASH_ADD (1<<1) /* Create new entry, or fail if it exists. */
@@ -251,9 +253,9 @@ ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *h
251
253
252
254
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex (const HashTable * ht , HashPosition * pos );
253
255
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex (const HashTable * ht , HashPosition * pos );
254
- ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex (const HashTable * ht , zend_string * * str_index , zend_ulong * num_index , const HashPosition * pos );
256
+ ZEND_API zend_hash_key_type ZEND_FASTCALL zend_hash_get_current_key_ex (const HashTable * ht , zend_string * * str_index , zend_ulong * num_index , const HashPosition * pos );
255
257
ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex (const HashTable * ht , zval * key , const HashPosition * pos );
256
- ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex (const HashTable * ht , const HashPosition * pos );
258
+ ZEND_API zend_hash_key_type ZEND_FASTCALL zend_hash_get_current_key_type_ex (const HashTable * ht , const HashPosition * pos );
257
259
ZEND_API zval * ZEND_FASTCALL zend_hash_get_current_data_ex (const HashTable * ht , const HashPosition * pos );
258
260
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex (const HashTable * ht , HashPosition * pos );
259
261
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex (const HashTable * ht , HashPosition * pos );
@@ -270,13 +272,13 @@ static zend_always_inline zend_result zend_hash_move_forward(HashTable *ht) {
270
272
static zend_always_inline zend_result zend_hash_move_backwards (HashTable * ht ) {
271
273
return zend_hash_move_backwards_ex (ht , & ht -> nInternalPointer );
272
274
}
273
- static zend_always_inline int zend_hash_get_current_key (const HashTable * ht , zend_string * * str_index , zend_ulong * num_index ) {
275
+ static zend_always_inline zend_hash_key_type zend_hash_get_current_key (const HashTable * ht , zend_string * * str_index , zend_ulong * num_index ) {
274
276
return zend_hash_get_current_key_ex (ht , str_index , num_index , & ht -> nInternalPointer );
275
277
}
276
278
static zend_always_inline void zend_hash_get_current_key_zval (const HashTable * ht , zval * key ) {
277
279
zend_hash_get_current_key_zval_ex (ht , key , & ht -> nInternalPointer );
278
280
}
279
- static zend_always_inline int zend_hash_get_current_key_type (const HashTable * ht ) {
281
+ static zend_always_inline zend_hash_key_type zend_hash_get_current_key_type (const HashTable * ht ) {
280
282
return zend_hash_get_current_key_type_ex (ht , & ht -> nInternalPointer );
281
283
}
282
284
static zend_always_inline zval * zend_hash_get_current_data (const HashTable * ht ) {
0 commit comments