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]

[RFA] fix shadowed function parm in d-valprint.c


OK, this change does not change the semantics of the code, but
I can't be sure that they're not already wrong because of the
confusion between the function parm and the local variable.

What do you guys say?

2011-02-26  Michael Snyder  <msnyder@vmware.com>

	* d-valprint.c (dynamic_array_type): Avoid shadowing a function
	param with a local variable of the same name.

Index: d-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/d-valprint.c,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 d-valprint.c
--- d-valprint.c	24 Jan 2011 18:54:15 -0000	1.5
+++ d-valprint.c	27 Feb 2011 00:08:09 -0000
@@ -45,7 +45,7 @@ dynamic_array_type (struct type *type, c
       struct type *elttype;
       struct type *true_type;
       struct type *ptr_type;
-      struct value *val;
+      struct value *ival;
       int length;
 
       length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
@@ -58,12 +58,12 @@ dynamic_array_type (struct type *type, c
       true_type = check_typedef (elttype);
 
       true_type = lookup_array_range_type (true_type, 0, length - 1);
-      val = value_at (true_type, addr);
+      ival = value_at (true_type, addr);
 
       return d_val_print (true_type,
-			  value_contents_for_printing (val),
-			  value_embedded_offset (val), addr,
-			  stream, recurse + 1, val, options);
+			  value_contents_for_printing (ival),
+			  value_embedded_offset (ival), addr,
+			  stream, recurse + 1, ival, options);
     }
   return -1;
 }

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