diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-12 16:49:33 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-12 17:04:25 -0800 |
commit | 79d09647d878e66721a778979a9eb1f4bba5f8d6 (patch) | |
tree | 870602e147096eb9f745663b1453538ba4988df2 /include | |
parent | 99dfe9b1de09cb481e95bd4c45dcf7493480798b (diff) |
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 <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/inputstr.h | 2 |
1 files changed, 1 insertions, 1 deletions
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); |