cgen: fix u64 in struct str()

pull/6163/head
Alexander Medvednikov 2020-08-18 16:05:11 +02:00
parent 7727aad90f
commit 51bd69cdd8
1 changed files with 2 additions and 0 deletions

View File

@ -4695,6 +4695,8 @@ fn (g &Gen) type_to_fmt(typ table.Type) string {
return '%.*s\\000'
} else if typ in [table.f32_type, table.f64_type] {
return '%g\\000' // g removes trailing zeros unlike %f
} else if typ == table.u64_type {
return '%lld\\000'
}
return '%d\\000'
}