diff --git a/vlib/v/gen/c/auto_eq_methods.v b/vlib/v/gen/c/auto_eq_methods.v index 4009e86ee7..bcd87cac85 100644 --- a/vlib/v/gen/c/auto_eq_methods.v +++ b/vlib/v/gen/c/auto_eq_methods.v @@ -628,7 +628,7 @@ fn (mut g Gen) gen_interface_equality_fn(left_type ast.Type) string { fn_builder.writeln('${g.static_non_parallel}inline bool ${fn_name}_interface_eq(${ptr_styp} a, ${ptr_styp} b) {') fn_builder.writeln('\tif (${left_arg} == ${right_arg}) {') - fn_builder.writeln('\t\tint idx = v_typeof_interface_idx_${idx_fn}(${left_arg});') + fn_builder.writeln('\t\tu32 idx = v_typeof_interface_idx_${idx_fn}(${left_arg});') if info is ast.Interface { for typ in info.types { sym := g.table.sym(typ.set_nr_muls(0)) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index b615c06ca5..fdb4625221 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -1918,7 +1918,7 @@ pub fn (mut g Gen) write_interface_typesymbol_declaration(sym ast.TypeSymbol) { g.type_definitions.writeln('\t\t${vcname}* _${vcname};') } g.type_definitions.writeln('\t};') - g.type_definitions.writeln('\tint _typ;') + g.type_definitions.writeln('\tu32 _typ;') for field in info.fields { styp := g.styp(field.typ) cname := c_name(field.name) @@ -6975,7 +6975,7 @@ fn (mut g Gen) write_types(symbols []&ast.TypeSymbol) { g.type_definitions.writeln('\t\t${var_type} _${variant_name};') } g.type_definitions.writeln('\t};') - g.type_definitions.writeln('\tint _typ;') + g.type_definitions.writeln('\tu32 _typ;') if sym.info.fields.len > 0 { g.writeln('\t// pointers to common sumtype fields') for field in sym.info.fields {