aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-02-17 11:54:08 +0000
committergingerBill <bill@gingerbill.org>2018-02-17 11:54:08 +0000
commitc4d2d287fc0eac7348951ce275a1f3d80f25ef3d (patch)
treee082b0f1d744689ced0cdab73dd405981cacbf3a /src/types.cpp
parent6a85546b761b67fa012a2cd49e32b2211bf02971 (diff)
#complete switch; Removal of dyncall
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp7
1 files changed, 3 insertions, 4 deletions
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<Entity *> 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) {