[Pixman] Strange looking text in 'dither_factor_bayer_8'
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jun 6 15:49:12 UTC 2019
Op 06-06-2019 om 16:41 schreef John Emmas:
> MSVC is complaining about a new function called 'dither_factor_bayer_8' (in pixman/pixman-bits-image.c). The relevant code looks like this:-
>
> m = ((y & 0b001) << 5) | ((x & 0b001) << 4) |
> ((y & 0b010) << 2) | ((x & 0b010) << 1) |
> ((y & 0b100) >> 1) | ((x & 0b100) >> 2);
>
> It's complaining about the symbols like '0b001' and '0b100' etc. Are these intended to be hex numbers? In other words, should the code have looked like this?
>
> m = ((y & 0xb001) << 5) | ((x & 0xb001) << 4) |
> ((y & 0xb010) << 2) | ((x & 0xb010) << 1) |
> ((y & 0xb100) >> 1) | ((x & 0xb100) >> 2);
>
> Or are they maybe some other numerical format? Thanks,
They're binary.
https://gcc.gnu.org/onlinedocs/gcc/Binary-constants.html
More information about the Pixman
mailing list