diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-03-03 15:04:36 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-03-03 15:04:36 -0500 |
| commit | ea7fcd85b40dd943e593d823827be7cdf4a972b0 (patch) | |
| tree | ca2b6b8157b9d02971610515ddbee99aa1bd3866 /structs.c | |
| parent | 5641d0c837985ba7f89d5efdc5e9c1873c403a57 (diff) | |
Make load method be "use$name"
Diffstat (limited to 'structs.c')
| -rw-r--r-- | structs.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |
