obsolete declaration cleanup and const correctness for Key_GetBinding

This commit is contained in:
Bill Currie 2002-01-25 00:01:05 +00:00
parent 08210bc93f
commit 750100b3e3
2 changed files with 11 additions and 19 deletions

View file

@ -361,11 +361,16 @@ typedef enum {
} imt_t; // Input Mapping Table } imt_t; // Input Mapping Table
// key_none should, preferably, be last // key_none should, preferably, be last
typedef enum {key_game, key_console, key_message, key_menu, key_none} keydest_t; typedef enum {
key_game,
key_console,
key_message,
key_menu,
key_none
} keydest_t;
#ifndef __QFCC__ #ifndef __QFCC__
typedef struct typedef struct {
{
int down[2]; // key nums holding it down int down[2]; // key nums holding it down
int state; // low bit is down state int state; // low bit is down state
} kbutton_t; } kbutton_t;
@ -375,30 +380,17 @@ extern imt_t game_target;
extern char *keybindings[IMT_LAST][QFK_LAST]; extern char *keybindings[IMT_LAST][QFK_LAST];
extern int keydown[QFK_LAST]; extern int keydown[QFK_LAST];
extern int key_lastpress;
extern char chat_buffer[];
extern int chat_bufferlen;
extern qboolean chat_team;
void Key_Event (knum_t key, short unicode, qboolean down); void Key_Event (knum_t key, short unicode, qboolean down);
void Key_Init (void); void Key_Init (void);
void Key_Init_Cvars (void); void Key_Init_Cvars (void);
void Key_WriteBindings (VFile *f); void Key_WriteBindings (VFile *f);
void Key_ClearStates (void); void Key_ClearStates (void);
char *Key_GetBinding (imt_t imt, knum_t key); const char *Key_GetBinding (imt_t imt, knum_t key);
void Key_SetBinding (imt_t target, knum_t keynum, const char *binding); void Key_SetBinding (imt_t target, knum_t keynum, const char *binding);
void Key_ClearTyping (void);
float Key_KeyState (kbutton_t *key);
const char *Key_KeynumToString (knum_t keynum); const char *Key_KeynumToString (knum_t keynum);
#define MAXCMDLINE 256
extern char key_lines[32][MAXCMDLINE];
extern int edit_line;
extern int key_linepos;
#endif #endif
#endif // _KEYS_H #endif // _KEYS_H

View file

@ -381,7 +381,7 @@ keyname_t keynames[] = {
qboolean qboolean
Key_Game (knum_t key, short unicode) Key_Game (knum_t key, short unicode)
{ {
char *kb; const char *kb;
char cmd[1024]; char cmd[1024];
kb = Key_GetBinding(game_target, key); kb = Key_GetBinding(game_target, key);
@ -792,7 +792,7 @@ Key_Init_Cvars (void)
"unbind wrappers to in_bind and in_unbind"); "unbind wrappers to in_bind and in_unbind");
} }
char * const char *
Key_GetBinding (imt_t imt, knum_t key) Key_GetBinding (imt_t imt, knum_t key)
{ {
return keybindings[imt][key]; return keybindings[imt][key];