From 429e55ea941f54f8e0481dd2048dc15af751ed71 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 21 Jul 2014 20:37:34 -0600 Subject: constify deprecate_cmd This constifies deprecate_cmd and the "replacement" field in struct cmd_list_element. 2014-07-24 Tom Tromey * cli/cli-decode.c (deprecate_cmd): Make "replacement" const. * cli/cli-decode.h (struct cmd_list_element) : Now const. * command.h (deprecate_cmd): Update. * maint.c (maintenance_do_deprecate): Add casts. --- gdb/cli/cli-decode.c | 2 +- gdb/cli/cli-decode.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/cli') diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index fcd4ceb..a08cc45 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -261,7 +261,7 @@ add_cmd (const char *name, enum command_class class, cmd_cfunc_ftype *fun, 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; diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h index 48ed604..9cd887d 100644 --- a/gdb/cli/cli-decode.h +++ b/gdb/cli/cli-decode.h @@ -135,7 +135,7 @@ struct cmd_list_element show_value_ftype *show_value_func; /* If this command is deprecated, this is the replacement name. */ - char *replacement; + const char *replacement; /* If this command represents a show command, then this function is called before the variable's value is examined. */ -- cgit v1.1