version 1.6, 2017/12/25 00:18:39 |
version 1.7, 2019/07/27 15:29:10 |
|
|
|
|
Move variable declarations to top, for C90. |
Move variable declarations to top, for C90. |
|
|
--- src/joystick/bsd/SDL_sysjoystick.c.orig 2017-10-23 19:27:46.000000000 +0000 |
--- src/joystick/bsd/SDL_sysjoystick.c.orig 2019-07-25 04:32:36.000000000 +0000 |
+++ src/joystick/bsd/SDL_sysjoystick.c |
+++ src/joystick/bsd/SDL_sysjoystick.c |
@@ -45,6 +45,12 @@ |
@@ -45,6 +45,12 @@ |
#ifdef __DragonFly__ |
#ifdef __DragonFly__ |
Line 17 Move variable declarations to top, for C |
|
Line 17 Move variable declarations to top, for C |
|
#else |
#else |
#include <dev/usb/usb.h> |
#include <dev/usb/usb.h> |
#include <dev/usb/usbhid.h> |
#include <dev/usb/usbhid.h> |
@@ -291,6 +297,10 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy, |
|
struct report *rep = NULL; |
|
int fd; |
|
int i; |
|
+#if defined(__NetBSD__) |
|
+ usb_device_descriptor_t udd; |
|
+ struct usb_string_desc usd; |
|
+#endif |
|
|
|
fd = open(path, O_RDONLY); |
|
if (fd == -1) { |
|
@@ -340,8 +350,6 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy, |
|
rep->rid = -1; /* XXX */ |
|
} |
|
#if defined(__NetBSD__) |
|
- usb_device_descriptor_t udd; |
|
- struct usb_string_desc usd; |
|
if (ioctl(fd, USB_GET_DEVICE_DESC, &udd) == -1) |
|
goto desc_failed; |
|
|
|