From c4d2d287fc0eac7348951ce275a1f3d80f25ef3d Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 17 Feb 2018 11:54:08 +0000 Subject: #complete switch; Removal of dyncall --- src/types.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 2dcd05361..dadbe0a62 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -126,8 +126,7 @@ struct TypeStruct { }) \ TYPE_KIND(Struct, TypeStruct) \ TYPE_KIND(Enum, struct { \ - Entity **fields; \ - i32 field_count; \ + Array fields; \ AstNode *node; \ Scope * scope; \ Entity * names; \ @@ -1657,7 +1656,7 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n } } - for (isize i = 0; i < type->Enum.field_count; i++) { + for_array(i, type->Enum.fields) { Entity *f = type->Enum.fields[i]; GB_ASSERT(f->kind == Entity_Constant); String str = f->token.string; @@ -2330,7 +2329,7 @@ gbString write_type_to_string(gbString str, Type *type) { str = write_type_to_string(str, type->Enum.base_type); } str = gb_string_appendc(str, " {"); - for (isize i = 0; i < type->Enum.field_count; i++) { + for_array(i, type->Enum.fields) { Entity *f = type->Enum.fields[i]; GB_ASSERT(f->kind == Entity_Constant); if (i > 0) { -- cgit v1.2.3