From 3fbf9a1eb2effb962b3ed872c4cb5f6d7128360c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 20 Feb 2011 14:09:07 +0000 Subject: [PATCH] hostside: hidrawconv: rename various variables and functions to be more sensible and consistent --- hostside/hidrawconv-joytechneos.c | 2 +- hostside/hidrawconv.c | 12 ++++++------ hostside/hidrawconv.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hostside/hidrawconv-joytechneos.c b/hostside/hidrawconv-joytechneos.c index adeb086..bc000d7 100644 --- a/hostside/hidrawconv-joytechneos.c +++ b/hostside/hidrawconv-joytechneos.c @@ -26,7 +26,7 @@ static const ValLoc vallocs[]= { static void pr(const uint8_t *msg, int msglen, const uint8_t *last) { reportbits(msg, last, msglen, keybits); - reportlocs(msg, last, msglen, vallocs); + reportvals(msg, last, msglen, vallocs); } ProcessReport *const nested_processors[MAXREPORTS]= { diff --git a/hostside/hidrawconv.c b/hostside/hidrawconv.c index 9a298b5..622e2ce 100644 --- a/hostside/hidrawconv.c +++ b/hostside/hidrawconv.c @@ -68,12 +68,12 @@ DEFINE_STANDARD_REPORTER(KeyBit, bit, { printf("%s %d\n", bit->str, !!mb); }) -DEFINE_STANDARD_REPORTER(ValLoc, loc, { - mb >>= loc->rshift; - mb -= loc->zero; - double val= (int8_t)mb; - val /= (val >= 0 ? 127 : 128); - printf("%s %.5f\n", loc->str, loc->sign * val); +DEFINE_STANDARD_REPORTER(ValLoc, val, { + mb >>= val->rshift; + mb -= val->zero; + double v= (int8_t)mb; + v /= (v >= 0 ? 127 : 128); + printf("%s %.5f\n", val->str, val->sign * v); }) diff --git a/hostside/hidrawconv.h b/hostside/hidrawconv.h index 3887537..8bf12be 100644 --- a/hostside/hidrawconv.h +++ b/hostside/hidrawconv.h @@ -36,7 +36,7 @@ typedef struct { } KeyBit; void reportbits(const uint8_t msg[], const uint8_t last[], - int len, const KeyBit bits[]); + int len, const KeyBit keybits[]); typedef struct { @@ -45,8 +45,8 @@ typedef struct { uint8_t mask, zero; } ValLoc; -void reportlocs(const uint8_t msg[], const uint8_t last[], - int len, const ValLoc locs[]); +void reportvals(const uint8_t msg[], const uint8_t last[], + int len, const ValLoc vallocs[]); #endif /*HIDRAWCONV_H*/ -- 2.30.2