authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-22 22:33:16-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-22 22:33:16-07:00
log0b28133ec239d62fc0df7460ac8b8e12b08ee88f
tree8ba7b3041a54914eaa697e6e80f1dbc087c8de11
parent5453ec86eb3e9209f825d27c5b1693f0bc850286

zig.h: avoid binary literals

gcc -pedantic complains about these

1 files changed, 2 insertions(+), 4 deletions(-)

lib/zig.h+2-4
......@@ -846,10 +846,8 @@ static inline zig_u8 zig_bit_reverse_u8(zig_u8 val, zig_u8 bits) {
846846 full_res = __builtin_bitreverse8(val);
847847#else
848848 static zig_u8 const lut[0x10] = {
849 0b0000, 0b1000, 0b0100, 0b1100,
850 0b0010, 0b1010, 0b0110, 0b1110,
851 0b0001, 0b1001, 0b0101, 0b1101,
852 0b0011, 0b1011, 0b0111, 0b1111,
849 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,
850 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
853851 };
854852 full_res = lut[val >> 0 & 0xF] << 4 | lut[val >> 4 & 0xF] << 0;
855853#endif