]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/completion: make completion_find_completion_word static
authorAndrew Burgess <aburgess@redhat.com>
Tue, 13 Feb 2024 12:19:00 +0000 (12:19 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 25 Mar 2024 17:47:44 +0000 (17:47 +0000)
I noticed that completion_find_completion_word is only used within
completer.c, so lets make it static.

There should be no user visible changes after this commit.

gdb/completer.c
gdb/completer.h

index 04354120621a297196f320961c4946e7c330897b..2fee90503dbefd9cb51fd09b4f4b780263f31dce 100644 (file)
 
 #include "completer.h"
 
+/* Forward declarations.  */
+static const char *completion_find_completion_word (completion_tracker &tracker,
+                                                   const char *text,
+                                                   int *quote_char);
+
 /* See completer.h.  */
 
 class completion_tracker::completion_hash_entry
@@ -1955,9 +1960,14 @@ gdb_completion_word_break_characters ()
   return NULL;
 }
 
-/* See completer.h.  */
+/* Find the bounds of the word in TEXT for completion purposes, and return
+   a pointer to the end of the word.  Calls the completion machinery for a
+   handle_brkchars phase (using TRACKER) to figure out the right work break
+   characters for the command in TEXT.  QUOTE_CHAR, if non-null, is set to
+   the opening quote character if we found an unclosed quoted substring,
+   '\0' otherwise.  */
 
-const char *
+static const char *
 completion_find_completion_word (completion_tracker &tracker, const char *text,
                                 int *quote_char)
 {
index 0a95ced8a80fa0e940b382ee650c49c9119707ff..9011ba778a7d32dccc208d0cc83c3e76f01acc66 100644 (file)
@@ -556,17 +556,6 @@ extern void complete_line (completion_tracker &tracker,
 extern completion_result
   complete (const char *line, char const **word, int *quote_char);
 
-/* Find the bounds of the word in TEXT for completion purposes, and
-   return a pointer to the end of the word.  Calls the completion
-   machinery for a handle_brkchars phase (using TRACKER) to figure out
-   the right work break characters for the command in TEXT.
-   QUOTE_CHAR, if non-null, is set to the opening quote character if
-   we found an unclosed quoted substring, '\0' otherwise.  */
-extern const char *completion_find_completion_word (completion_tracker &tracker,
-                                                   const char *text,
-                                                   int *quote_char);
-
-
 /* Assuming TEXT is an expression in the current language, find the
    completion word point for TEXT, emulating the algorithm readline
    uses to find the word point, using the current language's word