tweaks: elide a function that has become too small for its two calls
Этот коммит содержится в:
родитель
e01e1d8ab5
Коммит
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)
|
||||
s->ordinal = (tailsc->toggle == toggle) ? counter : ++counter;
|
||||
#endif
|
||||
assign_keyinfo(s, scstring, keycode);
|
||||
s->keystr = scstring;
|
||||
s->keycode = (keycode ? keycode : keycode_from_string(scstring));
|
||||
|
||||
tailsc = s;
|
||||
}
|
||||
@ -527,13 +528,6 @@ int keycode_from_string(const char *keystring)
|
||||
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. */
|
||||
/* TRANSLATORS: Try to keep the next two strings at most 10 characters. */
|
||||
const char *exit_tag = N_("Exit");
|
||||
|
@ -334,7 +334,6 @@ size_t shown_entries_for(int menu);
|
||||
const keystruct *get_shortcut(int *kbinput);
|
||||
functionptrtype func_from_key(int *kbinput);
|
||||
int keycode_from_string(const char *keystring);
|
||||
void assign_keyinfo(keystruct *s, const char *keystring, const int keycode);
|
||||
void shortcut_init(void);
|
||||
const char *flagtostr(int flag);
|
||||
|
||||
|
@ -820,7 +820,8 @@ void parse_binding(char *ptr, bool dobind)
|
||||
}
|
||||
|
||||
newsc->menus = menu;
|
||||
assign_keyinfo(newsc, keycopy, keycode);
|
||||
newsc->keystr = keycopy;
|
||||
newsc->keycode = keycode;
|
||||
|
||||
/* Disallow rebinding ^[ and frequent escape-sequence starter "Esc [". */
|
||||
if (newsc->keycode == ESC_CODE || newsc->keycode == '[') {
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user