diff --git a/client.c b/client.c index 32867f6..9716509 100644 --- a/client.c +++ b/client.c @@ -4,13 +4,11 @@ #include "util.h" #include -#include #include #include #include #include #include -#include #include #include #include @@ -20,6 +18,7 @@ #include #include #include +#include typedef struct { int fd; @@ -158,7 +157,7 @@ void device_handle_report(MessageDeviceReport *report) { } for (int i = 0; i < report->key_count; i++) { - if (device_emit(EV_KEY, device.info.key_id[i], (uint32_t)(!report->key[i]) - 1 ) != 0) + if (device_emit(EV_KEY, device.info.key_id[i], (uint32_t)(!report->key[i]) - 1) != 0) printf("CLIENT: Error writing key event to uinput\n"); } @@ -291,10 +290,10 @@ void client_run(char *address, uint16_t port) { if (msg_deserialize(buf, len, &message) != 0) { printf("CLIENT: Couldn't parse message (code: %d, len: %d)\n", buf[0], len); int l = len > 100 ? 100 : len; - for(int i = 0; i < l; i++) { + for (int i = 0; i < l; i++) { printf("%02x", buf[i]); } - if(len > 100) { + if (len > 100) { printf(" ... %d more bytes", len - 100); } printf("\n"); diff --git a/hid.c b/hid.c index b1468f8..dfac7f9 100644 --- a/hid.c +++ b/hid.c @@ -75,7 +75,7 @@ void setup_device(PhysicalDevice *dev) { if (i == EV_ABS) { struct input_absinfo abs; ioctl(dev->event, EVIOCGABS(j), &abs); - uint16_t index = dev->device_info.abs_count++; + uint16_t index = dev->device_info.abs_count++; dev->device_info.abs_id[index] = j; dev->device_info.abs_min[index] = abs.minimum; dev->device_info.abs_max[index] = abs.maximum; @@ -84,11 +84,11 @@ void setup_device(PhysicalDevice *dev) { dev->device_info.abs_res[index] = abs.resolution; dev->mapping.abs_indices[j] = index; } else if (i == EV_REL) { - uint16_t index = dev->device_info.rel_count++; + uint16_t index = dev->device_info.rel_count++; dev->device_info.rel_id[index] = j; dev->mapping.rel_indices[j] = index; } else if (i == EV_KEY) { - uint16_t index = dev->device_info.key_count++; + uint16_t index = dev->device_info.key_count++; dev->device_info.key_id[index] = j; dev->mapping.key_indices[j] = index; } diff --git a/hid.h b/hid.h index 348bd6e..dedf642 100644 --- a/hid.h +++ b/hid.h @@ -2,6 +2,7 @@ #ifndef HID_H #define HID_H #include "net.h" + #include #include diff --git a/net.h b/net.h index 2ebae6b..0982336 100644 --- a/net.h +++ b/net.h @@ -19,7 +19,7 @@ typedef struct { uint16_t rel_count; uint16_t key_count; - uint16_t abs_id[ABS_CNT]; + uint16_t abs_id[ABS_CNT]; uint32_t abs_min[ABS_CNT]; uint32_t abs_max[ABS_CNT]; uint32_t abs_fuzz[ABS_CNT];