This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Constify some commands in macrocmd.c
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 27 Sep 2017 14:58:47 -0000
- Subject: [binutils-gdb] Constify some commands in macrocmd.c
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3088cf40a57ec7b5276f192238603684b4608a90
commit 3088cf40a57ec7b5276f192238603684b4608a90
Author: Tom Tromey <tom@tromey.com>
Date: Tue Sep 12 21:22:55 2017 -0600
Constify some commands in macrocmd.c
gdb/ChangeLog
2017-09-27 Tom Tromey <tom@tromey.com>
* macrocmd.c (macro_expand_command, macro_expand_once_command)
(skip_ws, extract_identifier, macro_define_command)
(macro_undef_command, macro_list_command): Constify.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/macrocmd.c | 16 ++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 856a2d8..f9c97e5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2017-09-27 Tom Tromey <tom@tromey.com>
+ * macrocmd.c (macro_expand_command, macro_expand_once_command)
+ (skip_ws, extract_identifier, macro_define_command)
+ (macro_undef_command, macro_list_command): Constify.
+
+2017-09-27 Tom Tromey <tom@tromey.com>
+
* infcmd.c (environment_info, set_environment_command)
(unset_environment_command, path_info, info_proc_cmd_1)
(info_proc_cmd_mappings, info_proc_cmd_stat)
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 957c479..0db43dc 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -53,7 +53,7 @@ macro_inform_no_debuginfo (void)
}
static void
-macro_expand_command (char *exp, int from_tty)
+macro_expand_command (const char *exp, int from_tty)
{
struct macro_scope *ms = NULL;
char *expanded = NULL;
@@ -88,7 +88,7 @@ macro_expand_command (char *exp, int from_tty)
static void
-macro_expand_once_command (char *exp, int from_tty)
+macro_expand_once_command (const char *exp, int from_tty)
{
struct macro_scope *ms = NULL;
char *expanded = NULL;
@@ -298,7 +298,7 @@ info_macros_command (char *args, int from_tty)
/* User-defined macros. */
static void
-skip_ws (char **expp)
+skip_ws (const char **expp)
{
while (macro_is_whitespace (**expp))
++*expp;
@@ -312,10 +312,10 @@ skip_ws (char **expp)
parameters. */
static char *
-extract_identifier (char **expp, int is_parameter)
+extract_identifier (const char **expp, int is_parameter)
{
char *result;
- char *p = *expp;
+ const char *p = *expp;
unsigned int len;
if (is_parameter && startswith (p, "..."))
@@ -358,7 +358,7 @@ free_macro_definition_ptr (void *ptr)
}
static void
-macro_define_command (char *exp, int from_tty)
+macro_define_command (const char *exp, int from_tty)
{
struct macro_definition new_macro;
char *name = NULL;
@@ -440,7 +440,7 @@ macro_define_command (char *exp, int from_tty)
static void
-macro_undef_command (char *exp, int from_tty)
+macro_undef_command (const char *exp, int from_tty)
{
char *name;
@@ -476,7 +476,7 @@ print_one_macro (const char *name, const struct macro_definition *macro,
static void
-macro_list_command (char *exp, int from_tty)
+macro_list_command (const char *exp, int from_tty)
{
macro_for_each (macro_user_macros, print_one_macro);
}