comparison src/events/SDL_keyboard.c @ 1612:97d0966f4bf7

Fixed some ultra-pedantic gcc warnings
author Sam Lantinga <slouken@libsdl.org>
date Fri, 24 Mar 2006 06:10:24 +0000
parents 1ff64ad478b2
children 14717b52abc0
comparison
equal deleted inserted replaced
1611:ec3466b08f17 1612:97d0966f4bf7
32 /* Global keystate information */ 32 /* Global keystate information */
33 static Uint8 SDL_KeyState[SDLK_LAST]; 33 static Uint8 SDL_KeyState[SDLK_LAST];
34 static SDLMod SDL_ModState; 34 static SDLMod SDL_ModState;
35 int SDL_TranslateUNICODE = 0; 35 int SDL_TranslateUNICODE = 0;
36 36
37 static char *keynames[SDLK_LAST]; /* Array of keycode names */ 37 static const char *keynames[SDLK_LAST]; /* Array of keycode names */
38 38
39 /* 39 /*
40 * jk 991215 - added 40 * jk 991215 - added
41 */ 41 */
42 struct { 42 struct {
354 SDL_ModState = modstate; 354 SDL_ModState = modstate;
355 } 355 }
356 356
357 char *SDL_GetKeyName(SDLKey key) 357 char *SDL_GetKeyName(SDLKey key)
358 { 358 {
359 char *keyname; 359 const char *keyname;
360 360
361 keyname = NULL; 361 keyname = NULL;
362 if ( key < SDLK_LAST ) { 362 if ( key < SDLK_LAST ) {
363 keyname = keynames[key]; 363 keyname = keynames[key];
364 } 364 }
365 if ( keyname == NULL ) { 365 if ( keyname == NULL ) {
366 keyname = "unknown key"; 366 keyname = "unknown key";
367 } 367 }
368 return(keyname); 368 /* FIXME: make this function const in 1.3 */
369 return (char *)(keyname);
369 } 370 }
370 371
371 /* These are global for SDL_eventloop.c */ 372 /* These are global for SDL_eventloop.c */
372 int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym) 373 int SDL_PrivateKeyboard(Uint8 state, SDL_keysym *keysym)
373 { 374 {