From 6583fe9b389a6b4698f9364945885e6783506886 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Oct 2025 12:43:00 -0400 Subject: Convert to using more zero values for `none` --- src/environment.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/environment.c') diff --git a/src/environment.c b/src/environment.c index c29aa29d..3f07787e 100644 --- a/src/environment.c +++ b/src/environment.c @@ -405,7 +405,7 @@ env_t *global_env(bool source_mapping) { binding_t *type_binding = Table$str_get(*env->globals, global_types[i].name); assert(type_binding); env_t *ns_env = Match(type_binding->type, TypeInfoType)->env; - for (int64_t j = 0; j < global_types[i].namespace.length; j++) { + for (int64_t j = 0; j < (int64_t)global_types[i].namespace.length; j++) { ns_entry_t *entry = global_types[i].namespace.data + j * global_types[i].namespace.stride; type_t *type = parse_type_string(ns_env, entry->type_str); if (!type) compiler_err(NULL, NULL, NULL, "Couldn't parse type string: ", entry->type_str); @@ -715,14 +715,14 @@ PUREFUNC binding_t *get_constructor(env_t *env, type_t *t, arg_ast_t *args, bool List_t constructors = type_env->namespace->constructors; // Prioritize exact matches: call_opts_t options = {.promotion = false, .underscores = allow_underscores}; - for (int64_t i = constructors.length - 1; i >= 0; i--) { + for (int64_t i = (int64_t)constructors.length - 1; i >= 0; i--) { binding_t *constructor = constructors.data + i * constructors.stride; DeclareMatch(fn, constructor->type, FunctionType); if (type_eq(fn->ret, t) && is_valid_call(env, fn->args, args, options)) return constructor; } // Fall back to promotion: options.promotion = true; - for (int64_t i = constructors.length - 1; i >= 0; i--) { + for (int64_t i = (int64_t)constructors.length - 1; i >= 0; i--) { binding_t *constructor = constructors.data + i * constructors.stride; DeclareMatch(fn, constructor->type, FunctionType); if (type_eq(fn->ret, t) && is_valid_call(env, fn->args, args, options)) return constructor; -- cgit v1.2.3