This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 5/348] Fix -Wshadow warnings


>From 4f87b6a89614e80e0eff934502ae661185cf82be Mon Sep 17 00:00:00 2001
From: Andrey Smirnov <andrew.smirnov@gmail.com>
Date: Sat, 19 Nov 2011 09:29:36 +0700
Subject: [PATCH 05/18] Fix Wshadow

---
 gdb/ChangeLog  |    4 ++++
 gdb/ada-lang.c |    6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b074ad9..97f2dc4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2011-11-19  Andrey Smirnov <andrew.smirnov@gmail.com>
 
+	* ada-lang.c (assign_component): Fix -Wshadow warnings.
+
+2011-11-19  Andrey Smirnov <andrew.smirnov@gmail.com>
+
 	* ada-lang.c (assign_aggregate): Fix -Wshadow warnings.
 	(assign_aggregate): Fix formatting and trailing
 	whitespaces(accidental).
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 5afedf3..3304c4d 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -8611,7 +8611,7 @@ num_component_specs (struct expression *exp, int pc)
    LHS == CONTAINER).  */
 
 static void
-assign_component (struct value *container, struct value *lhs, LONGEST index,
+assign_component (struct value *container, struct value *lhs, LONGEST idx,
 		  struct expression *exp, int *pos)
 {
   struct value *mark = value_mark ();
@@ -8620,13 +8620,13 @@ assign_component (struct value *container, struct value *lhs, LONGEST index,
   if (TYPE_CODE (value_type (lhs)) == TYPE_CODE_ARRAY)
     {
       struct type *index_type = builtin_type (exp->gdbarch)->builtin_int;
-      struct value *index_val = value_from_longest (index_type, index);
+      struct value *index_val = value_from_longest (index_type, idx);
 
       elt = unwrap_value (ada_value_subscript (lhs, 1, &index_val));
     }
   else
     {
-      elt = ada_index_struct_field (index, lhs, 0, value_type (lhs));
+      elt = ada_index_struct_field (idx, lhs, 0, value_type (lhs));
       elt = ada_to_fixed_value (unwrap_value (elt));
     }
 
-- 
1.7.5.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]