Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixed gcc pedantic warnings in public headers
- Loading branch information
Showing
with
21 additions
and
24 deletions.
-
+10
−13
include/SDL_gamecontroller.h
-
+11
−11
src/joystick/SDL_gamecontroller.c
|
@@ -62,23 +62,20 @@ typedef enum |
|
|
} 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 @@ typedef enum |
|
|
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 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom |
|
|
|
|
|
|
|
|
/** |
|
|
* 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, |
|
|
|
@@ -945,13 +945,13 @@ SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController |
|
|
|
|
|
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 @@ SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameControll |
|
|
|
|
|
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; |
|
|