Fixed gcc pedantic warnings in public headers
This commit is contained in:
parent
a2dccaee2b
commit
2204530a1b
2 changed files with 21 additions and 24 deletions
|
@ -62,23 +62,20 @@ typedef enum
|
||||||
} SDL_GameControllerBindType;
|
} 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;
|
SDL_GameControllerBindType bindType;
|
||||||
int hat_mask;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _SDL_GameControllerButtonBind
|
|
||||||
{
|
|
||||||
SDL_GameControllerBindType m_eBindType;
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
int button;
|
int button;
|
||||||
int axis;
|
int axis;
|
||||||
struct _SDL_GameControllerHatBind hat;
|
struct {
|
||||||
};
|
int hat;
|
||||||
|
int hat_mask;
|
||||||
|
} hat;
|
||||||
|
} value;
|
||||||
|
|
||||||
} SDL_GameControllerButtonBind;
|
} SDL_GameControllerButtonBind;
|
||||||
|
|
||||||
|
@ -190,7 +187,7 @@ typedef enum
|
||||||
extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
|
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
|
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
||||||
SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
|
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
|
extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
|
||||||
SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
|
SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
|
||||||
|
|
|
@ -945,13 +945,13 @@ SDL_GameControllerButtonBind SDL_GameControllerGetBindForAxis(SDL_GameController
|
||||||
|
|
||||||
if (gamecontroller->mapping.axes[axis] >= 0 )
|
if (gamecontroller->mapping.axes[axis] >= 0 )
|
||||||
{
|
{
|
||||||
bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
||||||
bind.button = gamecontroller->mapping.axes[axis];
|
bind.value.button = gamecontroller->mapping.axes[axis];
|
||||||
}
|
}
|
||||||
else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
|
else if (gamecontroller->mapping.buttonasaxis[axis] >= 0 )
|
||||||
{
|
{
|
||||||
bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
||||||
bind.button = gamecontroller->mapping.buttonasaxis[axis];
|
bind.value.button = gamecontroller->mapping.buttonasaxis[axis];
|
||||||
}
|
}
|
||||||
|
|
||||||
return bind;
|
return bind;
|
||||||
|
@ -971,19 +971,19 @@ SDL_GameControllerButtonBind SDL_GameControllerGetBindForButton(SDL_GameControll
|
||||||
|
|
||||||
if ( gamecontroller->mapping.buttons[button] >= 0 )
|
if ( gamecontroller->mapping.buttons[button] >= 0 )
|
||||||
{
|
{
|
||||||
bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
bind.bindType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
||||||
bind.button = gamecontroller->mapping.buttons[button];
|
bind.value.button = gamecontroller->mapping.buttons[button];
|
||||||
}
|
}
|
||||||
else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
|
else if ( gamecontroller->mapping.axesasbutton[button] >= 0 )
|
||||||
{
|
{
|
||||||
bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
bind.bindType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
||||||
bind.axis = gamecontroller->mapping.axesasbutton[button];
|
bind.value.axis = gamecontroller->mapping.axesasbutton[button];
|
||||||
}
|
}
|
||||||
else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
|
else if ( gamecontroller->mapping.hatasbutton[button].hat >= 0 )
|
||||||
{
|
{
|
||||||
bind.m_eBindType = SDL_CONTROLLER_BINDTYPE_HAT;
|
bind.bindType = SDL_CONTROLLER_BINDTYPE_HAT;
|
||||||
bind.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
|
bind.value.hat.hat = gamecontroller->mapping.hatasbutton[button].hat;
|
||||||
bind.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
|
bind.value.hat.hat_mask = gamecontroller->mapping.hatasbutton[button].mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bind;
|
return bind;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue