aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-22 22:33:16 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-11-22 22:33:16 -0700
commit0b28133ec239d62fc0df7460ac8b8e12b08ee88f (patch)
tree8ba7b3041a54914eaa697e6e80f1dbc087c8de11
parent5453ec86eb3e9209f825d27c5b1693f0bc850286 (diff)
downloadzig-0b28133ec239d62fc0df7460ac8b8e12b08ee88f.tar.gz
zig-0b28133ec239d62fc0df7460ac8b8e12b08ee88f.zip
zig.h: avoid binary literals
gcc -pedantic complains about these
-rw-r--r--lib/zig.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/zig.h b/lib/zig.h
index b8a8936839..41b0fc3e00 100644
--- a/lib/zig.h
+++ b/lib/zig.h
@@ -846,10 +846,8 @@ static inline zig_u8 zig_bit_reverse_u8(zig_u8 val, zig_u8 bits) {
full_res = __builtin_bitreverse8(val);
#else
static zig_u8 const lut[0x10] = {
- 0b0000, 0b1000, 0b0100, 0b1100,
- 0b0010, 0b1010, 0b0110, 0b1110,
- 0b0001, 0b1001, 0b0101, 0b1101,
- 0b0011, 0b1011, 0b0111, 0b1111,
+ 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,
+ 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
};
full_res = lut[val >> 0 & 0xF] << 4 | lut[val >> 4 & 0xF] << 0;
#endif