Commit 9295a9be authored by Sam Lantinga's avatar Sam Lantinga

Wilbern Cobb fixed joystick code on FreeBSD

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40359
parent b02d1f64
...@@ -41,7 +41,12 @@ static char rcsid = ...@@ -41,7 +41,12 @@ static char rcsid =
#include <dev/usb/usb.h> #include <dev/usb/usb.h>
#include <dev/usb/usbhid.h> #include <dev/usb/usbhid.h>
#include <usbhid.h>
#if defined(__FreeBSD__)
# include <libusb.h>
#else
# include <usbhid.h>
#endif
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
...@@ -205,7 +210,8 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy) ...@@ -205,7 +210,8 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
joy->nballs = 0; joy->nballs = 0;
while (hid_get_item(hdata, &hitem) > 0) { while (hid_get_item(hdata, &hitem) > 0) {
char *s, *sp; char *sp;
const char *s;
switch (hitem.kind) { switch (hitem.kind) {
case hid_collection: case hid_collection:
...@@ -271,7 +277,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy) ...@@ -271,7 +277,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joy)
static struct hid_item hitem; static struct hid_item hitem;
static struct hid_data *hdata; static struct hid_data *hdata;
static struct report *rep; static struct report *rep;
int nbutton, naxe; int nbutton, naxe = -1;
Sint32 v; Sint32 v;
rep = &joy->hwdata->inreport; rep = &joy->hwdata->inreport;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment