[PATCH 059/238] [index] value.c: -Wshadow fix

Andrey Smirnov andrew.smirnov@gmail.com
Tue Dec 13 03:49:00 GMT 2011


To ChangeLog:
	* value.c (value_from_history_ref): Rename `index' to `idx'(-Wshadow).
---
 gdb/value.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/value.c b/gdb/value.c
index d263d0c..39b1e3a 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3045,7 +3045,7 @@ value_from_decfloat (struct type *type, const gdb_byte *dec)
 struct value *
 value_from_history_ref (char *h, char **endp)
 {
-  int index, len;
+  int idx, len;
 
   if (h[0] == '$')
     len = 1;
@@ -3070,25 +3070,25 @@ value_from_history_ref (char *h, char **endp)
 	{
 	  /* For some bizarre reason, "$$" is equivalent to "$$1", 
 	     rather than to "$$0" as it ought to be!  */
-	  index = -1;
+	  idx = -1;
 	  *endp += len;
 	}
       else
-	index = -strtol (&h[2], endp, 10);
+	idx = -strtol (&h[2], endp, 10);
     }
   else
     {
       if (len == 1)
 	{
 	  /* "$" is equivalent to "$0".  */
-	  index = 0;
+	  idx = 0;
 	  *endp += len;
 	}
       else
-	index = strtol (&h[1], endp, 10);
+	idx = strtol (&h[1], endp, 10);
     }
 
-  return access_value_history (index);
+  return access_value_history (idx);
 }
 
 struct value *
-- 
1.7.5.4



More information about the Gdb-patches mailing list