From 0ee0ad23de05bc3ea41720b5a260bc654a478e7d Mon Sep 17 00:00:00 2001 From: Basile Clement Date: Mon, 10 Jun 2019 13:57:22 +0200 Subject: Don't use GNU extension for binary numbers The dithering code (specifically `dither_factor_bayer_8`) uses a GNU extension for binary notation, eg 0b001. This is not supported by MSVC (at least) and breaks the build on this platform [1]. This patches uses hexadecimal notation instead, fixing the build. [1]: https://lists.freedesktop.org/archives/pixman/2019-June/004883.html Reviewed-by: Matt Turner --- pixman/pixman-bits-image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pixman/pixman-bits-image.c b/pixman/pixman-bits-image.c index eb8794a..1ecbe54 100644 --- a/pixman/pixman-bits-image.c +++ b/pixman/pixman-bits-image.c @@ -1066,9 +1066,9 @@ dither_factor_bayer_8 (int x, int y) /* Compute reverse(interleave(xor(x mod n, y mod n), x mod n)) * Here n = 8 and `mod n` is the bottom 3 bits. */ - m = ((y & 0b001) << 5) | ((x & 0b001) << 4) | - ((y & 0b010) << 2) | ((x & 0b010) << 1) | - ((y & 0b100) >> 1) | ((x & 0b100) >> 2); + m = ((y & 0x1) << 5) | ((x & 0x1) << 4) | + ((y & 0x2) << 2) | ((x & 0x2) << 1) | + ((y & 0x4) >> 1) | ((x & 0x4) >> 2); /* m is in range [0, 63]. We scale it to [0, 63.0f/64.0f], then * shift it to to [1.0f/128.0f, 127.0f/128.0f] so that 0 < d < 1. -- cgit v1.2.1