summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Antti K2014-07-29 17:14:53 +0200
committerGravatar Antti K2014-07-29 20:35:36 +0200
commit66d5bb2c84cd9f92eb146a8496bda4c9c9b0f0ce (patch)
treecc33e46f01fc6bc0a81255ef667ee5c7931ec269
parent3c853a405b522cb8ce50414f47c944f8ee5c5854 (diff)
downloadxkbcat-66d5bb2c84cd9f92eb146a8496bda4c9c9b0f0ce.tar.gz
xkbcat-66d5bb2c84cd9f92eb146a8496bda4c9c9b0f0ce.zip
Convert BIT macro to inlined function
Inlined just like a macro, but has typechecking to prevent bloopers.
-rw-r--r--xkbcat.c4
1 files changed, 3 insertions, 1 deletions
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 */