1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix type_to_fmt() for i64 and u32 (#8954)

This commit is contained in:
Uwe Krüger 2021-02-25 01:29:44 +01:00 committed by GitHub
parent 57d1b5b74d
commit 12a4e7ad90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,11 @@ fn (g &Gen) type_to_fmt(typ table.Type) string {
return "'%.*s\\000'"
} else if sym.kind in [.f32, .f64] {
return '%g\\000' // g removes trailing zeros unlike %f
} else if sym.kind == .u32 {
return '%u\\000'
} else if sym.kind == .u64 {
return '%llu\\000'
} else if sym.kind == .i64 {
return '%lld\\000'
}
return '%d\\000'