From: Tom Tromey Date: Wed, 30 May 2018 14:19:01 +0000 (-0600) Subject: Make two cp-name-parser.y constants "const" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b640f726819bedab1515ce49f03c0de26193b3b;p=binutils-gdb.git 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 * cp-name-parser.y (backslashable, represented): Now const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c50d8385cb..f1eed4e7299 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-06-01 Tom Tromey + + * cp-name-parser.y (backslashable, represented): Now const. + 2018-06-01 Tom Tromey * cp-name-parser.y: Include parser-defs.h. diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index 169a92df6a7..b8a3faa3df8 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