From d2aa4101df1d3b3260ce0057cf8bc1ae7337d49b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 19 Sep 2021 15:03:12 -0700 Subject: vm, structs: use FLEX_ARRAY macro. * vm.c (struct vm_closure): Use the FLEX_ARRAY macro to define the trailing array at the end of the structure instead of hard-coding [1]. * struct.c (struct struct_inst): Likewise. --- struct.c | 2 +- vm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/struct.c b/struct.c index 992f51bb..fccd0928 100644 --- a/struct.c +++ b/struct.c @@ -100,7 +100,7 @@ struct struct_inst { cnum id : sizeof (cnum) * CHAR_BIT - TAG_SHIFT; unsigned lazy : 1; unsigned dirty : 1; - val slot[1]; + val slot[FLEX_ARRAY]; }; val struct_type_s, meth_s, print_s, make_struct_lit_s; diff --git a/vm.c b/vm.c index bfce175c..399bef19 100644 --- a/vm.c +++ b/vm.c @@ -95,7 +95,7 @@ struct vm_closure { int nreg; int nlvl; unsigned ip; - struct vm_env dspl[1]; + struct vm_env dspl[FLEX_ARRAY]; }; val vm_desc_s, vm_closure_s; -- cgit v1.2.3