Fixed gcc pedantic warnings in public headers
authorSam Lantinga <slouken@libsdl.org>
Tue, 26 Feb 2013 20:41:28 -0800
changeset 6932361bebe92c66
parent 6931 843f9c1b16b8
child 6933 e56ed2eb139e
Fixed gcc pedantic warnings in public headers
include/SDL_gamecontroller.h
src/joystick/SDL_gamecontroller.c
     1.1 --- a/include/SDL_gamecontroller.h	Tue Feb 26 20:32:11 2013 -0800
     1.2 +++ b/include/SDL_gamecontroller.h	Tue Feb 26 20:41:28 2013 -0800
     1.3 @@ -62,23 +62,20 @@
     1.4  } SDL_GameControllerBindType;
     1.5  
     1.6  /**
     1.7 - *  get the sdl joystick layer binding for this controller button/axis mapping
     1.8 + *  Get the SDL joystick layer binding for this controller button/axis mapping
     1.9   */
    1.10 -struct _SDL_GameControllerHatBind
    1.11 +typedef struct SDL_GameControllerButtonBind
    1.12  {
    1.13 -	int hat;
    1.14 -	int hat_mask;
    1.15 -};
    1.16 -
    1.17 -typedef struct _SDL_GameControllerButtonBind
    1.18 -{
    1.19 -	SDL_GameControllerBindType m_eBindType;
    1.20 +	SDL_GameControllerBindType bindType;
    1.21  	union
    1.22  	{
    1.23  		int button;
    1.24  		int axis;
    1.25 -		struct _SDL_GameControllerHatBind hat;
    1.26 -	};
    1.27 +		struct {
    1.28 +            int hat;
    1.29 +            int hat_mask;
    1.30 +        } hat;
    1.31 +	} value;
    1.32  
    1.33  } SDL_GameControllerButtonBind;
    1.34  
    1.35 @@ -190,7 +187,7 @@
    1.36  extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
    1.37  
    1.38  /**
    1.39 - *  get the sdl joystick layer binding for this controller button mapping
    1.40 + *  Get the SDL joystick layer binding for this controller button mapping
    1.41   */
    1.42  extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
    1.43  SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
    1.44 @@ -238,7 +235,7 @@
    1.45  
    1.46  
    1.47  /**
    1.48 - *  get the sdl joystick layer binding for this controller button mapping
    1.49 + *  Get the SDL joystick layer binding for this controller button mapping
    1.50   */
    1.51  extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
    1.52  SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
     2.1 --- a/src/joystick/SDL_gamecontroller.c	Tue Feb 26 20:32:11 2013 -0800
     2.2 +++ b/src/joystick/SDL_gamecontroller.c	Tue Feb 26 20:41:28 2013 -0800
     2.3 @@ -945,13 +945,13 @@
     2.4  
     2.5  	if (gamecontroller->mapping.axes[axis] >= 0 )
     2.6  	{
     2.7 -		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
     2.8 -		bind.button = gamecontroller->mapping.axes[axis];
     2.9 +		bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
    2.10 +		bind.value.button = gamecontroller->mapping.axes[axis];
    2.11  	}
    2.12  	else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
    2.13  	{
    2.14 -		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
    2.15 -		bind.button = gamecontroller->mapping.buttonasaxis[axis];
    2.16 +		bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
    2.17 +		bind.value.button = gamecontroller->mapping.buttonasaxis[axis];
    2.18  	}
    2.19  
    2.20  	return bind;
    2.21 @@ -971,19 +971,19 @@
    2.22  
    2.23  	if ( gamecontroller->mapping.buttons[button] >= 0 )
    2.24  	{
    2.25 -		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
    2.26 -		bind.button = gamecontroller->mapping.buttons[button];
    2.27 +		bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
    2.28 +		bind.value.button = gamecontroller->mapping.buttons[button];
    2.29  	}
    2.30  	else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
    2.31  	{
    2.32 -		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
    2.33 -		bind.axis = gamecontroller->mapping.axesasbutton[button];
    2.34 +		bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
    2.35 +		bind.value.axis = gamecontroller->mapping.axesasbutton[button];
    2.36  	}
    2.37  	else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
    2.38  	{
    2.39 -		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_HAT;
    2.40 -		bind.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
    2.41 -		bind.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
    2.42 +		bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT;
    2.43 +		bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
    2.44 +		bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
    2.45  	}
    2.46  
    2.47  	return bind;