[PATCH 062/238] [index] mi/mi-cmds.c: -Wshadow fix

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


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



More information about the Gdb-patches mailing list