~mcf/cproc

673a92cead5dbc453a2234baffafb250cc1f41b6 — Michael Forney 2 months ago 9871958
decl: Simplify struct size calculation
1 files changed, 2 insertions(+), 3 deletions(-)

M decl.c
M decl.c => decl.c +2 -3
@@ 698,10 698,9 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, un
				error(&tok.loc, "specified alignment of struct member is less strict than is required by type");
			align = mt.type->align;
		}
		t->size = ALIGNUP(t->size, align);
		if (t->kind == TYPESTRUCT) {
			m->offset = t->size;
			t->size += mt.type->size;
			m->offset = ALIGNUP(t->size, align);
			t->size = m->offset + mt.type->size;
		} else {
			m->offset = 0;
			if (t->size < mt.type->size)