chiark / gitweb /
hostside: hidrawconv: rename various variables and functions to be more sensible...
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 20 Feb 2011 14:09:07 +0000 (14:09 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 20 Feb 2011 14:09:07 +0000 (14:09 +0000)
hostside/hidrawconv-joytechneos.c
hostside/hidrawconv.c
hostside/hidrawconv.h

index adeb086191038b0b26dbf33cf7b3edded17cd8b3..bc000d714b5edd730a27d106b639fb5a20441427 100644 (file)
@@ -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]= {
index 9a298b5e866c46c2511f2d874e51bdd3b59567d7..622e2ce7e73de66af38b67788f17e6cd17219a1a 100644 (file)
@@ -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);
   })
 
 
index 3887537e89083ed54083f1f6e894c682ad075431..8bf12be9961429b4de2e167ca76c8b0f51894f75 100644 (file)
@@ -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*/