tweaks: elide a function that has become too small for its two calls
parent
e01e1d8ab5
commit
a65f0ec80c
10
src/global.c
10
src/global.c
|
@ -392,7 +392,8 @@ void add_to_sclist(int menus, const char *scstring, const int keycode,
|
||||||
if (toggle)
|
if (toggle)
|
||||||
s->ordinal = (tailsc->toggle == toggle) ? counter : ++counter;
|
s->ordinal = (tailsc->toggle == toggle) ? counter : ++counter;
|
||||||
#endif
|
#endif
|
||||||
assign_keyinfo(s, scstring, keycode);
|
s->keystr = scstring;
|
||||||
|
s->keycode = (keycode ? keycode : keycode_from_string(scstring));
|
||||||
|
|
||||||
tailsc = s;
|
tailsc = s;
|
||||||
}
|
}
|
||||||
|
@ -527,13 +528,6 @@ int keycode_from_string(const char *keystring)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the string and its corresponding keycode for the given shortcut s. */
|
|
||||||
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode)
|
|
||||||
{
|
|
||||||
s->keystr = keystring;
|
|
||||||
s->keycode = (keycode ? keycode : keycode_from_string(keystring));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* These two tags are used elsewhere too, so they are global. */
|
/* These two tags are used elsewhere too, so they are global. */
|
||||||
/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
|
/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
|
||||||
const char *exit_tag = N_("Exit");
|
const char *exit_tag = N_("Exit");
|
||||||
|
|
|
@ -334,7 +334,6 @@ size_t shown_entries_for(int menu);
|
||||||
const keystruct *get_shortcut(int *kbinput);
|
const keystruct *get_shortcut(int *kbinput);
|
||||||
functionptrtype func_from_key(int *kbinput);
|
functionptrtype func_from_key(int *kbinput);
|
||||||
int keycode_from_string(const char *keystring);
|
int keycode_from_string(const char *keystring);
|
||||||
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode);
|
|
||||||
void shortcut_init(void);
|
void shortcut_init(void);
|
||||||
const char *flagtostr(int flag);
|
const char *flagtostr(int flag);
|
||||||
|
|
||||||
|
|
|
@ -820,7 +820,8 @@ void parse_binding(char *ptr, bool dobind)
|
||||||
}
|
}
|
||||||
|
|
||||||
newsc->menus = menu;
|
newsc->menus = menu;
|
||||||
assign_keyinfo(newsc, keycopy, keycode);
|
newsc->keystr = keycopy;
|
||||||
|
newsc->keycode = keycode;
|
||||||
|
|
||||||
/* Disallow rebinding ^[ and frequent escape-sequence starter "Esc [". */
|
/* Disallow rebinding ^[ and frequent escape-sequence starter "Esc [". */
|
||||||
if (newsc->keycode == ESC_CODE || newsc->keycode == '[') {
|
if (newsc->keycode == ESC_CODE || newsc->keycode == '[') {
|
||||||
|
|
Loading…
Reference in New Issue