[09/13] constify help_cmd

Message ID 1406055319-26380-10-git-send-email-tromey@redhat.com
State Committed
Headers

Commit Message

Tom Tromey July 22, 2014, 6:55 p.m. UTC
  This constifies help_cmd.

2014-07-22  Tom Tromey  <tromey@redhat.com>

	* cli/cli-decode.c (help_cmd): Make parameter "const".
	* cli/cli-decode.h (help_cmd): Update.
---
 gdb/ChangeLog        | 5 +++++
 gdb/cli/cli-decode.c | 3 +--
 gdb/cli/cli-decode.h | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)
  

Comments

Pedro Alves July 24, 2014, 1:51 a.m. UTC | #1
Looks good.

Thanks,
Pedro Alves

On 07/22/2014 07:55 PM, Tom Tromey wrote:
> This constifies help_cmd.
> 
> 2014-07-22  Tom Tromey  <tromey@redhat.com>
> 
> 	* cli/cli-decode.c (help_cmd): Make parameter "const".
> 	* cli/cli-decode.h (help_cmd): Update.
> ---
>  gdb/ChangeLog        | 5 +++++
>  gdb/cli/cli-decode.c | 3 +--
>  gdb/cli/cli-decode.h | 2 +-
>  3 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
> index f09b777..fcd4ceb 100644
> --- a/gdb/cli/cli-decode.c
> +++ b/gdb/cli/cli-decode.c
> @@ -936,10 +936,9 @@ apropos_cmd (struct ui_file *stream,
>     help_list.  */
>  
>  void
> -help_cmd (char *arg, struct ui_file *stream)
> +help_cmd (const char *command, struct ui_file *stream)
>  {
>    struct cmd_list_element *c;
> -  const char *command = arg;
>  
>    if (!command)
>      {
> diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
> index c6edc87..48ed604 100644
> --- a/gdb/cli/cli-decode.h
> +++ b/gdb/cli/cli-decode.h
> @@ -216,7 +216,7 @@ extern void help_cmd_list (struct cmd_list_element *, enum command_class,
>  
>  /* Functions that implement commands about CLI commands.  */
>  
> -extern void help_cmd (char *, struct ui_file *);
> +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 *);
>
  

Patch

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index f09b777..fcd4ceb 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -936,10 +936,9 @@  apropos_cmd (struct ui_file *stream,
    help_list.  */
 
 void
-help_cmd (char *arg, struct ui_file *stream)
+help_cmd (const char *command, struct ui_file *stream)
 {
   struct cmd_list_element *c;
-  const char *command = arg;
 
   if (!command)
     {
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index c6edc87..48ed604 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -216,7 +216,7 @@  extern void help_cmd_list (struct cmd_list_element *, enum command_class,
 
 /* Functions that implement commands about CLI commands.  */
 
-extern void help_cmd (char *, struct ui_file *);
+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 *);