From 0371dd1bde944c2a51764c11fc97289d350ae577 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 13 Jun 2021 12:14:35 +0200 Subject: [PATCH] tweaks: rename two functions, to get rid of an ugly _void suffix Also drop an unneeded prototype. --- src/global.c | 8 ++++---- src/prototypes.h | 3 +-- src/rcfile.c | 2 +- src/text.c | 8 ++++---- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/global.c b/src/global.c index 7998e2b3..6e03260f 100644 --- a/src/global.c +++ b/src/global.c @@ -776,7 +776,7 @@ void shortcut_init(void) CAN_OPEN_OTHER_BUFFER); #ifdef ENABLE_JUSTIFY else - add_to_funcs(do_justify_void, MMAIN, + add_to_funcs(do_justify, MMAIN, N_("Justify"), WITHORSANS(justify_gist), BLANKAFTER, NOVIEW); #endif @@ -815,7 +815,7 @@ void shortcut_init(void) N_("Execute"), WITHORSANS(execute_gist), TOGETHER, NOVIEW); #endif #ifdef ENABLE_JUSTIFY - add_to_funcs(do_justify_void, MMAIN, + add_to_funcs(do_justify, MMAIN, N_("Justify"), WITHORSANS(justify_gist), BLANKAFTER, NOVIEW); #endif } @@ -1226,7 +1226,7 @@ void shortcut_init(void) add_to_sclist(MMAIN, "^T", 0, do_execute, 0); #endif #ifdef ENABLE_JUSTIFY - add_to_sclist(MMAIN, "^J", '\n', do_justify_void, 0); + add_to_sclist(MMAIN, "^J", '\n', do_justify, 0); #endif #ifdef ENABLE_SPELLER add_to_sclist(MEXECUTE, "^S", 0, do_spell, 0); @@ -1514,7 +1514,7 @@ void shortcut_init(void) add_to_sclist(MMAIN|MBROWSER|MHELP, "F2", KEY_F(2), do_exit, 0); add_to_sclist(MMAIN, "F3", KEY_F(3), do_writeout_void, 0); #ifdef ENABLE_JUSTIFY - add_to_sclist(MMAIN, "F4", KEY_F(4), do_justify_void, 0); + add_to_sclist(MMAIN, "F4", KEY_F(4), do_justify, 0); #endif add_to_sclist(MMAIN, "F5", KEY_F(5), do_insertfile_void, 0); add_to_sclist(MMAIN|MBROWSER|MHELP, "F6", KEY_F(6), do_search_forward, 0); diff --git a/src/prototypes.h b/src/prototypes.h index a697b43f..07f8f75e 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -507,8 +507,7 @@ size_t indent_length(const char *line); size_t quote_length(const char *line); bool begpar(const linestruct *const line, int depth); bool inpar(const linestruct *const line); -void do_justify(bool full_justify); -void do_justify_void(void); +void do_justify(void); void do_full_justify(void); #endif #ifdef ENABLE_SPELLER diff --git a/src/rcfile.c b/src/rcfile.c index ea0e1f7e..6b77b810 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -291,7 +291,7 @@ keystruct *strtosc(const char *input) s->func = do_gotolinecolumn_void; #ifdef ENABLE_JUSTIFY else if (!strcmp(input, "justify")) - s->func = do_justify_void; + s->func = do_justify; else if (!strcmp(input, "fulljustify")) s->func = do_full_justify; else if (!strcmp(input, "beginpara")) diff --git a/src/text.c b/src/text.c index aa04f2ce..5a7547cf 100644 --- a/src/text.c +++ b/src/text.c @@ -1709,7 +1709,7 @@ void justify_paragraph(linestruct **line, size_t count) /* Justify the current paragraph, or the entire buffer when full_justify is * TRUE. But if the mark is on, justify only the marked text instead. */ -void do_justify(bool full_justify) +void justify_text(bool full_justify) { size_t linecount; /* The number of lines in the original paragraph. */ @@ -1979,15 +1979,15 @@ void do_justify(bool full_justify) } /* Justify the current paragraph. */ -void do_justify_void(void) +void do_justify(void) { - do_justify(ONE_PARAGRAPH); + justify_text(ONE_PARAGRAPH); } /* Justify the entire file. */ void do_full_justify(void) { - do_justify(WHOLE_BUFFER); + justify_text(WHOLE_BUFFER); ran_a_tool = TRUE; } #endif /* ENABLE_JUSTIFY */