From ccabaac5a035f4caf352bc0b422071129595b666 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 29 Aug 2022 08:44:28 +0200 Subject: [PATCH] build: exclude two unneeded functions correctly from the tiny version This also amends commit 4f9abb52 from yesterday -- I don't know how I managed to overlook the warning. :/ --- src/prototypes.h | 4 +++- src/search.c | 2 ++ src/utils.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/prototypes.h b/src/prototypes.h index 0390f6a5..03ae8fa6 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -469,7 +469,9 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only, const linestruct *real_current, size_t *real_current_x); void do_replace(void); void ask_for_and_do_replacements(void); +#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined (ENABLE_LINTER) || defined (ENABLE_FORMATTER) void goto_line_posx(ssize_t line, size_t pos_x); +#endif void goto_line_and_column(ssize_t line, ssize_t column, bool retain_answer, bool interactive); void do_gotolinecolumn(void); @@ -572,7 +574,7 @@ void get_region(linestruct **top, size_t *top_x, linestruct **bot, size_t *bot_x void get_range(linestruct **top, linestruct **bot); #endif size_t number_of_characters_in(const linestruct *begin, const linestruct *end); -#ifndef NANO_TINY +#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined (ENABLE_LINTER) || defined (ENABLE_FORMATTER) linestruct *line_from_number(ssize_t number); #endif diff --git a/src/search.c b/src/search.c index d1583eba..4d12138f 100644 --- a/src/search.c +++ b/src/search.c @@ -736,6 +736,7 @@ void ask_for_and_do_replacements(void) "Replaced %zd occurrences", numreplaced), numreplaced); } +#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined (ENABLE_LINTER) || defined (ENABLE_FORMATTER) /* Go to the specified line and x position. */ void goto_line_posx(ssize_t linenumber, size_t pos_x) { @@ -751,6 +752,7 @@ void goto_line_posx(ssize_t linenumber, size_t pos_x) refresh_needed = TRUE; } +#endif /* Go to the specified line and column, or ask for them if interactive * is TRUE. In the latter case also update the screen afterwards. diff --git a/src/utils.c b/src/utils.c index 661a35ca..f1bd5c96 100644 --- a/src/utils.c +++ b/src/utils.c @@ -486,6 +486,7 @@ void get_range(linestruct **top, linestruct **bot) } #endif /* !NANO_TINY */ +#if !defined(NANO_TINY) || defined(ENABLE_SPELLER) || defined (ENABLE_LINTER) || defined (ENABLE_FORMATTER) /* Return a pointer to the line that has the given line number. */ linestruct *line_from_number(ssize_t number) { @@ -500,6 +501,7 @@ linestruct *line_from_number(ssize_t number) return line; } +#endif /* Count the number of characters from begin to end, and return it. */ size_t number_of_characters_in(const linestruct *begin, const linestruct *end)