mirror of
https://github.com/php/php-src.git
synced 2025-08-15 05:28:50 +02:00
Add an enum for HASH_KEY_IS_* constants (GH-19376)
This commit is contained in:
parent
290c9aef56
commit
bf64dfcd99
6 changed files with 15 additions and 12 deletions
|
@ -79,6 +79,7 @@ PHP 8.5 INTERNALS UPGRADE NOTES
|
|||
delayed. Before, errors would be recorded but not delayed.
|
||||
. zend_mm_refresh_key_child() must be called on any zend_mm_heap inherited
|
||||
from the parent process after a fork().
|
||||
. HASH_KEY_IS_* constants have been moved in the zend_hash_key_type enum.
|
||||
|
||||
- standard
|
||||
. ext/standard/php_smart_string.h and ext/standard/php_smart_string_public.h
|
||||
|
|
|
@ -2842,7 +2842,7 @@ ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(const HashTable *
|
|||
|
||||
|
||||
/* This function should be made binary safe */
|
||||
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)
|
||||
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)
|
||||
{
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
|
@ -2889,7 +2889,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *h
|
|||
}
|
||||
}
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(const HashTable *ht, const HashPosition *pos)
|
||||
ZEND_API zend_hash_key_type ZEND_FASTCALL zend_hash_get_current_key_type_ex(const HashTable *ht, const HashPosition *pos)
|
||||
{
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
|
|
|
@ -26,9 +26,11 @@
|
|||
#include "zend_string.h"
|
||||
#include "zend_sort.h"
|
||||
|
||||
#define HASH_KEY_IS_STRING 1
|
||||
#define HASH_KEY_IS_LONG 2
|
||||
#define HASH_KEY_NON_EXISTENT 3
|
||||
typedef enum {
|
||||
HASH_KEY_IS_STRING = 1,
|
||||
HASH_KEY_IS_LONG,
|
||||
HASH_KEY_NON_EXISTENT
|
||||
} zend_hash_key_type;
|
||||
|
||||
#define HASH_UPDATE (1<<0) /* Create new entry, or update the existing one. */
|
||||
#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
|
|||
|
||||
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(const HashTable *ht, HashPosition *pos);
|
||||
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(const HashTable *ht, HashPosition *pos);
|
||||
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);
|
||||
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);
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, const HashPosition *pos);
|
||||
ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(const HashTable *ht, const HashPosition *pos);
|
||||
ZEND_API zend_hash_key_type ZEND_FASTCALL zend_hash_get_current_key_type_ex(const HashTable *ht, const HashPosition *pos);
|
||||
ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_data_ex(const HashTable *ht, const HashPosition *pos);
|
||||
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(const HashTable *ht, HashPosition *pos);
|
||||
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) {
|
|||
static zend_always_inline zend_result zend_hash_move_backwards(HashTable *ht) {
|
||||
return zend_hash_move_backwards_ex(ht, &ht->nInternalPointer);
|
||||
}
|
||||
static zend_always_inline int zend_hash_get_current_key(const HashTable *ht, zend_string **str_index, zend_ulong *num_index) {
|
||||
static zend_always_inline zend_hash_key_type zend_hash_get_current_key(const HashTable *ht, zend_string **str_index, zend_ulong *num_index) {
|
||||
return zend_hash_get_current_key_ex(ht, str_index, num_index, &ht->nInternalPointer);
|
||||
}
|
||||
static zend_always_inline void zend_hash_get_current_key_zval(const HashTable *ht, zval *key) {
|
||||
zend_hash_get_current_key_zval_ex(ht, key, &ht->nInternalPointer);
|
||||
}
|
||||
static zend_always_inline int zend_hash_get_current_key_type(const HashTable *ht) {
|
||||
static zend_always_inline zend_hash_key_type zend_hash_get_current_key_type(const HashTable *ht) {
|
||||
return zend_hash_get_current_key_type_ex(ht, &ht->nInternalPointer);
|
||||
}
|
||||
static zend_always_inline zval* zend_hash_get_current_data(const HashTable *ht) {
|
||||
|
|
|
@ -648,7 +648,7 @@ static void zend_weakmap_iterator_get_current_key(zend_object_iterator *obj_iter
|
|||
|
||||
zend_string *string_key;
|
||||
zend_ulong num_key;
|
||||
int key_type = zend_hash_get_current_key_ex(&wm->ht, &string_key, &num_key, pos);
|
||||
zend_hash_key_type key_type = zend_hash_get_current_key_ex(&wm->ht, &string_key, &num_key, pos);
|
||||
if (key_type == HASH_KEY_NON_EXISTENT) {
|
||||
ZVAL_NULL(key);
|
||||
return;
|
||||
|
|
|
@ -32,7 +32,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage)
|
|||
SAFEARRAY *sa = NULL;
|
||||
SAFEARRAYBOUND bound;
|
||||
HashPosition pos;
|
||||
int keytype;
|
||||
zend_hash_key_type keytype;
|
||||
zend_string *strindex;
|
||||
zend_ulong intindex = 0;
|
||||
VARIANT *va;
|
||||
|
|
|
@ -423,7 +423,7 @@ static void generate_dispids(php_dispatchex *disp)
|
|||
HashPosition pos;
|
||||
zend_string *name = NULL;
|
||||
zval *tmp, tmp2;
|
||||
int keytype;
|
||||
zend_hash_key_type keytype;
|
||||
zend_long pid;
|
||||
|
||||
if (disp->dispid_to_name == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue