This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] fix -Werrors from new readline
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 8 Dec 2002 19:55:48 -0500
- Subject: [PATCH] fix -Werrors from new readline
I found a few more places that needed to be updated for readline 4.3.
Committed.
Elena
2002-12-08 Elena Zannoni <ezannoni@redhat.com>
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 <readline/readline.h>.
* 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 <readline/readline.h>.
Index: exec.c
===================================================================
RCS file: /cvs/uberbaum/gdb/exec.c,v
retrieving revision 1.21
diff -u -p -r1.21 exec.c
--- exec.c 30 Nov 2002 16:33:55 -0000 1.21
+++ exec.c 9 Dec 2002 00:53:10 -0000
@@ -36,6 +36,7 @@
#endif
#include <fcntl.h>
+#include <readline/readline.h>
#include "gdb_string.h"
#include "gdbcore.h"
Index: top.c
===================================================================
RCS file: /cvs/uberbaum/gdb/top.c,v
retrieving revision 1.68
diff -u -p -r1.68 top.c
--- top.c 26 Sep 2002 17:46:04 -0000 1.68
+++ top.c 9 Dec 2002 00:53:12 -0000
@@ -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 ();
Index: symmisc.c
===================================================================
RCS file: /cvs/uberbaum/gdb/symmisc.c,v
retrieving revision 1.12
diff -u -p -r1.12 symmisc.c
--- symmisc.c 29 Jul 2002 22:55:26 -0000 1.12
+++ symmisc.c 9 Dec 2002 00:53:13 -0000
@@ -34,6 +34,7 @@
#include "bcache.h"
#include "gdb_string.h"
+#include <readline/readline.h>
#ifndef DEV_TTY
#define DEV_TTY "/dev/tty"
Index: symfile.c
===================================================================
RCS file: /cvs/uberbaum/gdb/symfile.c,v
retrieving revision 1.74
diff -u -p -r1.74 symfile.c
--- symfile.c 25 Nov 2002 21:00:51 -0000 1.74
+++ symfile.c 9 Dec 2002 00:53:16 -0000
@@ -42,6 +42,7 @@
#include "gdb_obstack.h"
#include "completer.h"
#include "bcache.h"
+#include <readline/readline.h>
#include <sys/types.h>
#include <fcntl.h>
Index: source.c
===================================================================
RCS file: /cvs/uberbaum/gdb/source.c,v
retrieving revision 1.36
diff -u -p -r1.36 source.c
--- source.c 24 Oct 2002 21:02:53 -0000 1.36
+++ source.c 9 Dec 2002 00:53:17 -0000
@@ -44,6 +44,7 @@
#include "filenames.h" /* for DOSish file names */
#include "completer.h"
#include "ui-out.h"
+#include <readline/readline.h>
#ifdef CRLF_SOURCE_FILES
Index: solib.c
===================================================================
RCS file: /cvs/uberbaum/gdb/solib.c,v
retrieving revision 1.50
diff -u -p -r1.50 solib.c
--- solib.c 12 May 2002 04:20:06 -0000 1.50
+++ solib.c 9 Dec 2002 00:53:18 -0000
@@ -42,6 +42,7 @@
#include "filenames.h" /* for DOSish file names */
#include "solist.h"
+#include <readline/readline.h>
/* external data declarations */
Index: corelow.c
===================================================================
RCS file: /cvs/uberbaum/gdb/corelow.c,v
retrieving revision 1.26
diff -u -p -r1.26 corelow.c
--- corelow.c 30 Nov 2002 16:33:55 -0000 1.26
+++ corelow.c 9 Dec 2002 00:53:18 -0000
@@ -38,6 +38,7 @@
#include "gdbthread.h"
#include "regcache.h"
#include "symfile.h"
+#include <readline/readline.h>
#ifndef O_BINARY
#define O_BINARY 0
Index: completer.c
===================================================================
RCS file: /cvs/uberbaum/gdb/completer.c,v
retrieving revision 1.12
diff -u -p -r1.12 completer.c
--- completer.c 20 Nov 2002 08:58:01 -0000 1.12
+++ completer.c 9 Dec 2002 00:53:19 -0000
@@ -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/readline.h>
/* 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 *wo
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 *wor
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_bu
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 */
Index: completer.h
===================================================================
RCS file: /cvs/uberbaum/gdb/completer.h,v
retrieving revision 1.7
diff -u -p -r1.7 completer.h
--- completer.h 20 Nov 2002 08:58:01 -0000 1.7
+++ completer.h 9 Dec 2002 00:53:19 -0000
@@ -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 *);
Index: cli/cli-dump.c
===================================================================
RCS file: /cvs/uberbaum/gdb/cli/cli-dump.c,v
retrieving revision 1.6
diff -u -p -r1.6 cli-dump.c
--- cli/cli-dump.c 9 Aug 2002 16:36:10 -0000 1.6
+++ cli/cli-dump.c 9 Dec 2002 00:53:20 -0000
@@ -31,6 +31,7 @@
#include "gdb_assert.h"
#include <ctype.h>
#include "target.h"
+#include <readline/readline.h>
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))