diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-06-03 07:53:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-06-03 07:53:55 -0700 |
commit | 7f6250b71838ffd3ac07d479e7bdb65c351f8fc9 (patch) | |
tree | 41b461d8f874c1ba8785b06623b96b3b04e75ed1 | |
parent | fe38ddebf874a95984770ac51610173f9a58bdf3 (diff) | |
download | txr-7f6250b71838ffd3ac07d479e7bdb65c351f8fc9.tar.gz txr-7f6250b71838ffd3ac07d479e7bdb65c351f8fc9.tar.bz2 txr-7f6250b71838ffd3ac07d479e7bdb65c351f8fc9.zip |
gc: fix bad c++ casts.
This C++ regression snuck into in Version 286; I didn't
check C++ compilation.
* lib.h (container): Macro must use coerce not
convert because mem_t * isn't void *.
* gc.c (gc_prot_array_alloc): Likewise.
-rw-r--r-- | gc.c | 8 | ||||
-rw-r--r-- | lib.h | 4 |
2 files changed, 6 insertions, 6 deletions
@@ -1323,11 +1323,11 @@ static struct cobj_ops prot_array_ops = cobj_ops_init(eq, val *gc_prot_array_alloc(cnum size) { - struct prot_array *pa = convert(struct prot_array *, - chk_calloc(offsetof(struct prot_array, arr) + - size * sizeof(val), 1)); + struct prot_array *pa = coerce(struct prot_array *, + chk_calloc(offsetof(struct prot_array, arr) + + size * sizeof(val), 1)); pa->size = size; - pa->self = cobj(convert(mem_t *, pa), prot_array_cls, &prot_array_ops); + pa->self = cobj(coerce(mem_t *, pa), prot_array_cls, &prot_array_ops); return pa->arr; } @@ -47,8 +47,8 @@ typedef double_uintptr_t dbl_ucnum; #endif #define container(PTR, TYPE, MEMB) \ - convert(TYPE *, \ - convert(mem_t *, (PTR)) - offsetof(TYPE, MEMB)) + coerce(TYPE *, \ + coerce(mem_t *, (PTR)) - offsetof(TYPE, MEMB)) #if __STDC_VERSION__ >= 199901L #define FLEX_ARRAY |