From ea7fcd85b40dd943e593d823827be7cdf4a972b0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 3 Mar 2024 15:04:36 -0500 Subject: Make load method be "use$name" --- structs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'structs.c') diff --git a/structs.c b/structs.c index 5e297927..d13e6db7 100644 --- a/structs.c +++ b/structs.c @@ -61,6 +61,7 @@ static CORD compile_compare_method(env_t *env, ast_t *ast) auto def = Match(ast, StructDef); CORD cmp_func = CORD_all("static int ", def->name, "__compare(const ", def->name, "_t *x, const ", def->name, "_t *y, const TypeInfo *info) {\n" + "(void)info;\n", "int diff;\n"); for (arg_ast_t *field = def->fields; field; field = field->next) { type_t *field_type = get_arg_ast_type(env, field); @@ -86,7 +87,8 @@ static CORD compile_equals_method(env_t *env, ast_t *ast) { auto def = Match(ast, StructDef); CORD eq_func = CORD_all("static bool ", def->name, "__equal(const ", def->name, "_t *x, const ", def->name, - "_t *y, const TypeInfo *info) {\n"); + "_t *y, const TypeInfo *info) {\n" + "(void)info;\n"); for (arg_ast_t *field = def->fields; field; field = field->next) { type_t *field_type = parse_type_ast(env, field->type); switch (field_type->tag) { @@ -110,6 +112,7 @@ static CORD compile_hash_method(env_t *env, ast_t *ast) { auto def = Match(ast, StructDef); CORD hash_func = CORD_all("static uint32_t ", def->name, "__hash(const ", def->name, "_t *obj, const TypeInfo *info) {\n" + "(void)info;\n" "uint32_t field_hashes[] = {"); for (arg_ast_t *field = def->fields; field; field = field->next) { type_t *field_type = get_arg_ast_type(env, field); -- cgit v1.2.3