public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 049/238] [index] completer.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (3 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 058/238] [index] valops.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 042/238] [index] exec.c: " Andrey Smirnov
                   ` (21 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* completer.c (line_completion_function): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/completer.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/completer.c b/gdb/completer.c
index 606f78b..55a4b7a 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -863,7 +863,7 @@ line_completion_function (const char *text, int matches,
 			  char *line_buffer, int point)
 {
   static char **list = (char **) NULL;	/* Cache of completions.  */
-  static int index;			/* Next cached completion.  */
+  static int idx;			/* Next cached completion.  */
   char *output = NULL;
 
   if (matches == 0)
@@ -881,7 +881,7 @@ line_completion_function (const char *text, int matches,
 	  xfree (list);
 	  list = NULL;
 	}
-      index = 0;
+      idx = 0;
       list = complete_line (text, line_buffer, point);
     }
 
@@ -893,10 +893,10 @@ line_completion_function (const char *text, int matches,
 
   if (list)
     {
-      output = list[index];
+      output = list[idx];
       if (output)
 	{
-	  index++;
+	  idx++;
 	}
     }
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 043/238] [index] eval.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (7 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 056/238] [index] symtab.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 045/238] [index] dwarf2read.c: " Andrey Smirnov
                   ` (17 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 041/238] [index] f-typeprint.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (10 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 047/238] [index] cp-support.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 037/238] [index] gnu-v2-abi.c: " Andrey Smirnov
                   ` (14 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* f-typeprint.c (f_type_print_base): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/f-typeprint.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 6d9e6ec..aaf221f 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -259,7 +259,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
 		   int level)
 {
   int upper_bound;
-  int index;
+  int idx;
 
   QUIT;
 
@@ -352,13 +352,13 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
 	fprintfi_filtered (level, stream, "Type ");
       fputs_filtered (TYPE_TAG_NAME (type), stream);
       fputs_filtered ("\n", stream);
-      for (index = 0; index < TYPE_NFIELDS (type); index++)
+      for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
 	{
-	  f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show,
+	  f_type_print_base (TYPE_FIELD_TYPE (type, idx), stream, show,
 			     level + 4);
 	  fputs_filtered (" :: ", stream);
-	  fputs_filtered (TYPE_FIELD_NAME (type, index), stream);
-	  f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index),
+	  fputs_filtered (TYPE_FIELD_NAME (type, idx), stream);
+	  f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, idx),
 				       stream, 0, 0, 0, 0);
 	  fputs_filtered ("\n", stream);
 	} 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 047/238] [index] cp-support.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (9 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 045/238] [index] dwarf2read.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 041/238] [index] f-typeprint.c: " Andrey Smirnov
                   ` (15 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* cp-support.c (cp_find_first_component_aux): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/cp-support.c |   60 +++++++++++++++++++++++++++---------------------------
 1 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 9e001b2..e2ade9c 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -899,7 +899,7 @@ cp_find_first_component (const char *name)
 static unsigned int
 cp_find_first_component_aux (const char *name, int permissive)
 {
-  unsigned int index = 0;
+  unsigned int idx = 0;
   /* Operator names can show up in unexpected places.  Since these can
      contain parentheses or angle brackets, they can screw up the
      recursion.  But not every string 'operator' is part of an
@@ -908,49 +908,49 @@ cp_find_first_component_aux (const char *name, int permissive)
      'operator' as starting an operator.  */
   int operator_possible = 1;
 
-  for (;; ++index)
+  for (;; ++idx)
     {
-      switch (name[index])
+      switch (name[idx])
 	{
 	case '<':
 	  /* Template; eat it up.  The calls to cp_first_component
 	     should only return (I hope!) when they reach the '>'
 	     terminating the component or a '::' between two
 	     components.  (Hence the '+ 2'.)  */
-	  index += 1;
-	  for (index += cp_find_first_component_aux (name + index, 1);
-	       name[index] != '>';
-	       index += cp_find_first_component_aux (name + index, 1))
+	  idx += 1;
+	  for (idx += cp_find_first_component_aux (name + idx, 1);
+	       name[idx] != '>';
+	       idx += cp_find_first_component_aux (name + idx, 1))
 	    {
-	      if (name[index] != ':')
+	      if (name[idx] != ':')
 		{
 		  demangled_name_complaint (name);
 		  return strlen (name);
 		}
-	      index += 2;
+	      idx += 2;
 	    }
 	  operator_possible = 1;
 	  break;
 	case '(':
 	  /* Similar comment as to '<'.  */
-	  index += 1;
-	  for (index += cp_find_first_component_aux (name + index, 1);
-	       name[index] != ')';
-	       index += cp_find_first_component_aux (name + index, 1))
+	  idx += 1;
+	  for (idx += cp_find_first_component_aux (name + idx, 1);
+	       name[idx] != ')';
+	       idx += cp_find_first_component_aux (name + idx, 1))
 	    {
-	      if (name[index] != ':')
+	      if (name[idx] != ':')
 		{
 		  demangled_name_complaint (name);
 		  return strlen (name);
 		}
-	      index += 2;
+	      idx += 2;
 	    }
 	  operator_possible = 1;
 	  break;
 	case '>':
 	case ')':
 	  if (permissive)
-	    return index;
+	    return idx;
 	  else
 	    {
 	      demangled_name_complaint (name);
@@ -958,39 +958,39 @@ cp_find_first_component_aux (const char *name, int permissive)
 	    }
 	case '\0':
 	case ':':
-	  return index;
+	  return idx;
 	case 'o':
 	  /* Operator names can screw up the recursion.  */
 	  if (operator_possible
-	      && strncmp (name + index, "operator",
+	      && strncmp (name + idx, "operator",
 			  LENGTH_OF_OPERATOR) == 0)
 	    {
-	      index += LENGTH_OF_OPERATOR;
-	      while (ISSPACE(name[index]))
-		++index;
-	      switch (name[index])
+	      idx += LENGTH_OF_OPERATOR;
+	      while (ISSPACE(name[idx]))
+		++idx;
+	      switch (name[idx])
 		{
 		  /* Skip over one less than the appropriate number of
 		     characters: the for loop will skip over the last
 		     one.  */
 		case '<':
-		  if (name[index + 1] == '<')
-		    index += 1;
+		  if (name[idx + 1] == '<')
+		    idx += 1;
 		  else
-		    index += 0;
+		    idx += 0;
 		  break;
 		case '>':
 		case '-':
-		  if (name[index + 1] == '>')
-		    index += 1;
+		  if (name[idx + 1] == '>')
+		    idx += 1;
 		  else
-		    index += 0;
+		    idx += 0;
 		  break;
 		case '(':
-		  index += 1;
+		  idx += 1;
 		  break;
 		default:
-		  index += 0;
+		  idx += 0;
 		  break;
 		}
 	    }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 039/238] [index] findcmd.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 036/238] [index] i386-tdep.c: " Andrey Smirnov
                   ` (24 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* findcmd.c (put_bits): Rename `index' to `idx'(-Wshadow).
---
 gdb/findcmd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/findcmd.c b/gdb/findcmd.c
index 7665a04..5eb5b75 100644
--- a/gdb/findcmd.c
+++ b/gdb/findcmd.c
@@ -38,9 +38,9 @@ put_bits (bfd_uint64_t data, char *buf, int bits, bfd_boolean big_p)
   bytes = bits / 8;
   for (i = 0; i < bytes; i++)
     {
-      int index = big_p ? bytes - i - 1 : i;
+      int idx = big_p ? bytes - i - 1 : i;
 
-      buf[index] = data & 0xff;
+      buf[idx] = data & 0xff;
       data >>= 8;
     }
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 037/238] [index] gnu-v2-abi.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (11 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 041/238] [index] f-typeprint.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:46 ` [PATCH 051/238] [index] gnu-v3-abi.c: " Andrey Smirnov
                   ` (13 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 042/238] [index] exec.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (4 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 049/238] [index] completer.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 048/238] [index] cp-abi.c: " Andrey Smirnov
                   ` (20 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* exec.c (exec_set_section_address): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/exec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/exec.c b/gdb/exec.c
index a2da9d5..d3d3493 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -838,7 +838,7 @@ set_section_command (char *args, int from_tty)
    it to ADDRESS.  */
 
 void
-exec_set_section_address (const char *filename, int index, CORE_ADDR address)
+exec_set_section_address (const char *filename, int idx, CORE_ADDR address)
 {
   struct target_section *p;
   struct target_section_table *table;
@@ -847,7 +847,7 @@ exec_set_section_address (const char *filename, int index, CORE_ADDR address)
   for (p = table->sections; p < table->sections_end; p++)
     {
       if (filename_cmp (filename, p->bfd->filename) == 0
-	  && index == p->the_bfd_section->index)
+	  && idx == p->the_bfd_section->index)
 	{
 	  p->endaddr += address - p->addr;
 	  p->addr = address;
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 038/238] [index] gdbtypes.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 039/238] [index] findcmd.c: " Andrey Smirnov
                   ` (25 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d0cb678..f0a0e59 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -843,15 +843,15 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
 int
 get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound)
 {
-  struct type *index = TYPE_INDEX_TYPE (type);
+  struct type *idx = TYPE_INDEX_TYPE (type);
   LONGEST low = 0;
   LONGEST high = 0;
   int res;
 
-  if (index == NULL)
+  if (idx == NULL)
     return 0;
 
-  res = get_discrete_bounds (index, &low, &high);
+  res = get_discrete_bounds (idx, &low, &high);
   if (res == -1)
     return 0;
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 045/238] [index] dwarf2read.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (8 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 043/238] [index] eval.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 047/238] [index] cp-support.c: " Andrey Smirnov
                   ` (16 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* dwarf2read.c (dw2_expand_symtabs_matching): Rename `index' to
	`mapped_ndx'(-Wshadow).
---
 gdb/dwarf2read.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 25ebcfa..363a92d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2726,14 +2726,14 @@ dw2_expand_symtabs_matching (struct objfile *objfile,
 {
   int i;
   offset_type iter;
-  struct mapped_index *index;
+  struct mapped_index *mapped_ndx;
 
   dw2_setup (objfile);
 
   /* index_table is NULL if OBJF_READNOW.  */
   if (!dwarf2_per_objfile->index_table)
     return;
-  index = dwarf2_per_objfile->index_table;
+  mapped_ndx = dwarf2_per_objfile->index_table;
 
   if (file_matcher != NULL)
     for (i = 0; i < (dwarf2_per_objfile->n_comp_units
@@ -2761,24 +2761,24 @@ dw2_expand_symtabs_matching (struct objfile *objfile,
 	  }
       }
 
-  for (iter = 0; iter < index->symbol_table_slots; ++iter)
+  for (iter = 0; iter < mapped_ndx->symbol_table_slots; ++iter)
     {
       offset_type idx = 2 * iter;
       const char *name;
       offset_type *vec, vec_len, vec_idx;
 
-      if (index->symbol_table[idx] == 0 && index->symbol_table[idx + 1] == 0)
+      if (mapped_ndx->symbol_table[idx] == 0 && mapped_ndx->symbol_table[idx + 1] == 0)
 	continue;
 
-      name = index->constant_pool + MAYBE_SWAP (index->symbol_table[idx]);
+      name = mapped_ndx->constant_pool + MAYBE_SWAP (mapped_ndx->symbol_table[idx]);
 
       if (! (*name_matcher) (name, data))
 	continue;
 
       /* The name was matched, now expand corresponding CUs that were
 	 marked.  */
-      vec = (offset_type *) (index->constant_pool
-			     + MAYBE_SWAP (index->symbol_table[idx + 1]));
+      vec = (offset_type *) (mapped_ndx->constant_pool
+			     + MAYBE_SWAP (mapped_ndx->symbol_table[idx + 1]));
       vec_len = MAYBE_SWAP (vec[0]);
       for (vec_idx = 0; vec_idx < vec_len; ++vec_idx)
 	{
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix
@ 2011-12-13  3:41 Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
                   ` (26 more replies)
  0 siblings, 27 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* python/py-evtregistry.c (evregpy_disconnect): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/python/py-evtregistry.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/python/py-evtregistry.c b/gdb/python/py-evtregistry.c
