avoid some pedantic warnings in array initializers
diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index 08f23eb..f6c5cbe 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c
@@ -92,8 +92,9 @@ { const SDL_bool blink = SDL_FALSE; Uint8 mode = (blink ? 0x02 : 0x06) + slot; - const Uint8 led_packet[] = { 0x01, 0x03, mode }; + Uint8 led_packet[] = { 0x01, 0x03, 0x00 }; + led_packet[2] = mode; if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) { return SDL_FALSE; }
diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360w.c b/src/joystick/hidapi/SDL_hidapi_xbox360w.c index e6bc210..c69727e 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360w.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360w.c
@@ -66,8 +66,9 @@ { const SDL_bool blink = SDL_FALSE; Uint8 mode = (blink ? 0x02 : 0x06) + slot; - const Uint8 led_packet[] = { 0x00, 0x00, 0x08, (0x40 + (mode % 0x0e)), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + Uint8 led_packet[] = { 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + led_packet[3] = 0x40 + (mode % 0x0e); if (hid_write(dev, led_packet, sizeof(led_packet)) != sizeof(led_packet)) { return SDL_FALSE; }
diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index bcc05d7..563a0fa 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c
@@ -163,7 +163,11 @@ /* The Windows driver is taking care of acks */ #else if ((data[1] & 0x30) == 0x30) { - Uint8 ack_packet[] = { 0x01, 0x20, data[2], 0x09, 0x00, data[0], 0x20, data[3], 0x00, 0x00, 0x00, 0x00, 0x00 }; + Uint8 ack_packet[] = { 0x01, 0x20, 0x00, 0x09, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + ack_packet[2] = data[2]; + ack_packet[5] = data[0]; + ack_packet[7] = data[3]; /* The initial ack needs 0x80 added to the response, for some reason */ if (data[0] == 0x04 && data[1] == 0xF0) {