aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-name-parser.y
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-30 08:19:01 -0600
committerTom Tromey <tom@tromey.com>2018-06-01 10:46:49 -0600
commit7b640f726819bedab1515ce49f03c0de26193b3b (patch)
treeaeab534ff133e15b58fe56231129533274c90dc9 /gdb/cp-name-parser.y
parent98e69eb381347eb06dfedaa0b185ad26818ce5cd (diff)
downloadbinutils-7b640f726819bedab1515ce49f03c0de26193b3b.zip
binutils-7b640f726819bedab1515ce49f03c0de26193b3b.tar.gz
binutils-7b640f726819bedab1515ce49f03c0de26193b3b.tar.bz2
Make two cp-name-parser.y constants "const"
This changes "backslashable" and "represented" in cp-name-parser.y to be const. This lets the compiler make them read-only (though in my build it seems that GCC inlines them, which seems even better). gdb/ChangeLog 2018-06-01 Tom Tromey <tom@tromey.com> * cp-name-parser.y (backslashable, represented): Now const.
Diffstat (limited to 'gdb/cp-name-parser.y')
-rw-r--r--gdb/cp-name-parser.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
index 169a92d..b8a3faa 100644
--- a/gdb/cp-name-parser.y
+++ b/gdb/cp-name-parser.y
@@ -1396,8 +1396,8 @@ parse_number (cpname_state *state, const char *p, int len, int parsed_float,
return INT;
}
-static char backslashable[] = "abefnrtv";
-static char represented[] = "\a\b\e\f\n\r\t\v";
+static const char backslashable[] = "abefnrtv";
+static const char represented[] = "\a\b\e\f\n\r\t\v";
/* Translate the backslash the way we would in the host character set. */
static int