diff options
author | Keith Seitz <keiths@redhat.com> | 2013-10-02 00:46:07 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2013-10-02 00:46:07 +0000 |
commit | d7561cbbf27a8ff771f85baf6696aa7645250484 (patch) | |
tree | eb81d452fe456e9a043cc453bf8b65617b40e915 /gdb/macroexp.c | |
parent | 62574b938f80a485874b85a770d03bf0f21eece5 (diff) | |
download | gdb-d7561cbbf27a8ff771f85baf6696aa7645250484.zip gdb-d7561cbbf27a8ff771f85baf6696aa7645250484.tar.gz gdb-d7561cbbf27a8ff771f85baf6696aa7645250484.tar.bz2 |
Constification of parse_linespec and fallout:
https://sourceware.org/ml/gdb-patches/2013-09/msg01017.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01018.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01019.html
https://sourceware.org/ml/gdb-patches/2013-09/msg01020.html
Diffstat (limited to 'gdb/macroexp.c')
-rw-r--r-- | gdb/macroexp.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/macroexp.c b/gdb/macroexp.c index d88dac3..3d98550f 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -360,8 +360,11 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end) } else if (*p == '\\') { - p++; - char_count += c_parse_escape (&p, NULL); + const char *s, *o; + + s = o = ++p; + char_count += c_parse_escape (&s, NULL); + p += s - o; } else { @@ -414,8 +417,11 @@ get_string_literal (struct macro_buffer *tok, char *p, char *end) "constants.")); else if (*p == '\\') { - p++; - c_parse_escape (&p, NULL); + const char *s, *o; + + s = o = ++p; + c_parse_escape (&s, NULL); + p += s - o; } else p++; @@ -1434,7 +1440,7 @@ macro_expand_once (const char *source, char * -macro_expand_next (char **lexptr, +macro_expand_next (const char **lexptr, macro_lookup_ftype *lookup_func, void *lookup_baton) { @@ -1442,7 +1448,7 @@ macro_expand_next (char **lexptr, struct cleanup *back_to; /* Set up SRC to refer to the input text, pointed to by *lexptr. */ - init_shared_buffer (&src, *lexptr, strlen (*lexptr)); + init_shared_buffer (&src, (char *) *lexptr, strlen (*lexptr)); /* Set up DEST to receive the expansion, if there is one. */ init_buffer (&dest, 0); |