aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:09:42 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:41:39 +0200
commitf02210172efc6bfc05c4598c14e1268d2828097e (patch)
tree00457552d4fe048b17b4a73d58d17c9db63552f8 /src/test.c
parent1e37ed517ef0906767a230ab384b8e66869cf4b2 (diff)
downloadxorg-input-kobomultitouch-f02210172efc6bfc05c4598c14e1268d2828097e.tar.gz
xorg-input-kobomultitouch-f02210172efc6bfc05c4598c14e1268d2828097e.tar.bz2
xorg-input-kobomultitouch-f02210172efc6bfc05c4598c14e1268d2828097e.zip
Simplify bit bookkeeping
In preparation of adding several additional finger bit registers, remove the redundant bit-counting variables and introduce fast bit-traversal functions instead. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/test.c')
-rw-r--r--src/test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test.c b/src/test.c
index e9b8ce3..fc16201 100644
--- a/src/test.c
+++ b/src/test.c
@@ -19,10 +19,23 @@
*
**************************************************************************/
+#include "common.h"
#include <stdio.h>
#include <time.h>
+static void print_bitfield(unsigned m)
+{
+ int i;
+
+ printf("%d\n", m);
+ foreach_bit(i, m)
+ printf("%d %d\n", i, 1 << i);
+}
+
int main(int argc, char *argv[])
{
+ print_bitfield(5);
+ print_bitfield(126);
+ print_bitfield(0);
return 0;
}