From 9a526084ecd8df6e2146f621a375891dd223418d Mon Sep 17 00:00:00 2001 From: mcmartin Date: Sat, 5 Apr 2008 07:59:26 +0000 Subject: [PATCH] Fixed errors and warnings when compiling without HAVE_JOYSTICK git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2956 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/libs/input/sdl/vcontrol.c | 46 ++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index dac83790d..f367f4029 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Fixed compile errors when compiling without joystick support - Michael - Added endian-aware integer read functions to uio - SvdB - Introduce the concept of an "InputContext" - SvdB - Don't use alloca() in uio. - SvdB diff --git a/sc2/src/sc2code/libs/input/sdl/vcontrol.c b/sc2/src/sc2code/libs/input/sdl/vcontrol.c index 4dc0b4120..80da9be4e 100644 --- a/sc2/src/sc2code/libs/input/sdl/vcontrol.c +++ b/sc2/src/sc2code/libs/input/sdl/vcontrol.c @@ -213,7 +213,6 @@ key_init (void) } #else joycount = 0; - joysticks = NULL; #endif /* HAVE_JOYSTICK */ } @@ -257,6 +256,9 @@ VControl_SetJoyThreshold (int port, int threshold) return 0; } else +#else + (void) port; + (void) threshold; #endif /* HAVE_JOYSTICK */ { // log_add (log_Warning, "VControl_SetJoyThreshold passed illegal port %d", port); @@ -537,6 +539,11 @@ VControl_AddJoyAxisBinding (int port, int axis, int polarity, int *target) } } else +#else + (void) port; + (void) axis; + (void) polarity; + (void) target; #endif /* HAVE_JOYSTICK */ { // log_add (log_Debug, "VControl: Attempted to bind to illegal port %d", port); @@ -575,6 +582,11 @@ VControl_RemoveJoyAxisBinding (int port, int axis, int polarity, int *target) } } else +#else + (void) port; + (void) axis; + (void) polarity; + (void) target; #endif /* HAVE_JOYSTICK */ { log_add (log_Debug, "VControl: Attempted to unbind from illegal port %d", port); @@ -602,6 +614,10 @@ VControl_AddJoyButtonBinding (int port, int button, int *target) } } else +#else + (void) port; + (void) button; + (void) target; #endif /* HAVE_JOYSTICK */ { // log_add (log_Debug, "VControl: Attempted to bind to illegal port %d", port); @@ -628,6 +644,10 @@ VControl_RemoveJoyButtonBinding (int port, int button, int *target) } } else +#else + (void) port; + (void) button; + (void) target; #endif /* HAVE_JOYSTICK */ { log_add (log_Debug, "VControl: Attempted to unbind from illegal port %d", port); @@ -675,6 +695,11 @@ VControl_AddJoyHatBinding (int port, int which, Uint8 dir, int *target) } } else +#else + (void) port; + (void) which; + (void) dir; + (void) target; #endif /* HAVE_JOYSTICK */ { // log_add (log_Debug, "VControl: Attempted to bind to illegal port %d", port); @@ -720,6 +745,11 @@ VControl_RemoveJoyHatBinding (int port, int which, Uint8 dir, int *target) } } else +#else + (void) port; + (void) which; + (void) dir; + (void) target; #endif /* HAVE_JOYSTICK */ { log_add (log_Debug, "VControl: Attempted to unbind from illegal port %d", port); @@ -760,6 +790,9 @@ VControl_ProcessJoyButtonDown (int port, int button) if (!joysticks[port].stick) return; activate (joysticks[port].buttons[button]); +#else + (void) port; + (void) button; #endif /* HAVE_JOYSTICK */ } @@ -770,6 +803,9 @@ VControl_ProcessJoyButtonUp (int port, int button) if (!joysticks[port].stick) return; deactivate (joysticks[port].buttons[button]); +#else + (void) port; + (void) button; #endif /* HAVE_JOYSTICK */ } @@ -817,6 +853,10 @@ VControl_ProcessJoyAxis (int port, int axis, int value) } joysticks[port].axes[axis].polarity = 0; } +#else + (void) port; + (void) axis; + (void) value; #endif /* HAVE_JOYSTICK */ } @@ -845,6 +885,10 @@ VControl_ProcessJoyHat (int port, int which, Uint8 value) if ((old & SDL_HAT_DOWN) && !(value & SDL_HAT_DOWN)) deactivate (joysticks[port].hats[which].down); joysticks[port].hats[which].last = value; +#else + (void) port; + (void) which; + (void) value; #endif /* HAVE_JOYSTICK */ }