diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-06-08 00:52:56 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-06-08 00:52:56 +0000 |
commit | 53904c9e670da0974aebfb6cdaa30e9c55876508 (patch) | |
tree | 05ca51eb0b7848a88993468318da40d301819565 /gdb/command.c | |
parent | 150f24a284293f28cc74a5469fb5d4b242336154 (diff) | |
download | gdb-53904c9e670da0974aebfb6cdaa30e9c55876508.zip gdb-53904c9e670da0974aebfb6cdaa30e9c55876508.tar.gz gdb-53904c9e670da0974aebfb6cdaa30e9c55876508.tar.bz2 |
Change signature of function add_set_enum_cmd() so that it uses
constant character pointers. Update everything.
As a consequence fix infrun's follow-fork plugging a small memory leak.
Diffstat (limited to 'gdb/command.c')
-rw-r--r-- | gdb/command.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/command.c b/gdb/command.c index ec67d96..d9284cd 100644 --- a/gdb/command.c +++ b/gdb/command.c @@ -315,8 +315,8 @@ add_set_cmd (char *name, struct cmd_list_element * add_set_enum_cmd (char *name, enum command_class class, - char *enumlist[], - char **var, + const char *enumlist[], + const char **var, char *doc, struct cmd_list_element **list) { @@ -1470,17 +1470,16 @@ complete_on_cmdlist (list, text, word) "oobar"; if WORD is "baz/foo", return "baz/foobar". */ char ** -complete_on_enum (enumlist, text, word) - char **enumlist; - char *text; - char *word; +complete_on_enum (const char *enumlist[], + char *text, + char *word) { char **matchlist; int sizeof_matchlist; int matches; int textlen = strlen (text); int i; - char *name; + const char *name; sizeof_matchlist = 10; matchlist = (char **) xmalloc (sizeof_matchlist * sizeof (char *)); @@ -1667,7 +1666,7 @@ do_setshow_command (arg, from_tty, c) int i; int len; int nmatches; - char *match = NULL; + const char *match = NULL; char *p; /* if no argument was supplied, print an informative error message */ @@ -1715,7 +1714,7 @@ do_setshow_command (arg, from_tty, c) if (nmatches > 1) error ("Ambiguous item \"%s\".", arg); - *(char **) c->var = match; + *(const char **) c->var = match; } break; default: |