mirror of https://github.com/encounter/SDL.git
SDL_gamecontroller.c: (unsigned char) cast to SDL_isdigit() parameters.
This commit is contained in:
parent
ced442cd38
commit
61107494a1
|
@ -860,7 +860,7 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro
|
||||||
invert_input = SDL_TRUE;
|
invert_input = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (szJoystickButton[0] == 'a' && SDL_isdigit(szJoystickButton[1])) {
|
if (szJoystickButton[0] == 'a' && SDL_isdigit((unsigned char) szJoystickButton[1])) {
|
||||||
bind.inputType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
bind.inputType = SDL_CONTROLLER_BINDTYPE_AXIS;
|
||||||
bind.input.axis.axis = SDL_atoi(&szJoystickButton[1]);
|
bind.input.axis.axis = SDL_atoi(&szJoystickButton[1]);
|
||||||
if (half_axis_input == '+') {
|
if (half_axis_input == '+') {
|
||||||
|
@ -878,11 +878,11 @@ static void SDL_PrivateGameControllerParseElement(SDL_GameController *gamecontro
|
||||||
bind.input.axis.axis_min = bind.input.axis.axis_max;
|
bind.input.axis.axis_min = bind.input.axis.axis_max;
|
||||||
bind.input.axis.axis_max = tmp;
|
bind.input.axis.axis_max = tmp;
|
||||||
}
|
}
|
||||||
} else if (szJoystickButton[0] == 'b' && SDL_isdigit(szJoystickButton[1])) {
|
} else if (szJoystickButton[0] == 'b' && SDL_isdigit((unsigned char) szJoystickButton[1])) {
|
||||||
bind.inputType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
bind.inputType = SDL_CONTROLLER_BINDTYPE_BUTTON;
|
||||||
bind.input.button = SDL_atoi(&szJoystickButton[1]);
|
bind.input.button = SDL_atoi(&szJoystickButton[1]);
|
||||||
} else if (szJoystickButton[0] == 'h' && SDL_isdigit(szJoystickButton[1]) &&
|
} else if (szJoystickButton[0] == 'h' && SDL_isdigit((unsigned char) szJoystickButton[1]) &&
|
||||||
szJoystickButton[2] == '.' && SDL_isdigit(szJoystickButton[3])) {
|
szJoystickButton[2] == '.' && SDL_isdigit((unsigned char) szJoystickButton[3])) {
|
||||||
int hat = SDL_atoi(&szJoystickButton[1]);
|
int hat = SDL_atoi(&szJoystickButton[1]);
|
||||||
int mask = SDL_atoi(&szJoystickButton[3]);
|
int mask = SDL_atoi(&szJoystickButton[3]);
|
||||||
bind.inputType = SDL_CONTROLLER_BINDTYPE_HAT;
|
bind.inputType = SDL_CONTROLLER_BINDTYPE_HAT;
|
||||||
|
|
Loading…
Reference in New Issue