[RFA,2/8] Constify add_com_suppress_notification

Message ID 20171013205950.22943-3-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Oct. 13, 2017, 8:59 p.m. UTC
  This constifies add_com_suppress_notification and fixes the one
caller.

gdb/ChangeLog
2017-10-13  Tom Tromey  <tom@tromey.com>

	* stack.c (select_frame_command): Constify.
	* cli/cli-decode.c (struct cmd_list_element): Constify.
	* command.h (add_com_suppress_notification): Constify.
---
 gdb/ChangeLog        | 6 ++++++
 gdb/cli/cli-decode.c | 2 +-
 gdb/command.h        | 2 +-
 gdb/stack.c          | 2 +-
 gdb/stack.h          | 2 +-
 5 files changed, 10 insertions(+), 4 deletions(-)
  

Comments

Yao Qi Oct. 16, 2017, 9:03 a.m. UTC | #1
Tom Tromey <tom@tromey.com> writes:

> gdb/ChangeLog
> 2017-10-13  Tom Tromey  <tom@tromey.com>
>
> 	* stack.c (select_frame_command): Constify.
> 	* cli/cli-decode.c (struct cmd_list_element): Constify.

s/struct cmd_list_element/add_com_suppress_notification/ ?

> 	* command.h (add_com_suppress_notification): Constify.

Patch is good to me.
  
Tom Tromey Oct. 16, 2017, 3:55 p.m. UTC | #2
>>>>> "Yao" == Yao Qi <qiyaoltc@gmail.com> writes:

Yao> Tom Tromey <tom@tromey.com> writes:
>> gdb/ChangeLog
>> 2017-10-13  Tom Tromey  <tom@tromey.com>
>> 
>> * stack.c (select_frame_command): Constify.
>> * cli/cli-decode.c (struct cmd_list_element): Constify.

Yao> s/struct cmd_list_element/add_com_suppress_notification/ ?

Yes, thanks.  I've fixed this locally.

Tom
  

Patch

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 5fc3187001..f66bb2a3d8 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -950,7 +950,7 @@  add_com_alias (const char *name, const char *oldname, enum command_class theclas
 
 struct cmd_list_element *
 add_com_suppress_notification (const char *name, enum command_class theclass,
-			       cmd_cfunc_ftype *fun, const char *doc,
+			       cmd_const_cfunc_ftype *fun, const char *doc,
 			       int *suppress_notification)
 {
   struct cmd_list_element *element;
diff --git a/gdb/command.h b/gdb/command.h
index 71ad71d953..c7922a0c3a 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -274,7 +274,7 @@  extern struct cmd_list_element *add_com_alias (const char *, const char *,
 
 extern struct cmd_list_element *add_com_suppress_notification
 		       (const char *name, enum command_class theclass,
-			cmd_cfunc_ftype *fun, const char *doc,
+			cmd_const_cfunc_ftype *fun, const char *doc,
 			int *supress_notification);
 
 extern struct cmd_list_element *add_info (const char *,
diff --git a/gdb/stack.c b/gdb/stack.c
index 4e40e32283..4de3675bc5 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2270,7 +2270,7 @@  find_relative_frame (struct frame_info *frame, int *level_offset_ptr)
    expressions.  */
 
 void
-select_frame_command (char *level_exp, int from_tty)
+select_frame_command (const char *level_exp, int from_tty)
 {
   struct frame_info *prev_frame = get_selected_frame_if_set ();
 
diff --git a/gdb/stack.h b/gdb/stack.h
index 3379318cca..563229fea4 100644
--- a/gdb/stack.h
+++ b/gdb/stack.h
@@ -20,7 +20,7 @@ 
 #ifndef STACK_H
 #define STACK_H
 
-void select_frame_command (char *level_exp, int from_tty);
+void select_frame_command (const char *level_exp, int from_tty);
 
 gdb::unique_xmalloc_ptr<char> find_frame_funname (struct frame_info *frame,
 						  enum language *funlang,