Removing the unused parameter 'func_key' from get_shortcut().

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4768 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-04-14 09:22:29 +00:00
parent c8fbc7d1a1
commit 7828a8096e
10 changed files with 36 additions and 41 deletions

View File

@ -1,6 +1,8 @@
2014-04-14 Benno Schulenberg <bensberg@justemail.net>
* src/{proto.h,cut.c,nano.c,text.c}: Remove the unused parameter
'file_bot' from copy_from_filestruct(), and rename the other.
* src/*: Remove the unused parameter 'func_key' from get_shortcut(),
and subsequently from parse_browser_input() and parse_help_input().
2014-04-13 Benno Schulenberg <bensberg@justemail.net>
* proto.h, global.c, rcfile.c: Remove the unused parameter 'menu'

View File

@ -161,8 +161,8 @@ char *do_browser(char *path, DIR *dir)
}
#endif /* !DISABLE_MOUSE */
parse_browser_input(&kbinput, &meta_key, &func_key);
s = get_shortcut(MBROWSER, &kbinput, &meta_key, &func_key);
parse_browser_input(&kbinput, &meta_key);
s = get_shortcut(MBROWSER, &kbinput, &meta_key);
if (!s)
continue;
f = sctofunc((sc *) s);
@ -540,13 +540,12 @@ void browser_init(const char *path, DIR *dir)
}
/* Determine the shortcut key corresponding to the values of kbinput
* (the key itself), meta_key (whether the key is a meta sequence), and
* func_key (whether the key is a function key), if any. In the
* process, convert certain non-shortcut keys into their corresponding
* (the key itself) and meta_key (whether the key is a meta sequence).
* Also convert certain non-shortcut keys into their corresponding
* shortcut keys. */
void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key)
void parse_browser_input(int *kbinput, bool *meta_key)
{
get_shortcut(MBROWSER, kbinput, meta_key, func_key);
get_shortcut(MBROWSER, kbinput, meta_key);
/* Pico compatibility. */
if (!*meta_key) {
@ -830,7 +829,7 @@ int filesearch_init(void)
statusbar(_("Cancelled"));
return -1;
} else {
s = get_shortcut(MBROWSER, &i, &meta_key, &func_key);
s = get_shortcut(MBROWSER, &i, &meta_key);
if (i == -2 || i == 0) {
#ifdef HAVE_REGEX_H
/* Use last_search if answer is an empty string, or

View File

@ -1070,7 +1070,7 @@ void do_insertfile(
ans = mallocstrcpy(ans, answer);
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
s = get_shortcut(currmenu, &i, &meta_key);
#ifndef NANO_TINY
#ifndef DISABLE_MULTIBUFFER
@ -2290,7 +2290,7 @@ bool do_writeout(bool exiting)
break;
} else {
ans = mallocstrcpy(ans, answer);
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
s = get_shortcut(currmenu, &i, &meta_key);
#ifndef DISABLE_BROWSER
if (s && s->scfunc == to_files_void) {

View File

@ -137,8 +137,8 @@ void do_help(void (*refresh_func)(void))
}
#endif
parse_help_input(&kbinput, &meta_key, &func_key);
s = get_shortcut(MHELP, &kbinput, &meta_key, &func_key);
parse_help_input(&kbinput, &meta_key);
s = get_shortcut(MHELP, &kbinput, &meta_key);
if (!s)
continue;
f = sctofunc((sc *) s);
@ -486,13 +486,12 @@ void help_init(void)
}
/* Determine the shortcut key corresponding to the values of kbinput
* (the key itself), meta_key (whether the key is a meta sequence), and
* func_key (whether the key is a function key), if any. In the
* process, convert certain non-shortcut keys into their corresponding
* (the key itself) and meta_key (whether the key is a meta sequence).
* Also convert certain non-shortcut keys into their corresponding
* shortcut keys. */
void parse_help_input(int *kbinput, bool *meta_key, bool *func_key)
void parse_help_input(int *kbinput, bool *meta_key)
{
get_shortcut(MHELP, kbinput, meta_key, func_key);
get_shortcut(MHELP, kbinput, meta_key);
if (!*meta_key) {
switch (*kbinput) {

View File

@ -1616,7 +1616,7 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
#endif
/* Check for a shortcut in the main list. */
s = get_shortcut(MMAIN, &input, meta_key, func_key);
s = get_shortcut(MMAIN, &input, meta_key);
/* If we got a shortcut from the main list, or a "universal"
* edit window shortcut, set have_shortcut to TRUE. */

View File

@ -88,7 +88,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
#endif
/* Check for a shortcut in the current list. */
s = get_shortcut(currmenu, &input, meta_key, func_key);
s = get_shortcut(currmenu, &input, meta_key);
/* If we got a shortcut from the current list, or a "universal"
* statusbar prompt shortcut, set have_shortcut to TRUE. */
@ -975,7 +975,7 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe
&ran_func, &finished, TRUE, refresh_func);
assert(statusbar_x <= strlen(answer));
s = get_shortcut(currmenu, &kbinput, meta_key, func_key);
s = get_shortcut(currmenu, &kbinput, meta_key);
if (s)
if (s->scfunc == do_cancel || s->scfunc == do_enter_void)
@ -1294,7 +1294,7 @@ int do_yesno_prompt(bool all, const char *msg)
currmenu = MYESNO;
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key);
if (s && s->scfunc == do_cancel)
ok = -1;

View File

@ -136,7 +136,7 @@ extern char *homedir;
char *do_browser(char *path, DIR *dir);
char *do_browse_from(const char *inpath);
void browser_init(const char *path, DIR *dir);
void parse_browser_input(int *kbinput, bool *meta_key, bool *func_key);
void parse_browser_input(int *kbinput, bool *meta_key);
void browser_refresh(void);
bool browser_select_filename(const char *needle);
int filesearch_init(void);
@ -367,7 +367,7 @@ void do_help_void(void);
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void help_init(void);
void parse_help_input(int *kbinput, bool *meta_key, bool *func_key);
void parse_help_input(int *kbinput, bool *meta_key);
size_t help_line_len(const char *ptr);
#endif
@ -767,8 +767,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
#ifndef DISABLE_MOUSE
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
#endif
const sc *get_shortcut(int menu, int *kbinput, bool
*meta_key, bool *func_key);
const sc *get_shortcut(int menu, int *kbinput, bool *meta_key);
const sc *first_sc_for(int menu, void (*func)(void));
void blank_line(WINDOW *win, int y, int x, int n);
void blank_titlebar(void);

View File

@ -1042,8 +1042,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
return;
}
s = get_shortcut(currmenu, &i, &meta_key);
s = get_shortcut(currmenu, &i, &meta_key, &func_key);
if (s && s->scfunc == gototext_void) {
/* Keep answer up on the statusbar. */
search_init(TRUE, TRUE);

View File

@ -2289,7 +2289,7 @@ void do_justify(bool full_justify)
* the keystroke and return. */
kbinput = do_input(&meta_key, &func_key, &s_or_t, &ran_func,
&finished, FALSE);
s = get_shortcut(MMAIN, &kbinput, &meta_key, &func_key);
s = get_shortcut(MMAIN, &kbinput, &meta_key);
if (s && s->scfunc == do_uncut_text) {
/* Splice the justify buffer back into the file, but only if we
@ -3243,7 +3243,7 @@ void do_linter(void)
}
kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key);
tmplint = curlint;
if (!s)

View File

@ -1762,21 +1762,16 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
}
#endif /* !DISABLE_MOUSE */
/* Return the shortcut corresponding to the values of kbinput (the key
* itself), meta_key (whether the key is a meta sequence), and func_key
* (whether the key is a function key), if any. The shortcut will be
* the first one in the list (control key, meta key sequence, function
* key, other meta key sequence) for the corresponding function. For
* example, passing in a meta key sequence that corresponds to a
* function with a control key, a function key, and a meta key sequence
* will return the control key corresponding to that function. */
const sc *get_shortcut(int menu, int *kbinput, bool
*meta_key, bool *func_key)
/* Return the shortcut that corresponds to the values of kbinput (the
* key itself) and meta_key (whether the key is a meta sequence). The
* returned shortcut will be the first in the list that corresponds to
* the given sequence. */
const sc *get_shortcut(int menu, int *kbinput, bool *meta_key)
{
sc *s;
#ifdef DEBUG
fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s, func_key = %s\n", *kbinput, *meta_key ? "TRUE" : "FALSE", *func_key ? "TRUE" : "FALSE");
fprintf(stderr, "get_shortcut(): kbinput = %d, meta_key = %s", *kbinput, *meta_key ? "TRUE" : "FALSE");
#endif
/* Check for shortcuts. */
@ -1785,7 +1780,8 @@ const sc *get_shortcut(int menu, int *kbinput, bool
&& ((s->type == META && *meta_key == TRUE && *kbinput == s->seq)
|| (s->type != META && *kbinput == s->seq))) {
#ifdef DEBUG
fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menus %x = %x)\n", s->keystr, *meta_key, menu, s->menu);
fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n",
s->keystr, *meta_key, menu, s->menu);
#endif
return s;
}
@ -1811,7 +1807,7 @@ const subnfunc *getfuncfromkey(WINDOW *win)
if (kbinput == 0)
return NULL;
s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
s = get_shortcut(currmenu, &kbinput, &meta_key);
if (!s)
return NULL;