This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 047/238] [index] cp-support.c: -Wshadow fix
- From: Andrey Smirnov <andrew dot smirnov at gmail dot com>
- To: gdb-patches at sourceware dot org
- Cc: Andrey Smirnov <andrew dot smirnov at gmail dot com>
- Date: Mon, 12 Dec 2011 19:38:50 -0800
- Subject: [PATCH 047/238] [index] cp-support.c: -Wshadow fix
- References: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com>
To ChangeLog:
* cp-support.c (cp_find_first_component_aux): Rename `index' to
`idx'(-Wshadow).
---
gdb/cp-support.c | 60 +++++++++++++++++++++++++++---------------------------
1 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 9e001b2..e2ade9c 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -899,7 +899,7 @@ cp_find_first_component (const char *name)
static unsigned int
cp_find_first_component_aux (const char *name, int permissive)
{
- unsigned int index = 0;
+ unsigned int idx = 0;
/* Operator names can show up in unexpected places. Since these can
contain parentheses or angle brackets, they can screw up the
recursion. But not every string 'operator' is part of an
@@ -908,49 +908,49 @@ cp_find_first_component_aux (const char *name, int permissive)
'operator' as starting an operator. */
int operator_possible = 1;
- for (;; ++index)
+ for (;; ++idx)
{
- switch (name[index])
+ switch (name[idx])
{
case '<':
/* Template; eat it up. The calls to cp_first_component
should only return (I hope!) when they reach the '>'
terminating the component or a '::' between two
components. (Hence the '+ 2'.) */
- index += 1;
- for (index += cp_find_first_component_aux (name + index, 1);
- name[index] != '>';
- index += cp_find_first_component_aux (name + index, 1))
+ idx += 1;
+ for (idx += cp_find_first_component_aux (name + idx, 1);
+ name[idx] != '>';
+ idx += cp_find_first_component_aux (name + idx, 1))
{
- if (name[index] != ':')
+ if (name[idx] != ':')
{
demangled_name_complaint (name);
return strlen (name);
}
- index += 2;
+ idx += 2;
}
operator_possible = 1;
break;
case '(':
/* Similar comment as to '<'. */
- index += 1;
- for (index += cp_find_first_component_aux (name + index, 1);
- name[index] != ')';
- index += cp_find_first_component_aux (name + index, 1))
+ idx += 1;
+ for (idx += cp_find_first_component_aux (name + idx, 1);
+ name[idx] != ')';
+ idx += cp_find_first_component_aux (name + idx, 1))
{
- if (name[index] != ':')
+ if (name[idx] != ':')
{
demangled_name_complaint (name);
return strlen (name);
}
- index += 2;
+ idx += 2;
}
operator_possible = 1;
break;
case '>':
case ')':
if (permissive)
- return index;
+ return idx;
else
{
demangled_name_complaint (name);
@@ -958,39 +958,39 @@ cp_find_first_component_aux (const char *name, int permissive)
}
case '\0':
case ':':
- return index;
+ return idx;
case 'o':
/* Operator names can screw up the recursion. */
if (operator_possible
- && strncmp (name + index, "operator",
+ && strncmp (name + idx, "operator",
LENGTH_OF_OPERATOR) == 0)
{
- index += LENGTH_OF_OPERATOR;
- while (ISSPACE(name[index]))
- ++index;
- switch (name[index])
+ idx += LENGTH_OF_OPERATOR;
+ while (ISSPACE(name[idx]))
+ ++idx;
+ switch (name[idx])
{
/* Skip over one less than the appropriate number of
characters: the for loop will skip over the last
one. */
case '<':
- if (name[index + 1] == '<')
- index += 1;
+ if (name[idx + 1] == '<')
+ idx += 1;
else
- index += 0;
+ idx += 0;
break;
case '>':
case '-':
- if (name[index + 1] == '>')
- index += 1;
+ if (name[idx + 1] == '>')
+ idx += 1;
else
- index += 0;
+ idx += 0;
break;
case '(':
- index += 1;
+ idx += 1;
break;
default:
- index += 0;
+ idx += 0;
break;
}
}
--
1.7.5.4