Wilbern Cobb fixed joystick code on FreeBSD
authorSam Lantinga <slouken@libsdl.org>
Tue, 16 Apr 2002 16:45:23 +0000
changeset 358 1f148809d972
parent 357 5868b0f832f2
child 359 f0e5198a1522
Wilbern Cobb fixed joystick code on FreeBSD
src/joystick/bsd/SDL_sysjoystick.c
--- a/src/joystick/bsd/SDL_sysjoystick.c	Mon Apr 15 07:49:54 2002 +0000
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Tue Apr 16 16:45:23 2002 +0000
@@ -41,7 +41,12 @@
 
 #include <dev/usb/usb.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_joystick.h"
@@ -205,7 +210,8 @@
 	joy->nballs = 0;
 
 	while (hid_get_item(hdata, &hitem) > 0) {
-		char *s, *sp;
+		char *sp;
+		const char *s;
 
 		switch (hitem.kind) {
 		case hid_collection:
@@ -271,7 +277,7 @@
 	static struct hid_item hitem;
 	static struct hid_data *hdata;
 	static struct report *rep;
-	int nbutton, naxe;
+	int nbutton, naxe = -1;
 	Sint32 v;
 	
 	rep = &joy->hwdata->inreport;