[Fix] Removed some warnings on SDL1.3

This commit is contained in:
Allanis 2014-05-22 18:22:06 +01:00
parent d4d40f63ff
commit 3182639db1

View File

@ -111,7 +111,7 @@ unsigned int input_afterburnSensibility = 200; /**< ms between taps to afterbur
/* From player.c */ /* From player.c */
extern double player_turn; extern double player_turn;
static char* keyconv[SDLK_LAST]; /**< Key conversion table. */ static const char* keyconv[SDLK_LAST]; /**< Key conversion table. */
static void input_keyConvGen(void); static void input_keyConvGen(void);
static void input_keyConvDestroy(void); static void input_keyConvDestroy(void);
@ -538,9 +538,9 @@ static void input_key(int keynum, double value, int kabs) {
/* --Events-- */ /* --Events-- */
static void input_joyaxis(const unsigned int axis, const int value); static void input_joyaxis(const SDLKey axis, const int value);
static void input_joyevent(int event, const unsigned int button); static void input_joyevent(const int event, const SDLKey button);
static void input_keyevent(int event, SDLKey key, SDLMod mod); static void input_keyevent(const int event, const SDLKey key, const SDLMod mod);
/* Joystick. */ /* Joystick. */
@ -549,7 +549,7 @@ static void input_keyevent(int event, SDLKey key, SDLMod mod);
* @param axis Axis generated by the event. * @param axis Axis generated by the event.
* @param value Value of the axis. * @param value Value of the axis.
*/ */
static void input_joyaxis(const unsigned int axis, const int value) { static void input_joyaxis(const SDLKey axis, const int value) {
int i; int i;
for(i = 0; strcmp(keybindNames[i], "end"); i++) for(i = 0; strcmp(keybindNames[i], "end"); i++)
if(input_keybinds[i]->type == KEYBIND_JAXIS && if(input_keybinds[i]->type == KEYBIND_JAXIS &&
@ -562,7 +562,7 @@ static void input_joyaxis(const unsigned int axis, const int value) {
* @param event Event type (down/up). * @param event Event type (down/up).
* @param button Button generating the event. * @param button Button generating the event.
*/ */
static void input_joyevent(int event, const unsigned int button) { static void input_joyevent(const int event, const SDLKey button) {
int i; int i;
for(i = 0; strcmp(keybindNames[i], "end");i++) for(i = 0; strcmp(keybindNames[i], "end");i++)
if(input_keybinds[i]->type == KEYBIND_JBUTTON && if(input_keybinds[i]->type == KEYBIND_JBUTTON &&
@ -578,15 +578,17 @@ static void input_joyevent(int event, const unsigned int button) {
* @param key Key generating the event. * @param key Key generating the event.
* @param mod Modifiers active when event was generated. * @param mod Modifiers active when event was generated.
*/ */
static void input_keyevent(int event, SDLKey key, SDLMod mod) { static void input_keyevent(const int event, SDLKey key, const SDLMod mod) {
int i; int i;
SDLMod mod_filtered;
mod &= ~(KMOD_CAPS | KMOD_NUM | KMOD_MODE); /* We want to ignore "global" modifiers. */ /* We want to ignore "global" modifiers. */
mod_filtered = mod & ~(KMOD_CAPS | KMOD_NUM | KMOD_MODE);
for(i = 0; strcmp(keybindNames[i], "end"); i++) { for(i = 0; strcmp(keybindNames[i], "end"); i++) {
if((input_keybinds[i]->type == KEYBIND_KEYBOARD) && if((input_keybinds[i]->type == KEYBIND_KEYBOARD) &&
(input_keybinds[i]->key == key)) { (input_keybinds[i]->key == key)) {
if((input_keybinds[i]->mod == mod) || if((input_keybinds[i]->mod == mod_filtered) ||
(input_keybinds[i]->mod == KMOD_ALL) || (input_keybinds[i]->mod == KMOD_ALL) ||
(event == KEY_RELEASE)) /**< Release always gets through. */ (event == KEY_RELEASE)) /**< Release always gets through. */
input_key(i, event, 0); input_key(i, event, 0);