fix ub reported by gcc builds

This commit is contained in:
Ryan Fleury committed 2026-10-02 08:17:23 -07:00
1 parent f6b4a38134
commit 2db9ec1312
5 files changed
+7 -10

No files matched your search

+2 -2
View File
@@ -516,12 +516,12 @@ fnt_hash2style_from_tag_size_flags(FNT_Tag tag, F32 size, FNT_RasterFlags flags)
//- rjf: tag * size -> style hash
U64 style_hash = {0};
{
F64 size_f64 = size;
union { F64 size_f64; U64 size_u64; } size_pun = {.size_f64 = (F64)size};
U64 buffer[] =
{
tag.u64[0],
tag.u64[1],
*(U64 *)(&size_f64),
size_pun.size_u64,
(U64)flags,
};
style_hash = fnt_little_hash_from_string(5381, str8((U8 *)buffer, sizeof(buffer)));