diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-29 21:59:03 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-29 21:59:25 +0900 |
| commit | c56290f726cb1cf9b88e5e0d4a35d0673b41e27c (patch) | |
| tree | ac65b8d2fd2c4c9e8954b7266badd9d860c98c0c /src/parse.c | |
| parent | 3244eb68cb12aacb5f262223d2c7b01e5f638e59 (diff) | |
| download | ducc-c56290f726cb1cf9b88e5e0d4a35d0673b41e27c.tar.gz ducc-c56290f726cb1cf9b88e5e0d4a35d0673b41e27c.tar.zst ducc-c56290f726cb1cf9b88e5e0d4a35d0673b41e27c.zip | |
refactor: add stricter types
Diffstat (limited to 'src/parse.c')
| -rw-r--r-- | src/parse.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |
