summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-19 15:03:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-19 15:03:12 -0700
commitd2aa4101df1d3b3260ce0057cf8bc1ae7337d49b (patch)
tree88776dc2457cae24be3bf73ea48d1e10bc3d387b
parentd151476e95942f5bc0b42367f083c89594ef032f (diff)
downloadtxr-d2aa4101df1d3b3260ce0057cf8bc1ae7337d49b.tar.gz
txr-d2aa4101df1d3b3260ce0057cf8bc1ae7337d49b.tar.bz2
txr-d2aa4101df1d3b3260ce0057cf8bc1ae7337d49b.zip
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.
-rw-r--r--struct.c2
-rw-r--r--vm.c2
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;