From f19bb0f4d45ba4352c4392807ca2b1efe5918ea7 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 8 Jun 2021 14:33:49 +0100 Subject: Make default calling convention code more correct to read --- src/check_decl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 323de6d43..1a87b57b8 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -648,7 +648,7 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { if (d->gen_proc_type != nullptr) { proc_type = d->gen_proc_type; } else { - proc_type = alloc_type_proc(e->scope, nullptr, 0, nullptr, 0, false, ProcCC_Odin); + proc_type = alloc_type_proc(e->scope, nullptr, 0, nullptr, 0, false, default_calling_convention()); } e->type = proc_type; ast_node(pl, ProcLit, d->proc_lit); @@ -746,10 +746,10 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { error(e->token, "Procedure type of 'main' was expected to be 'proc()', got %s", str); gb_string_free(str); } - if (pt->calling_convention != ProcCC_Odin) { + if (pt->calling_convention != default_calling_convention()) { error(e->token, "Procedure 'main' cannot have a custom calling convention"); } - pt->calling_convention = ProcCC_Odin; + pt->calling_convention = default_calling_convention(); if (e->pkg->kind == Package_Init) { if (ctx->info->entry_point != nullptr) { error(e->token, "Redeclaration of the entry pointer procedure 'main'"); -- cgit v1.2.3