From: Jérémie Astor Date: Tue, 5 May 2020 12:46:00 +0000 (+0200) Subject: :art: Improve gwi_struct_ini X-Git-Tag: nightly~1679 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=97d9a60ab2cb123f7aa814cc08982b2775b20bdd;p=gwion.git :art: Improve gwi_struct_ini --- diff --git a/include/import/cdef.h b/include/import/cdef.h index d4bdd968..25722edc 100644 --- a/include/import/cdef.h +++ b/include/import/cdef.h @@ -1,7 +1,7 @@ #ifndef __IMPORT_CLASS #define __IMPORT_CLASS ANN2(1,2) Type gwi_class_ini(const Gwi gwi, const m_str, const m_str parent); -ANN2(1,2) Type gwi_struct_ini(const Gwi gwi, const m_str, const m_uint size); +ANN2(1,2) Type gwi_struct_ini(const Gwi gwi, const m_str); ANN2(1) void gwi_class_xtor(const Gwi gwi, const f_xtor ctor, const f_xtor dtor); ANN m_int gwi_class_end(const Gwi gwi); ANN void inherit(const Type); diff --git a/src/import/cdef.c b/src/import/cdef.c index 60a3e5bc..8ba8d81b 100644 --- a/src/import/cdef.c +++ b/src/import/cdef.c @@ -104,10 +104,10 @@ ANN2(1,2) Type gwi_class_ini(const Gwi gwi, const m_str name, const m_str parent return type_finish(gwi, t); } -ANN Type gwi_struct_ini(const Gwi gwi, const m_str name, const m_uint size) { +ANN Type gwi_struct_ini(const Gwi gwi, const m_str name) { CHECK_OO(str2sym(gwi, name)) const Type t = new_type(gwi->gwion->mp, ++gwi->gwion->env->scope->type_xid, name, NULL); - t->size = size; + t->e->tuple = new_tupleform(gwi->gwion->mp, NULL); gwi_type_flag(t); SET_FLAG(t, struct); return type_finish(gwi, t);