X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=1269a76ed38c6ec4e2f28fd0d2f3c7a70466bf59;hb=28642dd16a96fb5bf7d90a8ba99ec33684a92ddd;hp=f19c5b25b1645f2c892605df17cb751786509da1;hpb=7fdce1253e14170b6cb933f13c1f2a1644c93793;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index f19c5b2..1269a76 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -979,8 +979,8 @@ static void fghJoystickAddHatElement ( SFG_Joystick *joy, CFDictionaryRef button /* Inspired by http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp */ -# if defined(_MSC_VER) -# pragma comment (lib, "advapi32.lib") /* library pragmas are bad */ +# if FREEGLUT_LIB_PRAGMAS +# pragma comment (lib, "advapi32.lib") # endif static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz ) @@ -1039,7 +1039,7 @@ static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_ static void fghJoystickOpen( SFG_Joystick* joy ) { - int i; + int i = 0; #if TARGET_HOST_MACINTOSH OSStatus err; #endif @@ -1061,7 +1061,7 @@ static void fghJoystickOpen( SFG_Joystick* joy ) unsigned char u; # else # if defined( __linux__ ) - int counter; + int counter = 0; # endif # endif #endif @@ -1394,7 +1394,7 @@ static void fghJoystickOpen( SFG_Joystick* joy ) # endif #endif -#if defined( __linux__ ) +#if defined( __linux__ ) || TARGET_HOST_SOLARIS /* Default for older Linux systems. */ joy->num_axes = 2; joy->num_buttons = 32; @@ -1688,9 +1688,6 @@ int fgJoystickDetect( void ) fgInitialiseJoysticks (); - if ( !fgJoystick ) - return 0; - if ( !fgState.JoysticksInitialised ) return 0;