Wilbern Cobb fixed joystick code on FreeBSD
authorSam Lantinga
Tue, 16 Apr 2002 16:45:23 +0000
changeset 3581f148809d972
parent 357 5868b0f832f2
child 359 f0e5198a1522
Wilbern Cobb fixed joystick code on FreeBSD
src/joystick/bsd/SDL_sysjoystick.c
     1.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Mon Apr 15 07:49:54 2002 +0000
     1.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Tue Apr 16 16:45:23 2002 +0000
     1.3 @@ -41,7 +41,12 @@
     1.4  
     1.5  #include <dev/usb/usb.h>
     1.6  #include <dev/usb/usbhid.h>
     1.7 -#include <usbhid.h>
     1.8 +
     1.9 +#if defined(__FreeBSD__)
    1.10 +# include <libusb.h>
    1.11 +#else
    1.12 +# include <usbhid.h>
    1.13 +#endif
    1.14  
    1.15  #include "SDL_error.h"
    1.16  #include "SDL_joystick.h"
    1.17 @@ -205,7 +210,8 @@
    1.18  	joy->nballs = 0;
    1.19  
    1.20  	while (hid_get_item(hdata, &hitem) > 0) {
    1.21 -		char *s, *sp;
    1.22 +		char *sp;
    1.23 +		const char *s;
    1.24  
    1.25  		switch (hitem.kind) {
    1.26  		case hid_collection:
    1.27 @@ -271,7 +277,7 @@
    1.28  	static struct hid_item hitem;
    1.29  	static struct hid_data *hdata;
    1.30  	static struct report *rep;
    1.31 -	int nbutton, naxe;
    1.32 +	int nbutton, naxe = -1;
    1.33  	Sint32 v;
    1.34  	
    1.35  	rep = &joy->hwdata->inreport;