From e9e7f7240542809f82286e4043ca05409dc761a9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 21 Jul 2014 20:57:15 -0600 Subject: [PATCH] constify target fields This constifies the target_ops fields to_shortname, to_longname, and to_doc. 2014-07-24 Tom Tromey * monitor.c (compile_pattern): Update. * target.h (struct target_ops) : Now const. --- gdb/ChangeLog | 6 ++++++ gdb/monitor.c | 2 +- gdb/target.h | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e35d49b..b0c79b5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2014-07-24 Tom Tromey + * monitor.c (compile_pattern): Update. + * target.h (struct target_ops) : Now const. + +2014-07-24 Tom Tromey + * cli/cli-decode.c (add_cmd, add_prefix_cmd) (add_abbrev_prefix_cmd, add_set_or_show_cmd, add_info) (add_info_alias, add_com): Make "doc" const. diff --git a/gdb/monitor.c b/gdb/monitor.c index 788bca0..6767197 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -715,7 +715,7 @@ compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern, void monitor_open (const char *args, struct monitor_ops *mon_ops, int from_tty) { - char *name; + const char *name; char **p; struct inferior *inf; diff --git a/gdb/target.h b/gdb/target.h index e4aade7..bcf97d9 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -394,9 +394,9 @@ typedef void async_callback_ftype (enum inferior_event_type event_type, struct target_ops { struct target_ops *beneath; /* To the target under this one. */ - char *to_shortname; /* Name this target type */ - char *to_longname; /* Name for printing */ - char *to_doc; /* Documentation. Does not include trailing + const char *to_shortname; /* Name this target type */ + const char *to_longname; /* Name for printing */ + const char *to_doc; /* Documentation. Does not include trailing newline, and starts with a one-line descrip- tion (probably similar to to_longname). */ /* Per-target scratch pad. */ -- 2.7.4