From 992a70401ec229425ee75b2ad9b731f30d2de391 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 22 Oct 2019 13:32:39 -0600 Subject: Constify command_line_input This changes command_line_input to return a "const char *", which is appropriate because the memory is owned by command_line_input. Then it fixes up the users. I looked at making command_line_input transfer ownership to its caller instead, but this is complicated due to the way read_next_line is called, so I decided against it. Tested by rebuilding. gdb/ChangeLog 2019-11-08 Tom Tromey * top.c (read_command_file): Update. (command_line_input): Make return type const. * python/py-gdb-readline.c: Update. * linespec.c (decode_line_2): Update. * defs.h (command_line_input): Make return type const. * cli/cli-script.c (read_next_line): Make return type const. * ada-lang.c (get_selections): Update. Change-Id: I27e6c9477fd1005ab5b16e0d337e4c015b6e6248 --- gdb/ada-lang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/ada-lang.c') diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 0bddc9e..2935df5 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3273,7 +3273,7 @@ static int get_selections (int *choices, int n_choices, int max_results, int is_all_choice, const char *annotation_suffix) { - char *args; + const char *args; const char *prompt; int n_chosen; int first_choice = is_all_choice ? 2 : 1; -- cgit v1.1