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:
parent
29532177c1
commit
ffcfeb919f
1 changed files with 7 additions and 2 deletions
Loading…
Add table
Add a link
Reference in a new issue