Not bothering to pass around a function when it's used only once.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5361 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-08-16 09:28:33 +00:00
parent 427eff6780
commit 7a1959fb11
3 changed files with 14 additions and 13 deletions

View File

@ -3,6 +3,8 @@
in the help screens: wrap them at 74 columns if the screen is wider.
* src/help.c (help_init): Reduce the scope of a variable.
* src/help.c: Adjust some comments and whitespace.
* src/help.c (do_help, do_help_void): Don't bother passing a function
when it's used only once.
2015-08-13 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_find_bracket): Remove mistaken comparison between

View File

@ -36,9 +36,8 @@ static char *end_of_intro = NULL;
/* The point in the help text where the introductory paragraphs end
* and the shortcut descriptions begin. */
/* Our main help browser function. refresh_func is the function we will
* call to refresh the edit window. */
void do_help(void (*refresh_func)(void))
/* Our main help-viewer function. */
void do_help(void)
{
int kbinput = ERR;
bool old_no_help = ISSET(NO_HELP);
@ -176,7 +175,13 @@ void do_help(void (*refresh_func)(void))
bottombars(oldmenu);
curs_set(1);
refresh_func();
#ifndef DISABLE_BROWSER
if (oldmenu == MBROWSER || oldmenu == MWHEREISFILE || oldmenu == MGOTODIR)
browser_refresh();
else
#endif
edit_refresh();
/* The help_init() at the beginning allocated help_text. Since
* help_text has now been written to the screen, we don't need it
@ -522,17 +527,11 @@ size_t help_line_len(const char *ptr)
#endif /* !DISABLE_HELP */
/* Start the help browser. */
/* Start the help viewer. */
void do_help_void(void)
{
#ifndef DISABLE_HELP
/* Start the help browser, with the correct refresher for afterwards. */
#ifndef DISABLE_BROWSER
if (currmenu == MBROWSER || currmenu == MWHEREISFILE || currmenu == MGOTODIR)
do_help(&browser_refresh);
else
#endif
do_help(&edit_refresh);
do_help();
#else
if (currmenu == MMAIN)
say_there_is_no_help();

View File

@ -374,7 +374,7 @@ void thanks_for_all_the_fish(void);
/* All functions in help.c. */
#ifndef DISABLE_HELP
void do_help(void (*refresh_func)(void));
void do_help(void);
void help_init(void);
functionptrtype parse_help_input(int *kbinput);
size_t help_line_len(const char *ptr);