(connect) Style nits

This commit is contained in:
twinaphex 2015-04-07 18:49:21 +02:00
parent ea7815bf32
commit 2087a41f20
2 changed files with 10 additions and 10 deletions

View File

@ -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 ++)

View File

@ -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;