diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-30 08:19:01 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-06-01 10:46:49 -0600 |
commit | 7b640f726819bedab1515ce49f03c0de26193b3b (patch) | |
tree | aeab534ff133e15b58fe56231129533274c90dc9 | |
parent | 98e69eb381347eb06dfedaa0b185ad26818ce5cd (diff) | |
download | binutils-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.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/cp-name-parser.y | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c50d83..f1eed4e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2018-06-01 Tom Tromey <tom@tromey.com> + * cp-name-parser.y (backslashable, represented): Now const. + +2018-06-01 Tom Tromey <tom@tromey.com> + * cp-name-parser.y: Include parser-defs.h. (parser_fprintf): Remove declaration. 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 |