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 044/238] [index] dwarf2read.c: -Wshadow fix
Date: Tue, 13 Dec 2011 03:47:00 -0000	[thread overview]
Message-ID: <1323747545-29987-10-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com>

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


  parent reply	other threads:[~2011-12-13  3:46 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 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 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 ` [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 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 058/238] [index] valops.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 038/238] [index] gdbtypes.c: " Andrey Smirnov
2011-12-13  3:41 ` [PATCH 045/238] [index] dwarf2read.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: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 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 ` Andrey Smirnov [this message]
2011-12-13  3:47 ` [PATCH 057/238] [index] valarith.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 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-10-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