[RFA,5/5] Make two cp-name-parser.y constants "const"
Commit Message
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).
2018-05-30 Tom Tromey <tom@tromey.com>
* cp-name-parser.y (backslashable, represented): Now const.
---
gdb/ChangeLog | 4 ++++
gdb/cp-name-parser.y | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
@@ -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