Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: gdb-patches@sourceware.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 047/238] [index] cp-support.c: -Wshadow fix
Date: Tue, 13 Dec 2011 03:41:00 -0000	[thread overview]
Message-ID: <1323747545-29987-13-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com>

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


  parent reply	other threads:[~2011-12-13  3:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13  3:41 [PATCH 035/238] [index] python/py-evtregistry.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 049/238] [index] completer.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 039/238] [index] findcmd.c: " Andrey Smirnov
2011-12-13  3:41 ` Andrey Smirnov [this message]
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 037/238] [index] gnu-v2-abi.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 056/238] [index] symtab.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 042/238] [index] exec.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 045/238] [index] dwarf2read.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 048/238] [index] cp-abi.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 043/238] [index] eval.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 041/238] [index] f-typeprint.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 058/238] [index] valops.c: " Andrey Smirnov
2011-12-13  3:46 ` [PATCH 040/238] [index] f-valprint.c " Andrey Smirnov
2011-12-13  3:46 ` [PATCH 051/238] [index] gnu-v3-abi.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 050/238] [index] coffread.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 053/238] [index] parse.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 054/238] [index] stabsread.c: " Andrey Smirnov
2011-12-13  3:47 ` [PATCH 044/238] [index] dwarf2read.c: " Andrey Smirnov
2011-12-13  3:48 ` [PATCH 046/238] [index] dcache.c: " Andrey Smirnov
2011-12-13  3:48 ` [PATCH 061/238] [index] wrapper.c: " Andrey Smirnov
2011-12-13  3:49 ` [PATCH 059/238] [index] value.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  7:18 ` [PATCH 052/238] [index] linespec.c: " Andrey Smirnov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323747545-29987-13-git-send-email-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox