mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
ZEND_ELEMENT_COUNT usage reduction. (#13324)
clang 18 is going to be released and in the meantime the counted_by attribute usage had been constrained to true flexible arrays, typical cases such as type name[1] ZEND_ELEMENT_COUNT(size) no longer build.
This commit is contained in:
parent
9628ca7bd2
commit
b8f10decb3
8 changed files with 10 additions and 10 deletions
|
@ -39,7 +39,7 @@ struct _zend_call_info {
|
||||||
bool named_args; /* Function has named arguments */
|
bool named_args; /* Function has named arguments */
|
||||||
bool is_prototype; /* An overridden child method may be called */
|
bool is_prototype; /* An overridden child method may be called */
|
||||||
int num_args; /* Number of arguments, excluding named and variadic arguments */
|
int num_args; /* Number of arguments, excluding named and variadic arguments */
|
||||||
zend_send_arg_info arg_info[1] ZEND_ELEMENT_COUNT(num_args);
|
zend_send_arg_info arg_info[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _zend_func_info {
|
struct _zend_func_info {
|
||||||
|
|
|
@ -95,7 +95,7 @@ typedef struct _zend_trait_method_reference {
|
||||||
typedef struct _zend_trait_precedence {
|
typedef struct _zend_trait_precedence {
|
||||||
zend_trait_method_reference trait_method;
|
zend_trait_method_reference trait_method;
|
||||||
uint32_t num_excludes;
|
uint32_t num_excludes;
|
||||||
zend_string *exclude_class_names[1] ZEND_ELEMENT_COUNT(num_excludes);
|
zend_string *exclude_class_names[1];
|
||||||
} zend_trait_precedence;
|
} zend_trait_precedence;
|
||||||
|
|
||||||
typedef struct _zend_trait_alias {
|
typedef struct _zend_trait_alias {
|
||||||
|
|
|
@ -191,7 +191,7 @@ typedef struct _zend_ast_list {
|
||||||
zend_ast_attr attr;
|
zend_ast_attr attr;
|
||||||
uint32_t lineno;
|
uint32_t lineno;
|
||||||
uint32_t children;
|
uint32_t children;
|
||||||
zend_ast *child[1] ZEND_ELEMENT_COUNT(children);
|
zend_ast *child[1];
|
||||||
} zend_ast_list;
|
} zend_ast_list;
|
||||||
|
|
||||||
/* Lineno is stored in val.u2.lineno */
|
/* Lineno is stored in val.u2.lineno */
|
||||||
|
|
|
@ -58,7 +58,7 @@ typedef struct _zend_attribute {
|
||||||
/* Parameter offsets start at 1, everything else uses 0. */
|
/* Parameter offsets start at 1, everything else uses 0. */
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
uint32_t argc;
|
uint32_t argc;
|
||||||
zend_attribute_arg args[1] ZEND_ELEMENT_COUNT(argc);
|
zend_attribute_arg args[1];
|
||||||
} zend_attribute;
|
} zend_attribute;
|
||||||
|
|
||||||
typedef struct _zend_internal_attribute {
|
typedef struct _zend_internal_attribute {
|
||||||
|
|
|
@ -139,7 +139,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t num_types;
|
uint32_t num_types;
|
||||||
zend_type types[1] ZEND_ELEMENT_COUNT(num_types);
|
zend_type types[1];
|
||||||
} zend_type_list;
|
} zend_type_list;
|
||||||
|
|
||||||
#define _ZEND_TYPE_EXTRA_FLAGS_SHIFT 25
|
#define _ZEND_TYPE_EXTRA_FLAGS_SHIFT 25
|
||||||
|
@ -374,7 +374,7 @@ struct _zend_string {
|
||||||
zend_refcounted_h gc;
|
zend_refcounted_h gc;
|
||||||
zend_ulong h; /* hash value */
|
zend_ulong h; /* hash value */
|
||||||
size_t len;
|
size_t len;
|
||||||
char val[1] ZEND_ELEMENT_COUNT(len);
|
char val[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _Bucket {
|
typedef struct _Bucket {
|
||||||
|
@ -572,7 +572,7 @@ struct _zend_resource {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t num;
|
size_t num;
|
||||||
size_t num_allocated;
|
size_t num_allocated;
|
||||||
struct _zend_property_info *ptr[1] ZEND_ELEMENT_COUNT(num);
|
struct _zend_property_info *ptr[1];
|
||||||
} zend_property_info_list;
|
} zend_property_info_list;
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
|
|
|
@ -277,7 +277,7 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
size_t cat_num;
|
size_t cat_num;
|
||||||
cdf_catalog_entry_t cat_e[1] ZEND_ELEMENT_COUNT(cat_num);
|
cdf_catalog_entry_t cat_e[1];
|
||||||
} cdf_catalog_t;
|
} cdf_catalog_t;
|
||||||
|
|
||||||
struct timespec;
|
struct timespec;
|
||||||
|
|
|
@ -540,7 +540,7 @@ struct _zend_jit_trace_stack_frame {
|
||||||
int used_stack;
|
int used_stack;
|
||||||
int old_checked_stack;
|
int old_checked_stack;
|
||||||
int old_peek_checked_stack;
|
int old_peek_checked_stack;
|
||||||
zend_jit_trace_stack stack[1] ZEND_ELEMENT_COUNT(used_stack);
|
zend_jit_trace_stack stack[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TRACE_FRAME_SHIFT_NUM_ARGS 16
|
#define TRACE_FRAME_SHIFT_NUM_ARGS 16
|
||||||
|
|
|
@ -44,7 +44,7 @@ typedef struct {
|
||||||
size_t len;
|
size_t len;
|
||||||
zend_op_array op_array;
|
zend_op_array op_array;
|
||||||
uint32_t lines;
|
uint32_t lines;
|
||||||
uint32_t line[1] ZEND_ELEMENT_COUNT(lines);
|
uint32_t line[1];
|
||||||
} phpdbg_file_source;
|
} phpdbg_file_source;
|
||||||
|
|
||||||
#endif /* PHPDBG_LIST_H */
|
#endif /* PHPDBG_LIST_H */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue