diff options
Diffstat (limited to 'src/checker/decl.cpp')
| -rw-r--r-- | src/checker/decl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/checker/decl.cpp b/src/checker/decl.cpp index 37a832b9a..79b712522 100644 --- a/src/checker/decl.cpp +++ b/src/checker/decl.cpp @@ -68,11 +68,11 @@ void check_init_variables(Checker *c, Entity **lhs, isize lhs_count, AstNodeArra // NOTE(bill): If there is a bad syntax error, rhs > lhs which would mean there would need to be // an extra allocation - Array<Operand> operands; - array_init(&operands, c->tmp_allocator, 2*lhs_count); + Array(Operand) operands; + array_init_reserve(&operands, c->tmp_allocator, 2*lhs_count); for_array(i, inits) { - AstNode *rhs = inits[i]; + AstNode *rhs = inits.e[i]; Operand o = {}; check_multi_expr(c, &o, rhs); if (o.type->kind != Type_Tuple) { @@ -88,7 +88,7 @@ void check_init_variables(Checker *c, Entity **lhs, isize lhs_count, AstNodeArra isize rhs_count = operands.count; for_array(i, operands) { - if (operands[i].mode == Addressing_Invalid) { + if (operands.e[i].mode == Addressing_Invalid) { rhs_count--; } } @@ -96,7 +96,7 @@ void check_init_variables(Checker *c, Entity **lhs, isize lhs_count, AstNodeArra isize max = gb_min(lhs_count, rhs_count); for (isize i = 0; i < max; i++) { - check_init_variable(c, lhs[i], &operands[i], context_name); + check_init_variable(c, lhs[i], &operands.e[i], context_name); } if (rhs_count > 0 && lhs_count != rhs_count) { @@ -161,7 +161,7 @@ void check_var_decl_node(Checker *c, AstNode *node) { Entity **entities = gb_alloc_array(c->allocator, Entity *, entity_count); for_array(i, vd->names) { - AstNode *name = vd->names[i]; + AstNode *name = vd->names.e[i]; Entity *entity = NULL; if (name->kind == AstNode_Ident) { Token token = name->Ident; @@ -215,7 +215,7 @@ void check_var_decl_node(Checker *c, AstNode *node) { for_array(i, vd->names) { if (entities[i] != NULL) { - add_entity(c, c->context.scope, vd->names[i], entities[i]); + add_entity(c, c->context.scope, vd->names.e[i], entities[i]); } } @@ -496,7 +496,7 @@ void check_var_decl(Checker *c, Entity *e, Entity **entities, isize entity_count } AstNodeArray inits; - array_init(&inits, c->allocator, 1); + array_init_reserve(&inits, c->allocator, 1); array_add(&inits, init_expr); check_init_variables(c, entities, entity_count, inits, str_lit("variable declaration")); } @@ -523,7 +523,7 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod Scope **found = map_get(&c->info.scopes, hash_pointer(t->Record.node)); GB_ASSERT(found != NULL); for_array(i, (*found)->elements.entries) { - Entity *f = (*found)->elements.entries[i].value; + Entity *f = (*found)->elements.entries.e[i].value; if (f->kind == Entity_Variable) { Entity *uvar = make_entity_using_variable(c->allocator, e, f->token, f->type); Entity *prev = scope_insert_entity(c->context.scope, uvar); |