summaryrefslogtreecommitdiff
path: root/gdb/macroexp.c
diff options
context:
space:
mode:
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);