From 66d5bb2c84cd9f92eb146a8496bda4c9c9b0f0ce Mon Sep 17 00:00:00 2001 From: Antti K Date: Tue, 29 Jul 2014 17:14:53 +0200 Subject: Convert BIT macro to inlined function Inlined just like a macro, but has typechecking to prevent bloopers. --- xkbcat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xkbcat.c b/xkbcat.c index 3cd1869..9a14a65 100644 --- a/xkbcat.c +++ b/xkbcat.c @@ -23,7 +23,9 @@ char *DEFAULT_DISPLAY = ":0"; const int DEFAULT_DELAY = 10000; -#define BIT(c, x) ( c[x/8]& (1<<(x%8)) ) +static inline int BIT(char *c, int x) { + return ( c[x/8]& (1<<(x%8)) ); +} const int KEYSYM_STRLEN = 64; /* Globals */ -- cgit v1.3-2-g0d8e