[05/13] constify monitor_open

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

Commit Message

Tom Tromey July 22, 2014, 6:55 p.m. UTC
  This constifies an argument to monitor_open.

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

	* monitor.c (monitor_open): Make "args" const.
	* monitor.h (monitor_open): Update.
---
 gdb/ChangeLog | 5 +++++
 gdb/monitor.c | 2 +-
 gdb/monitor.h | 3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)
  

Comments

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

Thanks,
Pedro Alves

On 07/22/2014 07:55 PM, Tom Tromey wrote:
> This constifies an argument to monitor_open.
> 
> 2014-07-22  Tom Tromey  <tromey@redhat.com>
> 
> 	* monitor.c (monitor_open): Make "args" const.
> 	* monitor.h (monitor_open): Update.
> ---
>  gdb/ChangeLog | 5 +++++
>  gdb/monitor.c | 2 +-
>  gdb/monitor.h | 3 ++-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/monitor.c b/gdb/monitor.c
> index 61f0dff..788bca0 100644
> --- a/gdb/monitor.c
> +++ b/gdb/monitor.c
> @@ -713,7 +713,7 @@ compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern,
>     for communication.  */
>  
>  void
> -monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
> +monitor_open (const char *args, struct monitor_ops *mon_ops, int from_tty)
>  {
>    char *name;
>    char **p;
> diff --git a/gdb/monitor.h b/gdb/monitor.h
> index 07caf97..52521c8 100644
> --- a/gdb/monitor.h
> +++ b/gdb/monitor.h
> @@ -239,7 +239,8 @@ struct monitor_ops
>  
>  #define SREC_SIZE 160
>  
> -extern void monitor_open (char *args, struct monitor_ops *ops, int from_tty);
> +extern void monitor_open (const char *args, struct monitor_ops *ops,
> +			  int from_tty);
>  extern void monitor_close (struct target_ops *self);
>  extern char *monitor_supply_register (struct regcache *regcache,
>  				      int regno, char *valstr);
>
  

Patch

diff --git a/gdb/monitor.c b/gdb/monitor.c
index 61f0dff..788bca0 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -713,7 +713,7 @@  compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern,
    for communication.  */
 
 void
-monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty)
+monitor_open (const char *args, struct monitor_ops *mon_ops, int from_tty)
 {
   char *name;
   char **p;
diff --git a/gdb/monitor.h b/gdb/monitor.h
index 07caf97..52521c8 100644
--- a/gdb/monitor.h
+++ b/gdb/monitor.h
@@ -239,7 +239,8 @@  struct monitor_ops
 
 #define SREC_SIZE 160
 
-extern void monitor_open (char *args, struct monitor_ops *ops, int from_tty);
+extern void monitor_open (const char *args, struct monitor_ops *ops,
+			  int from_tty);
 extern void monitor_close (struct target_ops *self);
 extern char *monitor_supply_register (struct regcache *regcache,
 				      int regno, char *valstr);