0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

Fix std.fmt.hex() to work with unsigned ints of all multiples of 8 bits

@SizeOf(@typeInfo(T)) for any u{n} seems to give sizes of u32, u64, u128
and so on, depending on what size x fits into.  This causes problems with
'>>' if x isn't exactly one of those sizes.

@typeInfo(@TypeOf(x)).int.bits gives a more accurate size.
This commit is contained in:
Richard Levitte 2026-04-16 04:53:07 +02:00 • committed by Andrew Kelley
commit ffcfeb919f