This constifies deprecate_cmd and the "replacement" field in struct
cmd_list_element.
2014-07-24 Tom Tromey <tromey@redhat.com>
* cli/cli-decode.c (deprecate_cmd): Make "replacement" const.
* cli/cli-decode.h (struct cmd_list_element) <replacement>: Now
const.
* command.h (deprecate_cmd): Update.
* maint.c (maintenance_do_deprecate): Add casts.
2014-07-24 Tom Tromey <tromey@redhat.com>
2014-07-24 Tom Tromey <tromey@redhat.com>
+ * cli/cli-decode.c (deprecate_cmd): Make "replacement" const.
+ * cli/cli-decode.h (struct cmd_list_element) <replacement>: Now
+ const.
+ * command.h (deprecate_cmd): Update.
+ * maint.c (maintenance_do_deprecate): Add casts.
+
+2014-07-24 Tom Tromey <tromey@redhat.com>
+
* cli/cli-decode.c (help_cmd): Make parameter "const".
* cli/cli-decode.h (help_cmd): Update.
* cli/cli-decode.c (help_cmd): Make parameter "const".
* cli/cli-decode.h (help_cmd): Update.
Returns a pointer to the deprecated command. */
struct cmd_list_element *
Returns a pointer to the deprecated command. */
struct cmd_list_element *
-deprecate_cmd (struct cmd_list_element *cmd, char *replacement)
+deprecate_cmd (struct cmd_list_element *cmd, const char *replacement)
{
cmd->cmd_deprecated = 1;
cmd->deprecated_warn_user = 1;
{
cmd->cmd_deprecated = 1;
cmd->deprecated_warn_user = 1;
show_value_ftype *show_value_func;
/* If this command is deprecated, this is the replacement name. */
show_value_ftype *show_value_func;
/* If this command is deprecated, this is the replacement name. */
+ const char *replacement;
/* If this command represents a show command, then this function
is called before the variable's value is examined. */
/* If this command represents a show command, then this function
is called before the variable's value is examined. */
int);
extern struct cmd_list_element *deprecate_cmd (struct cmd_list_element *,
int);
extern struct cmd_list_element *deprecate_cmd (struct cmd_list_element *,
extern void deprecated_cmd_warning (const char *);
extern void deprecated_cmd_warning (const char *);
if (alias)
{
if (alias->malloced_replacement)
if (alias)
{
if (alias->malloced_replacement)
- xfree (alias->replacement);
+ xfree ((char *) alias->replacement);
else if (cmd)
{
if (cmd->malloced_replacement)
else if (cmd)
{
if (cmd->malloced_replacement)
- xfree (cmd->replacement);
+ xfree ((char *) cmd->replacement);