Skip to content

Commit 12a4e7a

Browse files
authored
cgen: fix type_to_fmt() for i64 and u32 (#8954)
1 parent 57d1b5b commit 12a4e7a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vlib/v/gen/c/auto_str_methods.v

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ fn (g &Gen) type_to_fmt(typ table.Type) string {
4848
return "'%.*s\\000'"
4949
} else if sym.kind in [.f32, .f64] {
5050
return '%g\\000' // g removes trailing zeros unlike %f
51+
} else if sym.kind == .u32 {
52+
return '%u\\000'
5153
} else if sym.kind == .u64 {
54+
return '%llu\\000'
55+
} else if sym.kind == .i64 {
5256
return '%lld\\000'
5357
}
5458
return '%d\\000'

0 commit comments

Comments
 (0)