From 79d09647d878e66721a778979a9eb1f4bba5f8d6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 12 Dec 2011 16:49:33 -0800 Subject: Use const cast in BitIsOn macro to avoid angering gcc Fixes gcc warnings such as: inpututils.c: In function 'valuator_mask_isset': inpututils.c:498:5: warning: cast discards qualifiers from pointer target type inpututils.c: In function 'CountBits': inpututils.c:613:9: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith Reviewed-by: Jamey Sharp Reviewed-by: Peter Hutterer --- include/inputstr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/inputstr.h b/include/inputstr.h index 5634f3cfc..6af7264c3 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -57,7 +57,7 @@ SOFTWARE. #include "geext.h" #include "privates.h" -#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) +#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) #define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) #define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) extern _X_EXPORT int CountBits(const uint8_t *mask, int len); -- cgit v1.2.3