This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 037/238] [index] gnu-v2-abi.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:40 -0800
- Subject: [PATCH 037/238] [index] gnu-v2-abi.c: -Wshadow fix
- References: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com>
To ChangeLog:
* gnu-v2-abi.c (vb_match): Rename index to idx(-Wshadow).
(gnuv2_baseclass_offset): Ditto.
---
gdb/gnu-v2-abi.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
index a0d4830..4c3a410 100644
--- a/gdb/gnu-v2-abi.c
+++ b/gdb/gnu-v2-abi.c
@@ -290,14 +290,14 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
return rtti_type;
}
-/* Return true if the INDEXth field of TYPE is a virtual baseclass
+/* Return true if the IDXth field of TYPE is a virtual baseclass
pointer which is for the base class whose type is BASECLASS. */
static int
-vb_match (struct type *type, int index, struct type *basetype)
+vb_match (struct type *type, int idx, struct type *basetype)
{
struct type *fieldtype;
- char *name = TYPE_FIELD_NAME (type, index);
+ char *name = TYPE_FIELD_NAME (type, idx);
char *field_class_name = NULL;
if (*name != '_')
@@ -315,7 +315,7 @@ vb_match (struct type *type, int index, struct type *basetype)
/* It's a virtual baseclass pointer, now we just need to find out whether
it is for this baseclass. */
- fieldtype = TYPE_FIELD_TYPE (type, index);
+ fieldtype = TYPE_FIELD_TYPE (type, idx);
if (fieldtype == NULL
|| TYPE_CODE (fieldtype) != TYPE_CODE_PTR)
/* "Can't happen". */
@@ -336,19 +336,19 @@ vb_match (struct type *type, int index, struct type *basetype)
return 0;
}
-/* Compute the offset of the baseclass which is the INDEXth baseclass
+/* Compute the offset of the baseclass which is the IDXth baseclass
of class TYPE, for value at VALADDR (in host) at ADDRESS (in
target). The result is the offset of the baseclass value relative
to (the address of)(ARG) + OFFSET. */
static int
-gnuv2_baseclass_offset (struct type *type, int index,
+gnuv2_baseclass_offset (struct type *type, int idx,
const bfd_byte *valaddr, int embedded_offset,
CORE_ADDR address, const struct value *val)
{
- struct type *basetype = TYPE_BASECLASS (type, index);
+ struct type *basetype = TYPE_BASECLASS (type, idx);
- if (BASETYPE_VIA_VIRTUAL (type, index))
+ if (BASETYPE_VIA_VIRTUAL (type, idx))
{
/* Must hunt for the pointer to this virtual baseclass. */
int i, len = TYPE_NFIELDS (type);
@@ -381,7 +381,7 @@ gnuv2_baseclass_offset (struct type *type, int index,
}
}
/* Not in the fields, so try looking through the baseclasses. */
- for (i = index + 1; i < n_baseclasses; i++)
+ for (i = idx + 1; i < n_baseclasses; i++)
{
/* Don't go through baseclass_offset, as that wraps
exceptions, thus, inner exceptions would be wrapped more
@@ -398,7 +398,7 @@ gnuv2_baseclass_offset (struct type *type, int index,
}
/* Baseclass is easily computed. */
- return TYPE_BASECLASS_BITPOS (type, index) / 8;
+ return TYPE_BASECLASS_BITPOS (type, idx) / 8;
}
static void
--
1.7.5.4