summaryrefslogtreecommitdiff
path: root/gdb/macroexp.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2013-10-02 00:46:06 +0000
committerKeith Seitz <keiths@redhat.com>2013-10-02 00:46:06 +0000
commitc85cddc51d5d9e4423509a2dc7cf3d9809451b49 (patch)
treef4d948ed91161a563c7dd24c56197f183a50a24a /gdb/macroexp.c
parent9cb8e9ab9d225807a721e2b6d520e663fc2fbb81 (diff)
downloadgdb-c85cddc51d5d9e4423509a2dc7cf3d9809451b49.tar.gz
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.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index d88dac366a7..3d98550f2f6 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);