Whitespace, plus remove unused key_progs_init from keys.c

This commit is contained in:
Ragnvald Maartmann-Moe IV 2005-01-13 14:44:57 +00:00
parent 318a945a9c
commit ea2ff1070b
3 changed files with 20 additions and 19 deletions

View file

@ -56,10 +56,6 @@ static __attribute__ ((unused)) const char rcsid[] =
#include "compat.h" #include "compat.h"
#include "old_keys.h" #include "old_keys.h"
#define U __attribute__ ((unused))
static U void (*const key_progs_init)(struct progs_s *) = Key_Progs_Init;
#undef U
/* key up events are sent even if in console mode */ /* key up events are sent even if in console mode */
cvar_t *in_bind_imt; cvar_t *in_bind_imt;
@ -402,14 +398,14 @@ Key_Game (knum_t key, short unicode)
const char *kb; const char *kb;
char cmd[1024]; char cmd[1024];
kb = Key_GetBinding(game_target, key); kb = Key_GetBinding (game_target, key);
if (!kb && (game_target > IMT_0)) if (!kb && (game_target > IMT_0))
kb = Key_GetBinding(IMT_0, key); kb = Key_GetBinding (IMT_0, key);
/* /*
Con_Printf("kb %p, game_target %d, key_dest %d, key %d\n", kb, Con_Printf("kb %p, game_target %d, key_dest %d, key %d\n", kb,
game_target, key_dest, key); game_target, key_dest, key);
*/ */
if (!kb) if (!kb)
return false; return false;
@ -590,7 +586,7 @@ Key_In_Bind (const char *imt, const char *key, const char *cmd)
} }
if (!cmd) { if (!cmd) {
if (Key_GetBinding(t, b)) if (Key_GetBinding (t, b))
Con_Printf ("%s %s \"%s\"\n", imt, key, Con_Printf ("%s %s \"%s\"\n", imt, key,
Key_GetBinding(t, b)); Key_GetBinding(t, b));
else else
@ -684,7 +680,7 @@ Key_GIB_Bind_Get_f (void)
const char *imt, *key, *cmd; const char *imt, *key, *cmd;
int t, k; int t, k;
if (GIB_Argc() != 2) { if (GIB_Argc () != 2) {
GIB_USAGE ("key"); GIB_USAGE ("key");
return; return;
} }
@ -756,15 +752,16 @@ Key_WriteBindings (QFile *f)
for (j = 0; j < IMT_LAST; j++) for (j = 0; j < IMT_LAST; j++)
for (i = 0; i < QFK_LAST; i++) for (i = 0; i < QFK_LAST; i++)
if ((bind = Key_GetBinding(j, i))) { if ((bind = Key_GetBinding(j, i))) {
if (f) if (f) {
Qprintf (f, "in_bind %s %s \"%s\"\n", Qprintf (f, "in_bind %s %s \"%s\"\n",
Key_IMTnumToString (j), Key_IMTnumToString (j),
Key_KeynumToString (i), bind); Key_KeynumToString (i), bind);
else } else {
Sys_Printf ("in_bind %s %s \"%s\"\n", Sys_Printf ("in_bind %s %s \"%s\"\n",
Key_IMTnumToString (j), Key_IMTnumToString (j),
Key_KeynumToString (i), bind); Key_KeynumToString (i), bind);
} }
}
} }
static void static void

View file

@ -245,7 +245,7 @@ OK_TranslateKeyName (const char *name)
const char *s = name; const char *s = name;
char *d = uname; char *d = uname;
while ((*d++ = toupper(*s))) while ((*d++ = toupper (*s)))
s++; s++;
ok = Hash_Find (old_key_table, uname); ok = Hash_Find (old_key_table, uname);
if (!ok) { if (!ok) {

View file

@ -55,7 +55,7 @@ bi_Key_SetBinding (progs_t *pr)
int keynum = P_INT (pr, 1); int keynum = P_INT (pr, 1);
const char *binding = P_GSTRING (pr, 2); const char *binding = P_GSTRING (pr, 2);
if(strlen(binding) == 0 || binding[0] == '\0') { if (strlen (binding) == 0 || binding[0] == '\0') {
binding = NULL; /* unbind a binding */ binding = NULL; /* unbind a binding */
} }
@ -79,10 +79,12 @@ bi_Key_LookupBinding (progs_t *pr)
for (i = 0; i < QFK_LAST; i++) { for (i = 0; i < QFK_LAST; i++) {
keybind = keybindings[target][i].str; keybind = keybindings[target][i].str;
if(keybind == NULL) { continue; } if (keybind == NULL) {
if(strcmp(keybind, binding) == 0) { continue;
}
if (strcmp (keybind, binding) == 0) {
bindnum--; bindnum--;
if(bindnum == 0) { if (bindnum == 0) {
keynum = i; keynum = i;
break; break;
} }
@ -107,8 +109,10 @@ bi_Key_CountBinding (progs_t *pr)
for (i = 0; i < QFK_LAST; i++) { for (i = 0; i < QFK_LAST; i++) {
keybind = keybindings[target][i].str; keybind = keybindings[target][i].str;
if(keybind == NULL) { continue; } if (keybind == NULL) {
if(strcmp(keybind, binding) == 0) { continue;
}
if (strcmp (keybind, binding) == 0) {
res++; res++;
} }
} }