This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 043/238] [index] eval.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:46 -0800
- Subject: [PATCH 043/238] [index] eval.c: -Wshadow fix
- References: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com>
To ChangeLog:
* eval.c (init_array_element): Rename `index' to `idx'(-Wshadow).
---
gdb/eval.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/eval.c b/gdb/eval.c
index 5d758d1..c276f8f 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -450,7 +450,7 @@ init_array_element (struct value *array, struct value *element,
struct expression *exp, int *pos,
enum noside noside, LONGEST low_bound, LONGEST high_bound)
{
- LONGEST index;
+ LONGEST idx;
int element_size = TYPE_LENGTH (value_type (element));
if (exp->elts[*pos].opcode == BINOP_COMMA)
@@ -470,22 +470,22 @@ init_array_element (struct value *array, struct value *element,
high = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
if (low < low_bound || high > high_bound)
error (_("tuple range index out of range"));
- for (index = low; index <= high; index++)
+ for (idx = low; idx <= high; idx++)
{
memcpy (value_contents_raw (array)
- + (index - low_bound) * element_size,
+ + (idx - low_bound) * element_size,
value_contents (element), element_size);
}
}
else
{
- index = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
- if (index < low_bound || index > high_bound)
+ idx = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ if (idx < low_bound || idx > high_bound)
error (_("tuple index out of range"));
- memcpy (value_contents_raw (array) + (index - low_bound) * element_size,
+ memcpy (value_contents_raw (array) + (idx - low_bound) * element_size,
value_contents (element), element_size);
}
- return index;
+ return idx;
}
static struct value *
--
1.7.5.4