From: Elena Zannoni Date: Mon, 9 Dec 2002 00:59:27 +0000 (+0000) Subject: 2002-12-08 Elena Zannoni X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=38017ce81c4c5f3853b46c0d497e4bcefdbac593;p=deliverable%2Fbinutils-gdb.git 2002-12-08 Elena Zannoni More cleanup from import of readline 4.3. * completer.h (complete_line, readline_line_completion_function): Update prototypes. (line_completion_function): Removed, not used outside of completer.c. * completer.c (readline_line_completion_function, complete_function, line_completion_function): Use const for first parameter. (line_completion_function): Make static. (filename_completer): filename_completion_function is now called rl_filename_completion_function * corelow.c: Include . * exec.c: Ditto. * solib.c: Ditto. * source.c: Ditto. * symfile.c: Ditto. * symmisc.c: Ditto. * top.c (init_main): No need to coerce readline_line_completion_function anymore. * cli/cli-dump.c: Include . --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 630e43ea68..a4bca63701 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,25 @@ +2002-12-08 Elena Zannoni + + More cleanup from import of readline 4.3. + * completer.h (complete_line, readline_line_completion_function): + Update prototypes. + (line_completion_function): Removed, not used outside of completer.c. + * completer.c (readline_line_completion_function, + complete_function, line_completion_function): Use const for first + parameter. + (line_completion_function): Make static. + (filename_completer): filename_completion_function is now called + rl_filename_completion_function + * corelow.c: Include . + * exec.c: Ditto. + * solib.c: Ditto. + * source.c: Ditto. + * symfile.c: Ditto. + * symmisc.c: Ditto. + * top.c (init_main): No need to coerce + readline_line_completion_function anymore. + * cli/cli-dump.c: Include . + 2002-12-08 Andrew Cagney * stack.c (frame_info): Use get_prev_frame. diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index a648093dd4..7a58fcbbd7 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -31,6 +31,7 @@ #include "gdb_assert.h" #include #include "target.h" +#include #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) diff --git a/gdb/completer.c b/gdb/completer.c index 7fa1759489..4274241b00 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -31,7 +31,7 @@ #include "gdbcmd.h" /* Needed for rl_completer_word_break_characters() and for - filename_completion_function. */ + rl_filename_completion_function. */ #include /* readline defines this. */ @@ -40,7 +40,8 @@ #include "completer.h" /* Prototypes for local functions */ -char *line_completion_function (char *text, int matches, char *line_buffer, +static +char *line_completion_function (const char *text, int matches, char *line_buffer, int point); /* readline uses the word breaks for two things: @@ -104,7 +105,7 @@ get_gdb_completer_quote_characters (void) /* Line completion interface function for readline. */ char * -readline_line_completion_function (char *text, int matches) +readline_line_completion_function (const char *text, int matches) { return line_completion_function (text, matches, rl_line_buffer, rl_point); } @@ -135,7 +136,7 @@ filename_completer (char *text, char *word) while (1) { char *p; - p = filename_completion_function (text, subsequent_name); + p = rl_filename_completion_function (text, subsequent_name); if (return_val_used >= return_val_alloced) { return_val_alloced *= 2; @@ -382,7 +383,7 @@ command_completer (char *text, char *word) should pretend that the line ends at POINT. */ char ** -complete_line (char *text, char *line_buffer, int point) +complete_line (const char *text, char *line_buffer, int point) { char **list = NULL; char *tmp_command, *p; @@ -628,8 +629,8 @@ complete_line (char *text, char *line_buffer, int point) which is a possible completion, it is the caller's responsibility to free the string. */ -char * -line_completion_function (char *text, int matches, char *line_buffer, int point) +static char * +line_completion_function (const char *text, int matches, char *line_buffer, int point) { static char **list = (char **) NULL; /* Cache of completions */ static int index; /* Next cached completion */ diff --git a/gdb/completer.h b/gdb/completer.h index b0362314e7..7a96951aae 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -19,11 +19,9 @@ #if !defined (COMPLETER_H) #define COMPLETER_H 1 -extern char **complete_line (char *text, char *line_buffer, int point); +extern char **complete_line (const char *text, char *line_buffer, int point); -extern char *line_completion_function (char *, int, char *, int); - -extern char *readline_line_completion_function (char *text, int matches); +extern char *readline_line_completion_function (const char *text, int matches); extern char **noop_completer (char *, char *); diff --git a/gdb/corelow.c b/gdb/corelow.c index edcf46e26b..90ac0627aa 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -38,6 +38,7 @@ #include "gdbthread.h" #include "regcache.h" #include "symfile.h" +#include #ifndef O_BINARY #define O_BINARY 0 diff --git a/gdb/exec.c b/gdb/exec.c index edb730802d..bc9c22b3f0 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -36,6 +36,7 @@ #endif #include +#include #include "gdb_string.h" #include "gdbcore.h" diff --git a/gdb/solib.c b/gdb/solib.c index d4876c15e7..639788b3e5 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -42,6 +42,7 @@ #include "filenames.h" /* for DOSish file names */ #include "solist.h" +#include /* external data declarations */ diff --git a/gdb/source.c b/gdb/source.c index 0107bfa235..be5d90c338 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -44,6 +44,7 @@ #include "filenames.h" /* for DOSish file names */ #include "completer.h" #include "ui-out.h" +#include #ifdef CRLF_SOURCE_FILES diff --git a/gdb/symfile.c b/gdb/symfile.c index 0ede698f3c..f27391aaa2 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -42,6 +42,7 @@ #include "gdb_obstack.h" #include "completer.h" #include "bcache.h" +#include #include #include diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 198b2d632e..87722ba5a0 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -34,6 +34,7 @@ #include "bcache.h" #include "gdb_string.h" +#include #ifndef DEV_TTY #define DEV_TTY "/dev/tty" diff --git a/gdb/top.c b/gdb/top.c index 3d5783fbe8..d25bc3b8a7 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -1952,7 +1952,7 @@ init_main (void) write_history_p = 0; /* Setup important stuff for command line editing. */ - rl_completion_entry_function = (int (*)()) readline_line_completion_function; + rl_completion_entry_function = readline_line_completion_function; rl_completer_word_break_characters = get_gdb_completer_word_break_characters (); rl_completer_quote_characters = get_gdb_completer_quote_characters ();