summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBasile Clement <basile-pixman@clement.pm>2019-06-10 13:57:22 +0200
committerMatt Turner <mattst88@gmail.com>2019-06-10 09:32:12 -0700
commit0ee0ad23de05bc3ea41720b5a260bc654a478e7d (patch)
tree7e998521a9a0eefe8565ad6c30f01034bb50fc6c
parentcb2ec4268fbde0df3b588ce5cbe2e43e04654520 (diff)
downloadpixman-0ee0ad23de05bc3ea41720b5a260bc654a478e7d.tar.gz
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 <mattst88@gmail.com>
-rw-r--r--pixman/pixman-bits-image.c6
1 files 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.