forked from Imagelibrary/binutils-gdb
constify command prefix
This constifies the "prefix" argument to the various command-adding functions. 2014-07-24 Tom Tromey <tromey@redhat.com> * cli/cli-decode.c (print_help_for_command): Make "prefix" const. (add_prefix_cmd, add_abbrev_prefix_cmd, apropos_cmd, help_list) (help_cmd_list): Constify. (lookup_cmd): Update. * cli/cli-decode.h (struct cmd_list_element) <prefixname>: Now const. (help_cmd_list, apropos_cmd): Update. * cli/cli-script.c (show_user): Update. * cli/cli-setshow.c (cmd_show_list): Make "prefix" const. * cli/cli-setshow.h (cmd_show_list): Update. * command.h (add_prefix_cmd, add_abbrev_prefix_cmd, help_list) (cmd_show_list): Update. * guile/scm-cmd.c (cmdscm_destroyer): Update. * python/py-cmd.c (cmdpy_destroyer): Update.
This commit is contained in:
@@ -156,7 +156,7 @@ struct cmd_list_element
|
||||
plus any others needed to get to it. Should end in a space.
|
||||
It is used before the word "command" in describing the
|
||||
commands reached through this prefix. */
|
||||
char *prefixname;
|
||||
const char *prefixname;
|
||||
|
||||
/* The prefix command of this command. */
|
||||
struct cmd_list_element *prefix;
|
||||
@@ -212,14 +212,14 @@ struct cmd_list_element
|
||||
};
|
||||
|
||||
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
|
||||
char *, int, struct ui_file *);
|
||||
const char *, int, struct ui_file *);
|
||||
|
||||
/* Functions that implement commands about CLI commands. */
|
||||
|
||||
extern void help_cmd (const char *, struct ui_file *);
|
||||
|
||||
extern void apropos_cmd (struct ui_file *, struct cmd_list_element *,
|
||||
struct re_pattern_buffer *, char *);
|
||||
struct re_pattern_buffer *, const char *);
|
||||
|
||||
/* Used to mark commands that don't do anything. If we just leave the
|
||||
function field NULL, the command is interpreted as a help topic, or
|
||||
|
||||
Reference in New Issue
Block a user