From d0911d130b870da0951b56f5103c6b4dfb9eeb28 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Sequoia Date: Wed, 1 Jan 2014 23:02:48 -0800 Subject: 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 --- Graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3