diff options
author | Luo Jinghua <sunmoon1997@gmail.com> | 2008-11-28 07:54:41 +0800 |
---|---|---|
committer | Luo Jinghua <sunmoon1997@gmail.com> | 2008-11-28 07:54:41 +0800 |
commit | ed6bd4766cb47e97b1a6ecb81eff5bf4673d549b (patch) | |
tree | 873025b1f48ab9b3aace3716fc0cb6cfc4bb8aa9 | |
parent | 41cb91d417e7c0dc1cc767ea0fb38a1f8b3f4e43 (diff) |
image: Use unsigned long to compute color masks.
Use unsigned long in the first place to prevent compiler from
expanding signed bit to all upper bits. e.g, a alpha mask 0xff0000
will expand to 0xffffffffff00000 on 64 bit platform which is not
what we expected.
-rw-r--r-- | src/cairo-image-surface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 234a6f90..b7a4f6cf 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -203,7 +203,7 @@ _pixman_format_from_masks (cairo_format_masks_t *masks, } /* A mask consisting of N bits set to 1. */ -#define MASK(N) ((1 << (N))-1) +#define MASK(N) ((1UL << (N))-1) void _pixman_format_to_masks (pixman_format_code_t format, |