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

pull/8959/head
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
1 changed files with 4 additions and 0 deletions

View File

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