diff src/joystick/bsd/SDL_sysjoystick.c @ 358:1f148809d972

Wilbern Cobb fixed joystick code on FreeBSD
author Sam Lantinga <slouken@libsdl.org>
date Tue, 16 Apr 2002 16:45:23 +0000
parents 0185452e9f83
children bc1401311390
line wrap: on
line diff
--- 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;