This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 2/8] Constify add_com_suppress_notification
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Fri, 13 Oct 2017 14:59:44 -0600
- Subject: [RFA 2/8] Constify add_com_suppress_notification
- Authentication-results: sourceware.org; auth=none
- References: <20171013205950.22943-1-tom@tromey.com>
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(-)
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,
--
2.13.6