Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Unified Diff: gdb/macroexp.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/macroexp.h ('k') | gdb/macroscope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/macroexp.c
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index fa3431169ea3845832017b52b39b81a78e416047..3d98550f2f63f42bebb4070a3fae985f02c81a48 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -1,5 +1,5 @@
/* C preprocessor macro expansion for GDB.
- Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2002-2013 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GDB.
@@ -337,7 +337,6 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
&& p[1] == '\''))
{
char *tok_start = p;
- char *body_start;
int char_count = 0;
if (*p == '\'')
@@ -347,7 +346,6 @@ get_character_constant (struct macro_buffer *tok, char *p, char *end)
else
gdb_assert_not_reached ("unexpected character constant");
- body_start = p;
for (;;)
{
if (p >= end)
@@ -362,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
{
@@ -416,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++;
@@ -700,7 +704,6 @@ macro_stringify (const char *str)
{
struct macro_buffer buffer;
int len = strlen (str);
- char *result;
init_buffer (&buffer, len);
stringify (&buffer, str, len);
@@ -1437,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)
{
@@ -1445,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);
« no previous file with comments | « gdb/macroexp.h ('k') | gdb/macroscope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698