Use ISO C syntax for flexible array members

This commit is contained in:
Andrew Johnson 2024-06-23 15:07:46 +03:00
parent 2ea0848616
commit 5a6dea3195
3 changed files with 9 additions and 9 deletions

View file

@ -2064,7 +2064,7 @@ typedef struct REExecState {
size_t count; /* only used for RE_EXEC_STATE_GREEDY_QUANT */
const uint8_t *cptr;
const uint8_t *pc;
void *buf[0];
void *buf[];
} REExecState;
typedef struct {

View file

@ -3231,7 +3231,7 @@ typedef struct {
typedef struct {
int ref_count;
uint64_t buf[0];
uint64_t buf[];
} JSSABHeader;
static JSClassID js_worker_class_id;

View file

@ -474,8 +474,8 @@ struct JSString {
struct list_head link; /* string list */
#endif
union {
uint8_t str8[0]; /* 8 bit strings will get an extra null terminator */
uint16_t str16[0];
__extension__ uint8_t str8[0]; /* 8 bit strings will get an extra null terminator */
__extension__ uint16_t str16[0];
} u;
};
@ -664,7 +664,7 @@ typedef struct JSBoundFunction {
JSValue func_obj;
JSValue this_val;
int argc;
JSValue argv[0];
JSValue argv[];
} JSBoundFunction;
typedef enum JSIteratorKindEnum {
@ -822,7 +822,7 @@ typedef struct JSJobEntry {
JSContext *ctx;
JSJobFunc *job_func;
int argc;
JSValue argv[0];
JSValue argv[];
} JSJobEntry;
typedef struct JSProperty {
@ -871,7 +871,7 @@ struct JSShape {
int deleted_prop_count;
JSShape *shape_hash_next; /* in JSRuntime.shape_hash[h] list */
JSObject *proto;
JSShapeProperty prop[0]; /* prop_size elements */
JSShapeProperty prop[]; /* prop_size elements */
};
struct JSObject {
@ -5015,7 +5015,7 @@ typedef struct JSCFunctionDataRecord {
uint8_t length;
uint8_t data_len;
uint16_t magic;
JSValue data[0];
JSValue data[];
} JSCFunctionDataRecord;
static void js_c_function_data_finalizer(JSRuntime *rt, JSValue val)
@ -27371,7 +27371,7 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
JSReqModuleEntry *rme = &m->req_module_entries[i];
m1 = rme->module;
index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
if (index < 0)
if (index < 0)
return -1;
assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||