index 67d5715..b5fc811 100644
--- a/gdb/python/py-evtregistry.c
+++ b/gdb/python/py-evtregistry.c
@@ -56,17 +56,17 @@ static PyObject *
 evregpy_disconnect (PyObject *self, PyObject *function)
 {
   PyObject *func;
-  int index;
+  int idx;
   PyObject *callback_list = (((eventregistry_object *) self)->callbacks);
 
   if (!PyArg_ParseTuple (function, "O", &func))
     return NULL;
 
-  index = PySequence_Index (callback_list, func);
-  if (index < 0)
+  idx = PySequence_Index (callback_list, func);
+  if (idx < 0)
     Py_RETURN_NONE;
 
-  if (PySequence_DelItem (callback_list, index) < 0)
+  if (PySequence_DelItem (callback_list, idx) < 0)
     return NULL;
 
   Py_RETURN_NONE;
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 048/238] [index] cp-abi.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (5 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 042/238] [index] exec.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 056/238] [index] symtab.c: " Andrey Smirnov
                   ` (19 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* cp-abi.c (baseclass_offset): Rename `index' to `idx'(-Wshadow).
---
 gdb/cp-abi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 82a164e..9ff49f9 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -70,7 +70,7 @@ is_operator_name (const char *name)
 }
 
 int
-baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
+baseclass_offset (struct type *type, int idx, const gdb_byte *valaddr,
 		  int embedded_offset, CORE_ADDR address,
 		  const struct value *val)
 {
@@ -81,7 +81,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
 
   TRY_CATCH (ex, RETURN_MASK_ERROR)
     {
-      res = (*current_cp_abi.baseclass_offset) (type, index, valaddr,
+      res = (*current_cp_abi.baseclass_offset) (type, idx, valaddr,
 						embedded_offset,
 						address, val);
     }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 058/238] [index] valops.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (2 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 036/238] [index] i386-tdep.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 049/238] [index] completer.c: " Andrey Smirnov
                   ` (22 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* valops.c (oload_method_static): Rename `index' to `idx'(-Wshadow).
	(maybe_print_array_index): Ditto.
---
 gdb/valops.c   |    6 +++---
 gdb/valprint.c |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/valops.c b/gdb/valops.c
