summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-01 23:02:48 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2014-01-01 23:02:48 -0800
commitd0911d130b870da0951b56f5103c6b4dfb9eeb28 (patch)
treec7f04d6e168ae2e667c9e3da3e36a2b8753fcefc
parente3fe79502a4a1b0f0b148659948d541ce26ed7bf (diff)
Use '& 7' instead '% 8' to silence clang analyzer warning
Graphics.c:569:10: warning: The result of the '<<' expression is undefined while (!QueryFlood(BW, x, y, value) && (x < x_right)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Graphics.c:470:7: note: expanded from macro 'QueryFlood' ((GetBit(BW->bitmap.image, x, y) !=\ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Graphics.c:66:9: note: expanded from macro 'GetBit' (1 << ((x) % 8))) ? 1 : 0)) ~~^~~~~~~~~~~~ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--Graphics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Graphics.c b/Graphics.c
index 39fea11..e8e7897 100644
--- a/Graphics.c
+++ b/Graphics.c
@@ -69,7 +69,7 @@ from The Open Group.
#define GetBit(image, x, y)\
((bit)((*(image->data + (x) / 8 + (y) * image->bytes_per_line) &\
- (1 << ((x) % 8))) ? 1 : 0))
+ (1 << ((x) & 7))) ? 1 : 0))
#if 0
bit