From 2087a41f20ef945027b03b7d0afa3bcaf060fd48 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Apr 2015 18:49:21 +0200 Subject: [PATCH] (connect) Style nits --- input/connect/connect_ps3.c | 16 ++++++++-------- input/connect/connect_ps4.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/input/connect/connect_ps3.c b/input/connect/connect_ps3.c index 228b019b14..18cf51d651 100644 --- a/input/connect/connect_ps3.c +++ b/input/connect/connect_ps3.c @@ -49,8 +49,8 @@ static void hidpad_ps3_send_control(struct hidpad_ps3_data* device) }; report_buffer[11] = 1 << ((device->slot % 4) + 1); - report_buffer[4] = device->motors[1] >> 8; - report_buffer[6] = device->motors[0] >> 8; + report_buffer[4] = device->motors[1] >> 8; + report_buffer[6] = device->motors[0] >> 8; device->send_control(device->connection, report_buffer, sizeof(report_buffer)); } @@ -59,10 +59,10 @@ static void* hidpad_ps3_init(void *data, uint32_t slot, send_control_t ptr) { #ifdef IOS /* Magic packet to start reports. */ - static uint8_t magic_data[] = {0x53, 0xF4, 0x42, 0x03, 0x00, 0x00}; + static uint8_t magic_data[] = {0x53, 0xF4, 0x42, 0x03, 0x00, 0x00}; #endif struct pad_connection* connection = (struct pad_connection*)data; - struct hidpad_ps3_data* device = (struct hidpad_ps3_data*) + struct hidpad_ps3_data* device = (struct hidpad_ps3_data*) calloc(1, sizeof(struct hidpad_ps3_data)); if (!device) @@ -74,8 +74,8 @@ static void* hidpad_ps3_init(void *data, uint32_t slot, send_control_t ptr) return NULL; } - device->connection = connection; - device->slot = slot; + device->connection = connection; + device->slot = slot; device->send_control = ptr; #ifdef IOS @@ -154,9 +154,9 @@ static void hidpad_ps3_packet_handler(void *data, uint8_t *packet, uint16_t size memcpy(device->data, packet, size); - device->buttons = 0; + device->buttons = 0; - pressed_keys = device->data[3] | (device->data[4] << 8) | + pressed_keys = device->data[3] | (device->data[4] << 8) | ((device->data[5] & 1) << 16); for (i = 0; i < 17; i ++) diff --git a/input/connect/connect_ps4.c b/input/connect/connect_ps4.c index f5f9d53976..d16fab2360 100644 --- a/input/connect/connect_ps4.c +++ b/input/connect/connect_ps4.c @@ -94,7 +94,7 @@ static void* hidpad_ps4_init(void *data, uint32_t slot, send_control_t ptr) { uint8_t magic_data[0x25]; struct pad_connection* connection = (struct pad_connection*)data; - struct hidpad_ps4_data* device = (struct hidpad_ps4_data*) + struct hidpad_ps4_data* device = (struct hidpad_ps4_data*) calloc(1, sizeof(struct hidpad_ps4_data)); if (!device) @@ -151,7 +151,7 @@ static bool hidpad_ps4_check_dpad(struct ps4 *rpt, unsigned id) static uint64_t hidpad_ps4_get_buttons(void *data) { - uint64_t buttonstate = 0; + uint64_t buttonstate = 0; struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data; struct ps4 *rpt = device ? (struct ps4*)&device->data : NULL;