index 29d1fbd..6ce91d2 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3076,10 +3076,10 @@ find_oload_champ (struct value **args, int nargs, int method,
    a non-static method or a function that isn't a method.  */
 
 static int
-oload_method_static (int method, struct fn_field *fns_ptr, int index)
+oload_method_static (int method, struct fn_field *fns_ptr, int idx)
 {
-  if (method && fns_ptr && index >= 0
-      && TYPE_FN_FIELD_STATIC_P (fns_ptr, index))
+  if (method && fns_ptr && idx >= 0
+      && TYPE_FN_FIELD_STATIC_P (fns_ptr, idx))
     return 1;
   else
     return 0;
diff --git a/gdb/valprint.c b/gdb/valprint.c
index b4ac4ec..79fb032 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1167,7 +1167,7 @@ print_char_chars (struct ui_file *stream, struct type *type,
    at INDEX of an array whose index type is INDEX_TYPE.  */
     
 void  
-maybe_print_array_index (struct type *index_type, LONGEST index,
+maybe_print_array_index (struct type *index_type, LONGEST idx,
                          struct ui_file *stream,
 			 const struct value_print_options *options)
 {
@@ -1176,7 +1176,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index,
   if (!options->print_array_indexes)
     return; 
     
-  index_value = value_from_longest (index_type, index);
+  index_value = value_from_longest (index_type, idx);
 
   LA_PRINT_ARRAY_INDEX (index_value, stream, options);
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 056/238] [index] symtab.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (6 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 048/238] [index] cp-abi.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 043/238] [index] eval.c: " Andrey Smirnov
                   ` (18 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

diff --git a/gdb/symtab.c b/gdb/symtab.c
index 3d94e6b..f972eeb 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2182,7 +2182,7 @@ find_pc_line (CORE_ADDR pc, int notcurrent)
 
 struct symtab *
 find_line_symtab (struct symtab *symtab, int line,
-		  int *index, int *exact_match)
+		  int *idx, int *exact_match)
 {
   int exact = 0;  /* Initialized here to avoid a compiler warning.  */
 
@@ -2265,8 +2265,8 @@ done:
   if (best_index < 0)
     return NULL;
 
-  if (index)
-    *index = best_index;
+  if (idx)
+    *idx = best_index;
   if (exact_match)
     *exact_match = exact;
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 036/238] [index] i386-tdep.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
  2011-12-13  3:41 ` [PATCH 039/238] [index] findcmd.c: " Andrey Smirnov
@ 2011-12-13  3:41 ` Andrey Smirnov
  2011-12-13  8:17   ` Mark Kettenis
  2011-12-13  3:41 ` [PATCH 058/238] [index] valops.c: " Andrey Smirnov
                   ` (23 subsequent siblings)
  26 siblings, 1 reply; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* i386-tdep.c (i386_record_lea_modrm_addr): Rename `index' to
	`idx'(-Wshadow).
---
 gdb/i386-tdep.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index a4e3a22..e28a257 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3621,7 +3621,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
       int havesib = 0;
       uint8_t scale = 0;
       uint8_t byte;
-      uint8_t index = 0;
+      uint8_t idx = 0;
       uint8_t base = irp->rm;
 
       if (base == 4)
@@ -3637,7 +3637,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
 	    }
 	  irp->addr++;
 	  scale = (byte >> 6) & 3;
-	  index = ((byte >> 3) & 7) | irp->rex_x;
+	  idx = ((byte >> 3) & 7) | irp->rex_x;
 	  base = (byte & 7);
 	}
       base |= irp->rex_b;
@@ -3703,9 +3703,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
       else
         *addr = (uint32_t) (offset64 + *addr);
 
-      if (havesib && (index != 4 || scale != 0))
+      if (havesib && (idx != 4 || scale != 0))
 	{
-	  regcache_raw_read_unsigned (irp->regcache, irp->regmap[index],
+	  regcache_raw_read_unsigned (irp->regcache, irp->regmap[idx],
                                       &offset64);
 	  if (irp->aflag == 2)
 	    *addr += offset64 << scale;
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 051/238] [index] gnu-v3-abi.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (12 preceding siblings ...)
  2011-12-13  3:41 ` [PATCH 037/238] [index] gnu-v2-abi.c: " Andrey Smirnov
@ 2011-12-13  3:46 ` Andrey Smirnov
  2011-12-13  3:46 ` [PATCH 040/238] [index] f-valprint.c " Andrey Smirnov
                   ` (12 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

* gnu-v3-abi.c (gnuv3_baseclass_offset): Rename `index' to `idx'(-Wshadow).
---
 gdb/gnu-v3-abi.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 92b73d3..beea2d7 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -415,7 +415,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
    -1 is returned on error.  */
 
 static int
-gnuv3_baseclass_offset (struct type *type, int index,
+gnuv3_baseclass_offset (struct type *type, int idx,
 			const bfd_byte *valaddr, int embedded_offset,
 			CORE_ADDR address, const struct value *val)
 {
@@ -431,15 +431,15 @@ gnuv3_baseclass_offset (struct type *type, int index,
 
   /* If it isn't a virtual base, this is easy.  The offset is in the
      type definition.  */
-  if (!BASETYPE_VIA_VIRTUAL (type, index))
-    return TYPE_BASECLASS_BITPOS (type, index) / 8;
+  if (!BASETYPE_VIA_VIRTUAL (type, idx))
+    return TYPE_BASECLASS_BITPOS (type, idx) / 8;
 
   /* To access a virtual base, we need to use the vbase offset stored in
      our vtable.  Recent GCC versions provide this information.  If it isn't
      available, we could get what we needed from RTTI, or from drawing the
      complete inheritance graph based on the debug info.  Neither is
      worthwhile.  */
-  cur_base_offset = TYPE_BASECLASS_BITPOS (type, index) / 8;
+  cur_base_offset = TYPE_BASECLASS_BITPOS (type, idx) / 8;
   if (cur_base_offset >= - vtable_address_point_offset (gdbarch))
     error (_("Expected a negative vbase offset (old compiler?)"));
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 040/238] [index] f-valprint.c -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (13 preceding siblings ...)
  2011-12-13  3:46 ` [PATCH 051/238] [index] gnu-v3-abi.c: " Andrey Smirnov
@ 2011-12-13  3:46 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 050/238] [index] coffread.c: " Andrey Smirnov
                   ` (11 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* f-valprint.c (f_val_print): Rename `index' to `idx'(-Wshadow).
---
 gdb/f-valprint.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index b800d89..f7fbeac 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -258,7 +258,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
   struct type *elttype;
   LONGEST val;
   CORE_ADDR addr;
-  int index;
+  int idx;
 
   CHECK_TYPEDEF (type);
   switch (TYPE_CODE (type))
@@ -496,15 +496,15 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
       /* Starting from the Fortran 90 standard, Fortran supports derived
          types.  */
       fprintf_filtered (stream, "( ");
-      for (index = 0; index < TYPE_NFIELDS (type); index++)
+      for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
         {
-          int offset = TYPE_FIELD_BITPOS (type, index) / 8;
+          int offset = TYPE_FIELD_BITPOS (type, idx) / 8;
 
-          val_print (TYPE_FIELD_TYPE (type, index), valaddr,
+          val_print (TYPE_FIELD_TYPE (type, idx), valaddr,
 		     embedded_offset + offset,
 		     address, stream, recurse + 1,
 		     original_value, options, current_language);
-          if (index != TYPE_NFIELDS (type) - 1)
+          if (idx != TYPE_NFIELDS (type) - 1)
             fputs_filtered (", ", stream);
         }
       fprintf_filtered (stream, " )");
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 053/238] [index] parse.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (19 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 054/238] [index] stabsread.c: " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:48 ` [PATCH 061/238] [index] wrapper.c: " Andrey Smirnov
                   ` (5 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

diff --git a/gdb/parse.c b/gdb/parse.c
index 7d157fe..9ae8311 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -275,10 +275,10 @@ void
 write_exp_elt_decfloatcst (gdb_byte expelt[16])
 {
   union exp_element tmp;
-  int index;
+  int idx;
 
-  for (index = 0; index < 16; index++)
-    tmp.decfloatconst[index] = expelt[index];
+  for (idx = 0; idx < 16; idx++)
+    tmp.decfloatconst[idx] = expelt[idx];
 
   write_exp_elt (&tmp);
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 050/238] [index] coffread.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (14 preceding siblings ...)
  2011-12-13  3:46 ` [PATCH 040/238] [index] f-valprint.c " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 044/238] [index] dwarf2read.c: " Andrey Smirnov
                   ` (10 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* coffread.c (coff_lookup_type): Rename `index' to `idx'(-Wshadow).
	(coff_alloc_type): Ditto.
	(coff_read_struct_type): Ditto.
	(coff_read_enum_type): Ditto.
---
 gdb/coffread.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/gdb/coffread.c b/gdb/coffread.c
index cf8fb54..70b430f 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -325,15 +325,15 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd)
    or for associating a new type with the index.  */
 
 static struct type **
-coff_lookup_type (int index)
+coff_lookup_type (int idx)
 {
-  if (index >= type_vector_length)
+  if (idx >= type_vector_length)
     {
       int old_vector_length = type_vector_length;
 
       type_vector_length *= 2;
-      if (index /* is still */  >= type_vector_length)
-	type_vector_length = index * 2;
+      if (idx /* is still */  >= type_vector_length)
+	type_vector_length = idx * 2;
 
       type_vector = (struct type **)
 	xrealloc ((char *) type_vector,
@@ -341,7 +341,7 @@ coff_lookup_type (int index)
       memset (&type_vector[old_vector_length], 0,
 	 (type_vector_length - old_vector_length) * sizeof (struct type *));
     }
-  return &type_vector[index];
+  return &type_vector[idx];
 }
 
 /* Make sure there is a type allocated for type number index
@@ -349,9 +349,9 @@ coff_lookup_type (int index)
    This can create an empty (zeroed) type object.  */
 
 static struct type *
-coff_alloc_type (int index)
+coff_alloc_type (int idx)
 {
-  struct type **type_addr = coff_lookup_type (index);
+  struct type **type_addr = coff_lookup_type (idx);
   struct type *type = *type_addr;
 
   /* If we are referring to a type not known at all yet,
@@ -1977,7 +1977,7 @@ decode_base_type (struct coff_symbol *cs,
    object describing the type.  */
 
 static struct type *
-coff_read_struct_type (int index, int length, int lastsym,
+coff_read_struct_type (int idx, int length, int lastsym,
 		       struct objfile *objfile)
 {
   struct nextfield
@@ -1998,7 +1998,7 @@ coff_read_struct_type (int index, int length, int lastsym,
   union internal_auxent sub_aux;
   int done = 0;
 
-  type = coff_alloc_type (index);
+  type = coff_alloc_type (idx);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (type);
   TYPE_LENGTH (type) = length;
@@ -2070,7 +2070,7 @@ coff_read_struct_type (int index, int length, int lastsym,
    Also defines the symbols that represent the values of the type.  */
 
 static struct type *
-coff_read_enum_type (int index, int length, int lastsym,
+coff_read_enum_type (int idx, int length, int lastsym,
 		     struct objfile *objfile)
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
@@ -2089,7 +2089,7 @@ coff_read_enum_type (int index, int length, int lastsym,
   char *name;
   int unsigned_enum = 1;
 
-  type = coff_alloc_type (index);
+  type = coff_alloc_type (idx);
   if (within_function)
     symlist = &local_symbols;
   else
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 044/238] [index] dwarf2read.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (15 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 050/238] [index] coffread.c: " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 057/238] [index] valarith.c: " Andrey Smirnov
                   ` (9 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* dwarf2read.c (find_slot): Rename `index' to `idx'(-Wshadow).
	(add_to_method_list): Ditto.
	(find_slot_in_mapped_hash): Ditto.
	(dw2_find_last_source_symtab): Ditto.
	(dw2_get_cu): Ditto.
	(find_slot_in_mapped_hash): Ditto.
	(dw2_get_cu): Ditto.
---
 gdb/dwarf2read.c |   64 +++++++++++++++++++++++++++---------------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 5e279de..25ebcfa 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1893,14 +1893,14 @@ dw2_instantiate_symtab (struct objfile *objfile,
 /* Return the CU given its index.  */
 
 static struct dwarf2_per_cu_data *
-dw2_get_cu (int index)
+dw2_get_cu (int idx)
 {
-  if (index >= dwarf2_per_objfile->n_comp_units)
+  if (idx >= dwarf2_per_objfile->n_comp_units)
     {
-      index -= dwarf2_per_objfile->n_comp_units;
-      return dwarf2_per_objfile->type_comp_units[index];
+      idx -= dwarf2_per_objfile->n_comp_units;
+      return dwarf2_per_objfile->type_comp_units[idx];
     }
-  return dwarf2_per_objfile->all_comp_units[index];
+  return dwarf2_per_objfile->all_comp_units[idx];
 }
 
 /* A helper function that knows how to read a 64-bit value in a way
@@ -2022,7 +2022,7 @@ create_signatured_type_table_from_index (struct objfile *objfile,
    populate the objfile's psymtabs_addrmap.  */
 
 static void
-create_addrmap_from_index (struct objfile *objfile, struct mapped_index *index)
+create_addrmap_from_index (struct objfile *objfile, struct mapped_index *idx)
 {
   const gdb_byte *iter, *end;
   struct obstack temp_obstack;
@@ -2034,8 +2034,8 @@ create_addrmap_from_index (struct objfile *objfile, struct mapped_index *index)
   cleanup = make_cleanup_obstack_free (&temp_obstack);
   mutable_map = addrmap_create_mutable (&temp_obstack);
 
-  iter = index->address_table;
-  end = iter + index->address_table_size;
+  iter = idx->address_table;
+  end = iter + idx->address_table_size;
 
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 
@@ -2088,7 +2088,7 @@ mapped_index_string_hash (int index_version, const void *p)
    constant pool and return 1.  If NAME cannot be found, return 0.  */
 
 static int
-find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
+find_slot_in_mapped_hash (struct mapped_index *idx, const char *name,
 			  offset_type **vec_out)
 {
   struct cleanup *back_to = make_cleanup (null_cleanup, 0);
@@ -2120,13 +2120,13 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
   /* Index version 4 did not support case insensitive searches.  But the
      indexes for case insensitive languages are built in lowercase, therefore
      simulate our NAME being searched is also lowercased.  */
-  hash = mapped_index_string_hash ((index->version == 4
+  hash = mapped_index_string_hash ((idx->version == 4
                                     && case_sensitivity == case_sensitive_off
-				    ? 5 : index->version),
+				    ? 5 : idx->version),
 				   name);
 
-  slot = hash & (index->symbol_table_slots - 1);
-  step = ((hash * 17) & (index->symbol_table_slots - 1)) | 1;
+  slot = hash & (idx->symbol_table_slots - 1);
+  step = ((hash * 17) & (idx->symbol_table_slots - 1)) | 1;
   cmp = (case_sensitivity == case_sensitive_on ? strcmp : strcasecmp);
 
   for (;;)
@@ -2134,22 +2134,22 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name,
       /* Convert a slot number to an offset into the table.  */
       offset_type i = 2 * slot;
       const char *str;
-      if (index->symbol_table[i] == 0 && index->symbol_table[i + 1] == 0)
+      if (idx->symbol_table[i] == 0 && idx->symbol_table[i + 1] == 0)
 	{
 	  do_cleanups (back_to);
 	  return 0;
 	}
 
-      str = index->constant_pool + MAYBE_SWAP (index->symbol_table[i]);
+      str = idx->constant_pool + MAYBE_SWAP (idx->symbol_table[i]);
       if (!cmp (name, str))
 	{
-	  *vec_out = (offset_type *) (index->constant_pool
-				      + MAYBE_SWAP (index->symbol_table[i + 1]));
+	  *vec_out = (offset_type *) (idx->constant_pool
+				      + MAYBE_SWAP (idx->symbol_table[i + 1]));
 	  do_cleanups (back_to);
 	  return 1;
 	}
 
-      slot = (slot + step) & (index->symbol_table_slots - 1);
+      slot = (slot + step) & (idx->symbol_table_slots - 1);
     }
 }
 
@@ -2387,26 +2387,26 @@ dw2_get_file_names (struct objfile *objfile,
 
 static const char *
 dw2_get_real_path (struct objfile *objfile,
-		   struct quick_file_names *qfn, int index)
+		   struct quick_file_names *qfn, int idx)
 {
   if (qfn->real_names == NULL)
     qfn->real_names = OBSTACK_CALLOC (&objfile->objfile_obstack,
 				      qfn->num_file_names, sizeof (char *));
 
-  if (qfn->real_names[index] == NULL)
-    qfn->real_names[index] = gdb_realpath (qfn->file_names[index]);
+  if (qfn->real_names[idx] == NULL)
+    qfn->real_names[idx] = gdb_realpath (qfn->file_names[idx]);
 
-  return qfn->real_names[index];
+  return qfn->real_names[idx];
 }
 
 static struct symtab *
 dw2_find_last_source_symtab (struct objfile *objfile)
 {
-  int index;
+  int idx;
 
   dw2_setup (objfile);
-  index = dwarf2_per_objfile->n_comp_units - 1;
-  return dw2_instantiate_symtab (objfile, dw2_get_cu (index));
+  idx = dwarf2_per_objfile->n_comp_units - 1;
+  return dw2_instantiate_symtab (objfile, dw2_get_cu (idx));
 }
 
 /* Traversal function for dw2_forget_cached_source_info.  */
@@ -4761,14 +4761,14 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu,
 /* Add a DIE to the delayed physname list.  */
 
 static void
-add_to_method_list (struct type *type, int fnfield_index, int index,
+add_to_method_list (struct type *type, int fnfield_index, int idx,
 		    const char *name, struct die_info *die,
 		    struct dwarf2_cu *cu)
 {
   struct delayed_method_info mi;
   mi.type = type;
   mi.fnfield_index = fnfield_index;
-  mi.index = index;
+  mi.index = idx;
   mi.name = name;
   mi.die = die;
   VEC_safe_push (delayed_method_info, cu->method_list, &mi);
@@ -16527,16 +16527,16 @@ cleanup_mapped_symtab (void *p)
 static struct symtab_index_entry **
 find_slot (struct mapped_symtab *symtab, const char *name)
 {
-  offset_type index, step, hash = mapped_index_string_hash (INT_MAX, name);
+  offset_type idx, step, hash = mapped_index_string_hash (INT_MAX, name);
 
-  index = hash & (symtab->size - 1);
+  idx = hash & (symtab->size - 1);
   step = ((hash * 17) & (symtab->size - 1)) | 1;
 
   for (;;)
     {
-      if (!symtab->data[index] || !strcmp (name, symtab->data[index]->name))
-	return &symtab->data[index];
-      index = (index + step) & (symtab->size - 1);
+      if (!symtab->data[idx] || !strcmp (name, symtab->data[idx]->name))
+	return &symtab->data[idx];
+      idx = (idx + step) & (symtab->size - 1);
     }
 }
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 054/238] [index] stabsread.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (18 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 060/238] [index] varobj.c: " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 053/238] [index] parse.c: " Andrey Smirnov
                   ` (6 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* stabsread.c (dbx_lookup_type): Rename `index' to `idx'(-Wshadow).
---
 gdb/stabsread.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index bb51808..4fd458d 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -222,7 +222,7 @@ static struct type **
 dbx_lookup_type (int typenums[2], struct objfile *objfile)
 {
   int filenum = typenums[0];
-  int index = typenums[1];
+  int idx = typenums[1];
   unsigned old_len;
   int real_filenum;
   struct header_file *f;
@@ -236,13 +236,13 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
       complaint (&symfile_complaints,
 		 _("Invalid symbol data: type number "
 		   "(%d,%d) out of range at symtab pos %d."),
-		 filenum, index, symnum);
+		 filenum, idx, symnum);
       goto error_return;
     }
 
   if (filenum == 0)
     {
-      if (index < 0)
+      if (idx < 0)
 	{
 	  /* Caller wants address of address of type.  We think
 	     that negative (rs6k builtin) types will never appear as
@@ -251,13 +251,13 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
 	     this will do the right thing.  */
 	  static struct type *temp_type;
 
-	  temp_type = rs6000_builtin_type (index, objfile);
+	  temp_type = rs6000_builtin_type (idx, objfile);
 	  return &temp_type;
 	}
 
       /* Type is defined outside of header files.
          Find it in this object file's type vector.  */
-      if (index >= type_vector_length)
+      if (idx >= type_vector_length)
 	{
 	  old_len = type_vector_length;
 	  if (old_len == 0)
@@ -266,7 +266,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
 	      type_vector = (struct type **)
 		xmalloc (type_vector_length * sizeof (struct type *));
 	    }
-	  while (index >= type_vector_length)
+	  while (idx >= type_vector_length)
 	    {
 	      type_vector_length *= 2;
 	    }
@@ -276,7 +276,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
 	  memset (&type_vector[old_len], 0,
 		  (type_vector_length - old_len) * sizeof (struct type *));
 	}
-      return (&type_vector[index]);
+      return (&type_vector[idx]);
     }
   else
     {
@@ -296,9 +296,9 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
       f = HEADER_FILES (objfile) + real_filenum;
 
       f_orig_length = f->length;
-      if (index >= f_orig_length)
+      if (idx >= f_orig_length)
 	{
-	  while (index >= f->length)
+	  while (idx >= f->length)
 	    {
 	      f->length *= 2;
 	    }
@@ -307,7 +307,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
 	  memset (&f->vector[f_orig_length], 0,
 		  (f->length - f_orig_length) * sizeof (struct type *));
 	}
-      return (&f->vector[index]);
+      return (&f->vector[idx]);
     }
 }
 
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 057/238] [index] valarith.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (16 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 044/238] [index] dwarf2read.c: " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 060/238] [index] varobj.c: " Andrey Smirnov
                   ` (8 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* valarith.c (value_subscript): Rename index to idx(-Wshadow).
	(value_subscripted_rvalue): Ditto.
	(value_bitstring_subscript): Ditto.
	(value_bit_index): Ditto.
---
 gdb/valarith.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/gdb/valarith.c b/gdb/valarith.c
index 3250cc7..704be1d 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -148,7 +148,7 @@ value_ptrdiff (struct value *arg1, struct value *arg2)
    verbosity is set, warn about invalid indices (but still use them).  */
 
 struct value *
-value_subscript (struct value *array, LONGEST index)
+value_subscript (struct value *array, LONGEST idx)
 {
   int c_style = current_language->c_style_arrays;
   struct type *tarray;
@@ -164,12 +164,12 @@ value_subscript (struct value *array, LONGEST index)
 
       get_discrete_bounds (range_type, &lowerbound, &upperbound);
       if (VALUE_LVAL (array) != lval_memory)
-	return value_subscripted_rvalue (array, index, lowerbound);
+	return value_subscripted_rvalue (array, idx, lowerbound);
 
       if (c_style == 0)
 	{
-	  if (index >= lowerbound && index <= upperbound)
-	    return value_subscripted_rvalue (array, index, lowerbound);
+	  if (idx >= lowerbound && idx <= upperbound)
+	    return value_subscripted_rvalue (array, idx, lowerbound);
 	  /* Emit warning unless we have an array of unknown size.
 	     An array of unknown size has lowerbound 0 and upperbound -1.  */
 	  if (upperbound > -1)
@@ -178,12 +178,12 @@ value_subscript (struct value *array, LONGEST index)
 	  c_style = 1;
 	}
 
-      index -= lowerbound;
+      idx -= lowerbound;
       array = value_coerce_array (array);
     }
 
   if (c_style)
-    return value_ind (value_ptradd (array, index));
+    return value_ind (value_ptradd (array, idx));
   else
     error (_("not an array or string"));
 }
@@ -193,15 +193,15 @@ value_subscript (struct value *array, LONGEST index)
    to doubles, but no longer does.  */
 
 struct value *
-value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
+value_subscripted_rvalue (struct value *array, LONGEST idx, int lowerbound)
 {
   struct type *array_type = check_typedef (value_type (array));
   struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
   unsigned int elt_size = TYPE_LENGTH (elt_type);
-  unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
+  unsigned int elt_offs = elt_size * longest_to_int (idx - lowerbound);
   struct value *v;
 
-  if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
+  if (idx < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
 			     && elt_offs >= TYPE_LENGTH (array_type)))
     error (_("no such vector element"));
 
@@ -226,7 +226,7 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
 
 struct value *
 value_bitstring_subscript (struct type *type,
-			   struct value *bitstring, LONGEST index)
+			   struct value *bitstring, LONGEST idx)
 {
 
   struct type *bitstring_type, *range_type;
@@ -239,14 +239,14 @@ value_bitstring_subscript (struct type *type,
 
   range_type = TYPE_INDEX_TYPE (bitstring_type);
   get_discrete_bounds (range_type, &lowerbound, &upperbound);
-  if (index < lowerbound || index > upperbound)
+  if (idx < lowerbound || idx > upperbound)
     error (_("bitstring index out of range"));
 
-  index -= lowerbound;
-  offset = index / TARGET_CHAR_BIT;
+  idx -= lowerbound;
+  offset = idx / TARGET_CHAR_BIT;
   byte = *((char *) value_contents (bitstring) + offset);
 
-  bit_index = index % TARGET_CHAR_BIT;
+  bit_index = idx % TARGET_CHAR_BIT;
   byte >>= (gdbarch_bits_big_endian (get_type_arch (bitstring_type)) ?
 	    TARGET_CHAR_BIT - 1 - bit_index : bit_index);
 
@@ -1821,7 +1821,7 @@ value_complement (struct value *arg1)
    Return -1 if out of range, -2 other error.  */
 
 int
-value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
+value_bit_index (struct type *type, const gdb_byte *valaddr, int idx)
 {
   struct gdbarch *gdbarch = get_type_arch (type);
   LONGEST low_bound, high_bound;
@@ -1831,9 +1831,9 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index)
 
   if (get_discrete_bounds (range, &low_bound, &high_bound) < 0)
     return -2;
-  if (index < low_bound || index > high_bound)
+  if (idx < low_bound || idx > high_bound)
     return -1;
-  rel_index = index - low_bound;
+  rel_index = idx - low_bound;
   word = extract_unsigned_integer (valaddr + (rel_index / TARGET_CHAR_BIT), 1,
 				   gdbarch_byte_order (gdbarch));
   rel_index %= TARGET_CHAR_BIT;
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 060/238] [index] varobj.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (17 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 057/238] [index] valarith.c: " Andrey Smirnov
@ 2011-12-13  3:47 ` Andrey Smirnov
  2011-12-13  3:47 ` [PATCH 054/238] [index] stabsread.c: " Andrey Smirnov
                   ` (7 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* varobj.c (varobj_get_handle): Rename index to idx(-Wshadow).
	(install_dynamic_child): Ditto.
	(install_variable): Ditto.
	(uninstall_variable): Ditto.
	(create_child_with_value): Ditto.
	(name_of_child): Ditto.
	(value_of_child): Ditto.
	(create_child): Ditto.
	(c_describe_child): Ditto.
	(c_name_of_child): Ditto.
	(c_value_of_child): Ditto.
	(c_type_of_child): Ditto.
	(match_accessibility): Ditto.
	(cplus_describe_child): Ditto.
	(cplus_name_of_child): Ditto.
	(cplus_value_of_child): Ditto.
	(cplus_type_of_child): Ditto.
	(java_name_of_child): Ditto.
	(java_value_of_child): Ditto.
	(java_type_of_child): Ditto.
	(ada_name_of_child): Ditto.
	(ada_value_of_child): Ditto.
	(ada_type_of_child): Ditto.

	* varobj.c (create_child): Remove trailing whitespace.
	(c_describe_child): Ditto.
	(c_name_of_child): Ditto.
	(c_value_of_child): Ditto.
---
 gdb/varobj.c |  144 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/gdb/varobj.c b/gdb/varobj.c
index 7c68a93..0bca297 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -719,15 +719,15 @@ varobj_get_handle (char *objname)
 {
   struct vlist *cv;
   const char *chp;
-  unsigned int index = 0;
+  unsigned int idx = 0;
   unsigned int i = 1;
 
   for (chp = objname; *chp; chp++)
     {
-      index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+      idx = (idx + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
     }
 
-  cv = *(varobj_table + index);
+  cv = *(varobj_table + idx);
   while ((cv != NULL) && (strcmp (cv->var->obj_name, objname) != 0))
     cv = cv->next;
 
@@ -951,11 +951,11 @@ install_dynamic_child (struct varobj *var,
 		       VEC (varobj_p) **new,
 		       VEC (varobj_p) **unchanged,
 		       int *cchanged,
-		       int index,
+		       int idx,
 		       const char *name,
 		       struct value *value)
 {
-  if (VEC_length (varobj_p, var->children) < index + 1)
+  if (VEC_length (varobj_p, var->children) < idx + 1)
     {
       /* There's no child yet.  */
       struct varobj *child = varobj_add_child (var, name, value);
@@ -968,7 +968,7 @@ install_dynamic_child (struct varobj *var,
     }
   else 
     {
-      varobj_p existing = VEC_index (varobj_p, var->children, index);
+      varobj_p existing = VEC_index (varobj_p, var->children, idx);
 
       if (install_new_value (existing, value, 0))
 	{
@@ -2052,15 +2052,15 @@ install_variable (struct varobj *var)
   struct vlist *cv;
   struct vlist *newvl;
   const char *chp;
-  unsigned int index = 0;
+  unsigned int idx = 0;
   unsigned int i = 1;
 
   for (chp = var->obj_name; *chp; chp++)
     {
-      index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+      idx = (idx + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
     }
 
-  cv = *(varobj_table + index);
+  cv = *(varobj_table + idx);
   while ((cv != NULL) && (strcmp (cv->var->obj_name, var->obj_name) != 0))
     cv = cv->next;
 
@@ -2069,9 +2069,9 @@ install_variable (struct varobj *var)
 
   /* Add varobj to hash table.  */
   newvl = xmalloc (sizeof (struct vlist));
-  newvl->next = *(varobj_table + index);
+  newvl->next = *(varobj_table + idx);
   newvl->var = var;
-  *(varobj_table + index) = newvl;
+  *(varobj_table + idx) = newvl;
 
   /* If root, add varobj to root list.  */
   if (is_root_p (var))
@@ -2096,16 +2096,16 @@ uninstall_variable (struct varobj *var)
   struct varobj_root *cr;
   struct varobj_root *prer;
   const char *chp;
-  unsigned int index = 0;
+  unsigned int idx = 0;
   unsigned int i = 1;
 
   /* Remove varobj from hash table.  */
   for (chp = var->obj_name; *chp; chp++)
     {
-      index = (index + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
+      idx = (idx + (i++ * (unsigned int) *chp)) % VAROBJ_TABLE_SIZE;
     }
 
-  cv = *(varobj_table + index);
+  cv = *(varobj_table + idx);
   prev = NULL;
   while ((cv != NULL) && (strcmp (cv->var->obj_name, var->obj_name) != 0))
     {
@@ -2125,7 +2125,7 @@ uninstall_variable (struct varobj *var)
     }
 
   if (prev == NULL)
-    *(varobj_table + index) = cv->next;
+    *(varobj_table + idx) = cv->next;
   else
     prev->next = cv->next;
 
@@ -2164,14 +2164,14 @@ uninstall_variable (struct varobj *var)
 
 /* Create and install a child of the parent of the given name.  */
 static struct varobj *
-create_child (struct varobj *parent, int index, char *name)
+create_child (struct varobj *parent, int idx, char *name)
 {
-  return create_child_with_value (parent, index, name, 
-				  value_of_child (parent, index));
+  return create_child_with_value (parent, idx, name,
+				  value_of_child (parent, idx));
 }
 
 static struct varobj *
-create_child_with_value (struct varobj *parent, int index, const char *name,
+create_child_with_value (struct varobj *parent, int idx, const char *name,
 			 struct value *value)
 {
   struct varobj *child;
@@ -2182,7 +2182,7 @@ create_child_with_value (struct varobj *parent, int index, const char *name,
   /* Name is allocated by name_of_child.  */
   /* FIXME: xstrdup should not be here.  */
   child->name = xstrdup (name);
-  child->index = index;
+  child->index = idx;
   child->parent = parent;
   child->root = parent->root;
   childs_name = xstrprintf ("%s.%s", parent->obj_name, name);
@@ -2462,9 +2462,9 @@ name_of_variable (struct varobj *var)
 /* What is the name of the INDEX'th child of VAR? Returns a malloc'd
    string.  */
 static char *
-name_of_child (struct varobj *var, int index)
+name_of_child (struct varobj *var, int idx)
 {
-  return (*var->root->lang->name_of_child) (var, index);
+  return (*var->root->lang->name_of_child) (var, idx);
 }
 
 /* What is the ``struct value *'' of the root variable VAR?
@@ -2546,11 +2546,11 @@ value_of_root (struct varobj **var_handle, int *type_changed)
 
 /* What is the ``struct value *'' for the INDEX'th child of PARENT?  */
 static struct value *
-value_of_child (struct varobj *parent, int index)
+value_of_child (struct varobj *parent, int idx)
 {
   struct value *value;
 
-  value = (*parent->root->lang->value_of_child) (parent, index);
+  value = (*parent->root->lang->value_of_child) (parent, idx);
 
   return value;
 }
@@ -2937,7 +2937,7 @@ value_struct_element_index (struct value *value, int type_index)
    information cannot be determined, set *CNAME, *CVALUE, or *CTYPE
    to NULL.  */
 static void 
-c_describe_child (struct varobj *parent, int index,
+c_describe_child (struct varobj *parent, int idx,
 		  char **cname, struct value **cvalue, struct type **ctype,
 		  char **cfull_expression)
 {
@@ -2964,13 +2964,13 @@ c_describe_child (struct varobj *parent, int index,
     case TYPE_CODE_ARRAY:
       if (cname)
 	*cname
-	  = xstrdup (int_string (index 
+	  = xstrdup (int_string (idx
 				 + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)),
 				 10, 1, 0, 0));
 
       if (cvalue && value)
 	{
-	  int real_index = index + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
+	  int real_index = idx + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
 
 	  gdb_value_subscript (value, real_index, cvalue);
 	}
@@ -2981,7 +2981,7 @@ c_describe_child (struct varobj *parent, int index,
       if (cfull_expression)
 	*cfull_expression = 
 	  xstrprintf ("(%s)[%s]", parent_expression, 
-		      int_string (index
+		      int_string (idx
 				  + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)),
 				  10, 1, 0, 0));
 
@@ -2991,23 +2991,23 @@ c_describe_child (struct varobj *parent, int index,
     case TYPE_CODE_STRUCT:
     case TYPE_CODE_UNION:
       if (cname)
-	*cname = xstrdup (TYPE_FIELD_NAME (type, index));
+	*cname = xstrdup (TYPE_FIELD_NAME (type, idx));
 
       if (cvalue && value)
 	{
 	  /* For C, varobj index is the same as type index.  */
-	  *cvalue = value_struct_element_index (value, index);
+	  *cvalue = value_struct_element_index (value, idx);
 	}
 
       if (ctype)
-	*ctype = TYPE_FIELD_TYPE (type, index);
+	*ctype = TYPE_FIELD_TYPE (type, idx);
 
       if (cfull_expression)
 	{
 	  char *join = was_ptr ? "->" : ".";
 
 	  *cfull_expression = xstrprintf ("(%s)%s%s", parent_expression, join,
-					  TYPE_FIELD_NAME (type, index));
+					  TYPE_FIELD_NAME (type, idx));
 	}
 
       break;
@@ -3046,11 +3046,11 @@ c_describe_child (struct varobj *parent, int index,
 }
 
 static char *
-c_name_of_child (struct varobj *parent, int index)
+c_name_of_child (struct varobj *parent, int idx)
 {
   char *name;
 
-  c_describe_child (parent, index, &name, NULL, NULL, NULL);
+  c_describe_child (parent, idx, &name, NULL, NULL, NULL);
   return name;
 }
 
@@ -3136,20 +3136,20 @@ c_value_of_root (struct varobj **var_handle)
 }
 
 static struct value *
-c_value_of_child (struct varobj *parent, int index)
+c_value_of_child (struct varobj *parent, int idx)
 {
   struct value *value = NULL;
 
-  c_describe_child (parent, index, NULL, &value, NULL, NULL);
+  c_describe_child (parent, idx, NULL, &value, NULL, NULL);
   return value;
 }
 
 static struct type *
-c_type_of_child (struct varobj *parent, int index)
+c_type_of_child (struct varobj *parent, int idx)
 {
   struct type *type = NULL;
 
-  c_describe_child (parent, index, NULL, NULL, &type, NULL);
+  c_describe_child (parent, idx, NULL, NULL, &type, NULL);
   return type;
 }
 
@@ -3320,21 +3320,21 @@ enum accessibility { private_field, protected_field, public_field };
 /* Check if field INDEX of TYPE has the specified accessibility.
    Return 0 if so and 1 otherwise.  */
 static int 
-match_accessibility (struct type *type, int index, enum accessibility acc)
+match_accessibility (struct type *type, int idx, enum accessibility acc)
 {
-  if (acc == private_field && TYPE_FIELD_PRIVATE (type, index))
+  if (acc == private_field && TYPE_FIELD_PRIVATE (type, idx))
     return 1;
-  else if (acc == protected_field && TYPE_FIELD_PROTECTED (type, index))
+  else if (acc == protected_field && TYPE_FIELD_PROTECTED (type, idx))
     return 1;
-  else if (acc == public_field && !TYPE_FIELD_PRIVATE (type, index)
-	   && !TYPE_FIELD_PROTECTED (type, index))
+  else if (acc == public_field && !TYPE_FIELD_PRIVATE (type, idx)
+	   && !TYPE_FIELD_PROTECTED (type, idx))
     return 1;
   else
     return 0;
 }
 
 static void
-cplus_describe_child (struct varobj *parent, int index,
+cplus_describe_child (struct varobj *parent, int idx,
 		      char **cname, struct value **cvalue, struct type **ctype,
 		      char **cfull_expression)
 {
@@ -3393,13 +3393,13 @@ cplus_describe_child (struct varobj *parent, int index,
 	  else if (strcmp (parent->name, "protected") == 0)
 	    acc = protected_field;
 
-	  while (index >= 0)
+	  while (idx >= 0)
 	    {
 	      if ((type == basetype && type_index == vptr_fieldno)
 		  || TYPE_FIELD_ARTIFICIAL (type, type_index))
 		; /* ignore vptr */
 	      else if (match_accessibility (type, type_index, acc))
-		    --index;
+		    --idx;
 		  ++type_index;
 	    }
 	  --type_index;
@@ -3419,18 +3419,18 @@ cplus_describe_child (struct varobj *parent, int index,
 			    join, 
 			    TYPE_FIELD_NAME (type, type_index));
 	}
-      else if (index < TYPE_N_BASECLASSES (type))
+      else if (idx < TYPE_N_BASECLASSES (type))
 	{
 	  /* This is a baseclass.  */
 	  if (cname)
-	    *cname = xstrdup (TYPE_FIELD_NAME (type, index));
+	    *cname = xstrdup (TYPE_FIELD_NAME (type, idx));
 
 	  if (cvalue && value)
-	    *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
+	    *cvalue = value_cast (TYPE_FIELD_TYPE (type, idx), value);
 
 	  if (ctype)
 	    {
-	      *ctype = TYPE_FIELD_TYPE (type, index);
+	      *ctype = TYPE_FIELD_TYPE (type, idx);
 	    }
 
 	  if (cfull_expression)
@@ -3452,7 +3452,7 @@ cplus_describe_child (struct varobj *parent, int index,
 		 'class' keyword.  See PR mi/11912  */
 	      *cfull_expression = xstrprintf ("(%s(class %s%s) %s)", 
 					      ptr, 
-					      TYPE_FIELD_NAME (type, index),
+					      TYPE_FIELD_NAME (type, idx),
 					      ptr,
 					      parent_expression);
 	    }
@@ -3469,8 +3469,8 @@ cplus_describe_child (struct varobj *parent, int index,
 
 	     The special "fake" children are always output by varobj in
 	     this order.  So if INDEX == 2, it MUST be "protected".  */
-	  index -= TYPE_N_BASECLASSES (type);
-	  switch (index)
+	  idx -= TYPE_N_BASECLASSES (type);
+	  switch (idx)
 	    {
 	    case 0:
 	      if (children[v_public] > 0)
@@ -3509,16 +3509,16 @@ cplus_describe_child (struct varobj *parent, int index,
     }
   else
     {
-      c_describe_child (parent, index, cname, cvalue, ctype, cfull_expression);
+      c_describe_child (parent, idx, cname, cvalue, ctype, cfull_expression);
     }  
 }
 
 static char *
-cplus_name_of_child (struct varobj *parent, int index)
+cplus_name_of_child (struct varobj *parent, int idx)
 {
   char *name = NULL;
 
-  cplus_describe_child (parent, index, &name, NULL, NULL, NULL);
+  cplus_describe_child (parent, idx, &name, NULL, NULL, NULL);
   return name;
 }
 
@@ -3537,20 +3537,20 @@ cplus_value_of_root (struct varobj **var_handle)
 }
 
 static struct value *
-cplus_value_of_child (struct varobj *parent, int index)
+cplus_value_of_child (struct varobj *parent, int idx)
 {
   struct value *value = NULL;
 
-  cplus_describe_child (parent, index, NULL, &value, NULL, NULL);
+  cplus_describe_child (parent, idx, NULL, &value, NULL, NULL);
   return value;
 }
 
 static struct type *
-cplus_type_of_child (struct varobj *parent, int index)
+cplus_type_of_child (struct varobj *parent, int idx)
 {
   struct type *type = NULL;
 
-  cplus_describe_child (parent, index, NULL, NULL, &type, NULL);
+  cplus_describe_child (parent, idx, NULL, NULL, &type, NULL);
   return type;
 }
 
@@ -3596,11 +3596,11 @@ java_name_of_variable (struct varobj *parent)
 }
 
 static char *
-java_name_of_child (struct varobj *parent, int index)
+java_name_of_child (struct varobj *parent, int idx)
 {
   char *name, *p;
 
-  name = cplus_name_of_child (parent, index);
+  name = cplus_name_of_child (parent, idx);
   /* Escape any periods in the name...  */
   p = name;
 
@@ -3627,15 +3627,15 @@ java_value_of_root (struct varobj **var_handle)
 }
 
 static struct value *
-java_value_of_child (struct varobj *parent, int index)
+java_value_of_child (struct varobj *parent, int idx)
 {
-  return cplus_value_of_child (parent, index);
+  return cplus_value_of_child (parent, idx);
 }
 
 static struct type *
-java_type_of_child (struct varobj *parent, int index)
+java_type_of_child (struct varobj *parent, int idx)
 {
-  return cplus_type_of_child (parent, index);
+  return cplus_type_of_child (parent, idx);
 }
 
 static char *
@@ -3659,9 +3659,9 @@ ada_name_of_variable (struct varobj *parent)
 }
 
 static char *
-ada_name_of_child (struct varobj *parent, int index)
+ada_name_of_child (struct varobj *parent, int idx)
 {
-  return c_name_of_child (parent, index);
+  return c_name_of_child (parent, idx);
 }
 
 static char*
@@ -3677,15 +3677,15 @@ ada_value_of_root (struct varobj **var_handle)
 }
 
 static struct value *
-ada_value_of_child (struct varobj *parent, int index)
+ada_value_of_child (struct varobj *parent, int idx)
 {
-  return c_value_of_child (parent, index);
+  return c_value_of_child (parent, idx);
 }
 
 static struct type *
-ada_type_of_child (struct varobj *parent, int index)
+ada_type_of_child (struct varobj *parent, int idx)
 {
-  return c_type_of_child (parent, index);
+  return c_type_of_child (parent, idx);
 }
 
 static char *
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 046/238] [index] dcache.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (21 preceding siblings ...)
  2011-12-13  3:48 ` [PATCH 061/238] [index] wrapper.c: " Andrey Smirnov
@ 2011-12-13  3:48 ` Andrey Smirnov
  2011-12-13  3:49 ` [PATCH 055/238] [index] symmisc.c: " Andrey Smirnov
                   ` (3 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

diff --git a/gdb/dcache.c b/gdb/dcache.c
index bcc7bf4..de0ca38 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -559,7 +559,7 @@ dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr, int len)
 }
 
 static void
-dcache_print_line (int index)
+dcache_print_line (int idx)
 {
   splay_tree_node n;
   struct dcache_block *db;
@@ -573,7 +573,7 @@ dcache_print_line (int index)
 
   n = splay_tree_min (last_cache->tree);
 
-  for (i = index; i > 0; --i)
+  for (i = idx; i > 0; --i)
     {
       if (!n)
 	break;
@@ -589,7 +589,7 @@ dcache_print_line (int index)
   db = (struct dcache_block *) n->value;
 
   printf_filtered (_("Line %d: address %s [%d hits]\n"),
-		   index, paddress (target_gdbarch, db->addr), db->refs);
+		   idx, paddress (target_gdbarch, db->addr), db->refs);
 
   for (j = 0; j < last_cache->line_size; j++)
     {
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 061/238] [index] wrapper.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (20 preceding siblings ...)
  2011-12-13  3:47 ` [PATCH 053/238] [index] parse.c: " Andrey Smirnov
@ 2011-12-13  3:48 ` Andrey Smirnov
  2011-12-13  3:48 ` [PATCH 046/238] [index] dcache.c: " Andrey Smirnov
                   ` (4 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* wrapper.c (gdb_value_subscript): Rename `index' to `idx'(-Wshadow).
---
 gdb/wrapper.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/wrapper.c b/gdb/wrapper.c
index 951e672..8cd0e92 100644
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -101,14 +101,14 @@ gdb_value_assign (struct value *val1, struct value *val2,
 }
 
 int
-gdb_value_subscript (struct value *val, LONGEST index,
+gdb_value_subscript (struct value *val, LONGEST idx,
 		     struct value **result)
 {
   volatile struct gdb_exception except;
 
   TRY_CATCH (except, RETURN_MASK_ERROR)
     {
-      *result = value_subscript (val, index);
+      *result = value_subscript (val, idx);
     }
 
   if (except.reason < 0)
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 059/238] [index] value.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (24 preceding siblings ...)
  2011-12-13  3:49 ` [PATCH 062/238] [index] mi/mi-cmds.c: " Andrey Smirnov
@ 2011-12-13  3:49 ` Andrey Smirnov
  2011-12-13  7:18 ` [PATCH 052/238] [index] linespec.c: " Andrey Smirnov
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 062/238] [index] mi/mi-cmds.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (23 preceding siblings ...)
  2011-12-13  3:49 ` [PATCH 055/238] [index] symmisc.c: " Andrey Smirnov
@ 2011-12-13  3:49 ` Andrey Smirnov
  2011-12-13  3:49 ` [PATCH 059/238] [index] value.c: " Andrey Smirnov
  2011-12-13  7:18 ` [PATCH 052/238] [index] linespec.c: " Andrey Smirnov
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* mi/mi-cmds.c (varobj_update_one): Rename `index' to `idx'(-Wshadow).
---
 gdb/mi/mi-cmds.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 960d2dc..9355a3c 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -171,18 +171,18 @@ static struct mi_cmd **
 lookup_table (const char *command)
 {
   const char *chp;
-  unsigned int index = 0;
+  unsigned int idx = 0;
 
   /* compute our hash */
   for (chp = command; *chp; chp++)
     {
       /* some what arbitrary */
-      index = ((index << 6) + (unsigned int) *chp) % MI_TABLE_SIZE;
+      idx = ((idx << 6) + (unsigned int) *chp) % MI_TABLE_SIZE;
     }
   /* look it up */
   while (1)
     {
-      struct mi_cmd **entry = &mi_table[index];
+      struct mi_cmd **entry = &mi_table[idx];
       if ((*entry) == 0)
 	{
 	  /* not found, return pointer to next free. */
@@ -194,7 +194,7 @@ lookup_table (const char *command)
 	  stats.hit++;
 	  return entry;		/* found */
 	}
-      index = (index + 1) % MI_TABLE_SIZE;
+      idx = (idx + 1) % MI_TABLE_SIZE;
       stats.rehash++;
     }
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 055/238] [index] symmisc.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (22 preceding siblings ...)
  2011-12-13  3:48 ` [PATCH 046/238] [index] dcache.c: " Andrey Smirnov
@ 2011-12-13  3:49 ` Andrey Smirnov
  2011-12-13  3:49 ` [PATCH 062/238] [index] mi/mi-cmds.c: " Andrey Smirnov
                   ` (2 subsequent siblings)
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  3:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

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

diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 117a22b..b3bd2ed 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -203,7 +203,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
 {
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct minimal_symbol *msymbol;
-  int index;
+  int idx;
   char ms_type;
 
   fprintf_filtered (outfile, "\nObject file %s:\n\n", objfile->name);
@@ -212,7 +212,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
       fprintf_filtered (outfile, "No minimal symbols found.\n");
       return;
     }
-  index = 0;
+  idx = 0;
   ALL_OBJFILE_MSYMBOLS (objfile, msymbol)
     {
       struct obj_section *section = SYMBOL_OBJ_SECTION (msymbol);
@@ -253,7 +253,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
 	  ms_type = '?';
 	  break;
 	}
-      fprintf_filtered (outfile, "[%2d] %c ", index, ms_type);
+      fprintf_filtered (outfile, "[%2d] %c ", idx, ms_type);
       fputs_filtered (paddress (gdbarch, SYMBOL_VALUE_ADDRESS (msymbol)),
 		      outfile);
       fprintf_filtered (outfile, " %s", SYMBOL_LINKAGE_NAME (msymbol));
@@ -268,12 +268,12 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
       if (msymbol->filename)
 	fprintf_filtered (outfile, "  %s", msymbol->filename);
       fputs_filtered ("\n", outfile);
-      index++;
+      idx++;
     }
-  if (objfile->minimal_symbol_count != index)
+  if (objfile->minimal_symbol_count != idx)
     {
       warning (_("internal error:  minimal symbol count %d != %d"),
-	       objfile->minimal_symbol_count, index);
+	       objfile->minimal_symbol_count, idx);
     }
   fprintf_filtered (outfile, "\n");
 }
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 052/238] [index] linespec.c: -Wshadow fix
  2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
                   ` (25 preceding siblings ...)
  2011-12-13  3:49 ` [PATCH 059/238] [index] value.c: " Andrey Smirnov
@ 2011-12-13  7:18 ` Andrey Smirnov
  26 siblings, 0 replies; 31+ messages in thread
From: Andrey Smirnov @ 2011-12-13  7:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrey Smirnov

To ChangeLog:
	* linespec.c (decode_dollar): rename `index' to
	`idx'(-Wshadow).
---
 gdb/linespec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/linespec.c b/gdb/linespec.c
index 64ba837..450a340 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1994,7 +1994,7 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
 	       struct linespec_result *canonical, struct symtab *file_symtab)
 {
   LONGEST valx;
-  int index = 0;
+  int idx = 0;
   int need_canonical = 0;
   struct symtabs_and_lines values;
   struct symtab_and_line val;
@@ -2010,8 +2010,8 @@ decode_dollar (char *copy, int funfirstline, struct symtab *default_symtab,
       /* We have a value history reference.  */
       struct value *val_history;
 
-      sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &index);
-      val_history = access_value_history ((copy[1] == '$') ? -index : index);
+      sscanf ((copy[1] == '$') ? copy + 2 : copy + 1, "%d", &idx);
+      val_history = access_value_history ((copy[1] == '$') ? -idx : idx);
       if (TYPE_CODE (value_type (val_history)) != TYPE_CODE_INT)
 	error (_("History values used in line "
 		 "specs must have integer values."));
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 036/238] [index] i386-tdep.c: -Wshadow fix
  2011-12-13  3:41 ` [PATCH 036/238] [index] i386-tdep.c: " Andrey Smirnov
@ 2011-12-13  8:17   ` Mark Kettenis
  2011-12-13 12:36     ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Mark Kettenis @ 2011-12-13  8:17 UTC (permalink / raw)
  To: andrew.smirnov; +Cc: gdb-patches, andrew.smirnov

> From: Andrey Smirnov <andrew.smirnov@gmail.com>
> Date: Mon, 12 Dec 2011 19:38:39 -0800
> 
> To ChangeLog:
> 	* i386-tdep.c (i386_record_lea_modrm_addr): Rename `index' to
> 	`idx'(-Wshadow).
> ---
>  gdb/i386-tdep.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)

My position on this is unchanged.  I think 'index' is a perfectly good
variable name, and I consider it a misfeature of -Wshadow that it
complains about this, which is fixed in recent GCC's.

Please drop the changes in this class from your set.

> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
> index a4e3a22..e28a257 100644
> --- a/gdb/i386-tdep.c
> +++ b/gdb/i386-tdep.c
> @@ -3621,7 +3621,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
>        int havesib = 0;
>        uint8_t scale = 0;
>        uint8_t byte;
> -      uint8_t index = 0;
> +      uint8_t idx = 0;
>        uint8_t base = irp->rm;
>  
>        if (base == 4)
> @@ -3637,7 +3637,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
>  	    }
>  	  irp->addr++;
>  	  scale = (byte >> 6) & 3;
> -	  index = ((byte >> 3) & 7) | irp->rex_x;
> +	  idx = ((byte >> 3) & 7) | irp->rex_x;
>  	  base = (byte & 7);
>  	}
>        base |= irp->rex_b;
> @@ -3703,9 +3703,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
>        else
>          *addr = (uint32_t) (offset64 + *addr);
>  
> -      if (havesib && (index != 4 || scale != 0))
> +      if (havesib && (idx != 4 || scale != 0))
>  	{
> -	  regcache_raw_read_unsigned (irp->regcache, irp->regmap[index],
> +	  regcache_raw_read_unsigned (irp->regcache, irp->regmap[idx],
>                                        &offset64);
>  	  if (irp->aflag == 2)
>  	    *addr += offset64 << scale;
> -- 
> 1.7.5.4
> 
> 

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 036/238] [index] i386-tdep.c: -Wshadow fix
  2011-12-13  8:17   ` Mark Kettenis
@ 2011-12-13 12:36     ` Eli Zaretskii
  2011-12-13 16:47       ` Mark Kettenis
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2011-12-13 12:36 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: andrew.smirnov, gdb-patches, andrew.smirnov

> Date: Tue, 13 Dec 2011 08:17:38 +0100 (CET)
> From: Mark Kettenis <mark.kettenis@xs4all.nl>
> CC: gdb-patches@sourceware.org, andrew.smirnov@gmail.com
> 
> > From: Andrey Smirnov <andrew.smirnov@gmail.com>
> > Date: Mon, 12 Dec 2011 19:38:39 -0800
> > 
> > To ChangeLog:
> > 	* i386-tdep.c (i386_record_lea_modrm_addr): Rename `index' to
> > 	`idx'(-Wshadow).
> > ---
> >  gdb/i386-tdep.c |    8 ++++----
> >  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> My position on this is unchanged.  I think 'index' is a perfectly good
> variable name

And `idx' is its extremely popular synonym.

How much of personal preferences should area maintainers force on
contributors, just because they can?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 036/238] [index] i386-tdep.c: -Wshadow fix
  2011-12-13 12:36     ` Eli Zaretskii
@ 2011-12-13 16:47       ` Mark Kettenis
  0 siblings, 0 replies; 31+ messages in thread
From: Mark Kettenis @ 2011-12-13 16:47 UTC (permalink / raw)
  To: eliz; +Cc: mark.kettenis, andrew.smirnov, gdb-patches, andrew.smirnov

> Date: Tue, 13 Dec 2011 03:17:10 -0500
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > Date: Tue, 13 Dec 2011 08:17:38 +0100 (CET)
> > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > CC: gdb-patches@sourceware.org, andrew.smirnov@gmail.com
> > 
> > > From: Andrey Smirnov <andrew.smirnov@gmail.com>
> > > Date: Mon, 12 Dec 2011 19:38:39 -0800
> > > 
> > > To ChangeLog:
> > > 	* i386-tdep.c (i386_record_lea_modrm_addr): Rename `index' to
> > > 	`idx'(-Wshadow).
> > > ---
> > >  gdb/i386-tdep.c |    8 ++++----
> > >  1 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > My position on this is unchanged.  I think 'index' is a perfectly good
> > variable name
> 
> And `idx' is its extremely popular synonym.
> 
> How much of personal preferences should area maintainers force on
> contributors, just because they can?

I don't think we have concensus on -Wshadow.  One of the compromises
that has been talked about is to only enable -Wshadow with new
versions on GCC that don't issue warnings for shadowing symbols in
system headers.  That would make the changes in this class unnecessary
and therefore I think they should not be applied.

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2011-12-13 16:33 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: -Wshadow fix Andrey Smirnov
2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 039/238] [index] findcmd.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 036/238] [index] i386-tdep.c: " Andrey Smirnov
2011-12-13  8:17   ` Mark Kettenis
2011-12-13 12:36     ` Eli Zaretskii
2011-12-13 16:47       ` Mark Kettenis
2011-12-13  3:41 ` [PATCH 058/238] [index] valops.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 049/238] [index] completer.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 042/238] [index] exec.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 048/238] [index] cp-abi.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 056/238] [index] symtab.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 043/238] [index] eval.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 045/238] [index] dwarf2read.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 047/238] [index] cp-support.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 041/238] [index] f-typeprint.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 037/238] [index] gnu-v2-abi.c: " Andrey Smirnov
2011-12-13  3:46 ` [PATCH 051/238] [index] gnu-v3-abi.c: " Andrey Smirnov
2011-12-13  3:46 ` [PATCH 040/238] [index] f-valprint.c " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 050/238] [index] coffread.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 044/238] [index] dwarf2read.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 057/238] [index] valarith.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 060/238] [index] varobj.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 054/238] [index] stabsread.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 053/238] [index] parse.c: " Andrey Smirnov
2011-12-13  3:48 ` [PATCH 061/238] [index] wrapper.c: " Andrey Smirnov
2011-12-13  3:48 ` [PATCH 046/238] [index] dcache.c: " Andrey Smirnov
2011-12-13  3:49 ` [PATCH 055/238] [index] symmisc.c: " Andrey Smirnov
2011-12-13  3:49 ` [PATCH 062/238] [index] mi/mi-cmds.c: " Andrey Smirnov
2011-12-13  3:49 ` [PATCH 059/238] [index] value.c: " Andrey Smirnov
2011-12-13  7:18 ` [PATCH 052/238] [index] linespec.c: " Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).