From c56290f726cb1cf9b88e5e0d4a35d0673b41e27c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 29 Aug 2025 21:59:03 +0900 Subject: refactor: add stricter types --- src/parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/parse.c') diff --git a/src/parse.c b/src/parse.c index 381d7e1..b33c180 100644 --- a/src/parse.c +++ b/src/parse.c @@ -209,7 +209,7 @@ static Token* expect(Parser* p, TokenKind expected) { } static int find_lvar_in_scope(Parser* p, Scope* scope, const char* name) { - for (int i = 0; i < scope->syms.len; ++i) { + for (size_t i = 0; i < scope->syms.len; ++i) { ScopedSymbol* sym = &scope->syms.data[i]; if (sym->name && strcmp(sym->name, name) == 0) { return sym->index; @@ -277,7 +277,7 @@ static AstNode* generate_temporary_lvar(Parser* p, Type* ty) { } static int find_gvar(Parser* p, const char* name) { - for (int i = 0; i < p->gvars.len; ++i) { + for (size_t i = 0; i < p->gvars.len; ++i) { if (strcmp(p->gvars.data[i].name, name) == 0) { return i; } @@ -286,7 +286,7 @@ static int find_gvar(Parser* p, const char* name) { } static int find_func(Parser* p, const char* name) { - for (int i = 0; i < p->funcs.len; ++i) { + for (size_t i = 0; i < p->funcs.len; ++i) { if (strcmp(p->funcs.data[i].name, name) == 0) { return i; } -- cgit v1.2.3-70-g09d2