Fixed gcc pedantic warnings in public headers
authorSam Lantinga <slouken@libsdl.org>
Tue, 26 Feb 2013 20:41:28 -0800
changeset 6932 361bebe92c66
parent 6931 843f9c1b16b8
child 6933 e56ed2eb139e
Fixed gcc pedantic warnings in public headers
include/SDL_gamecontroller.h
src/joystick/SDL_gamecontroller.c
--- a/include/SDL_gamecontroller.h	Tue Feb 26 20:32:11 2013 -0800
+++ b/include/SDL_gamecontroller.h	Tue Feb 26 20:41:28 2013 -0800
@@ -62,23 +62,20 @@
 } SDL_GameControllerBindType;
 
 /**
- *  get the sdl joystick layer binding for this controller button/axis mapping
+ *  Get the SDL joystick layer binding for this controller button/axis mapping
  */
-struct _SDL_GameControllerHatBind
+typedef struct SDL_GameControllerButtonBind
 {
-	int hat;
-	int hat_mask;
-};
-
-typedef struct _SDL_GameControllerButtonBind
-{
-	SDL_GameControllerBindType m_eBindType;
+	SDL_GameControllerBindType bindType;
 	union
 	{
 		int button;
 		int axis;
-		struct _SDL_GameControllerHatBind hat;
-	};
+		struct {
+            int hat;
+            int hat_mask;
+        } hat;
+	} value;
 
 } SDL_GameControllerButtonBind;
 
@@ -190,7 +187,7 @@
 extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
 
 /**
- *  get the sdl joystick layer binding for this controller button mapping
+ *  Get the SDL joystick layer binding for this controller button mapping
  */
 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
 SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
@@ -238,7 +235,7 @@
 
 
 /**
- *  get the sdl joystick layer binding for this controller button mapping
+ *  Get the SDL joystick layer binding for this controller button mapping
  */
 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
 SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
--- a/src/joystick/SDL_gamecontroller.c	Tue Feb 26 20:32:11 2013 -0800
+++ b/src/joystick/SDL_gamecontroller.c	Tue Feb 26 20:41:28 2013 -0800
@@ -945,13 +945,13 @@
 
 	if (gamecontroller->mapping.axes[axis] >= 0 )
 	{
-		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
-		bind.button = gamecontroller->mapping.axes[axis];
+		bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
+		bind.value.button = gamecontroller->mapping.axes[axis];
 	}
 	else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
 	{
-		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
-		bind.button = gamecontroller->mapping.buttonasaxis[axis];
+		bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
+		bind.value.button = gamecontroller->mapping.buttonasaxis[axis];
 	}
 
 	return bind;
@@ -971,19 +971,19 @@
 
 	if ( gamecontroller->mapping.buttons[button] >= 0 )
 	{
-		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
-		bind.button = gamecontroller->mapping.buttons[button];
+		bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
+		bind.value.button = gamecontroller->mapping.buttons[button];
 	}
 	else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
 	{
-		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
-		bind.axis = gamecontroller->mapping.axesasbutton[button];
+		bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
+		bind.value.axis = gamecontroller->mapping.axesasbutton[button];
 	}
 	else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
 	{
-		bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_HAT;
-		bind.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
-		bind.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
+		bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT;
+		bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
+		bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
 	}
 
 	return bind;