From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14741 invoked by alias); 13 Dec 2011 03:46:51 -0000 Received: (qmail 14559 invoked by uid 22791); 13 Dec 2011 03:46:49 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ,TW_QF X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 03:46:32 +0000 Received: by iahk25 with SMTP id k25so11429116iah.0 for ; Mon, 12 Dec 2011 19:46:32 -0800 (PST) Received: by 10.42.73.138 with SMTP id s10mr5617154icj.38.1323747675109; Mon, 12 Dec 2011 19:41:15 -0800 (PST) Received: from localhost.localdomain (c-24-18-115-186.hsd1.wa.comcast.net. [24.18.115.186]) by mx.google.com with ESMTPS id e2sm81168651ibe.0.2011.12.12.19.41.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 19:41:14 -0800 (PST) From: Andrey Smirnov To: gdb-patches@sourceware.org Cc: Andrey Smirnov Subject: [PATCH 044/238] [index] dwarf2read.c: -Wshadow fix Date: Tue, 13 Dec 2011 03:47:00 -0000 Message-Id: <1323747545-29987-10-git-send-email-andrew.smirnov@gmail.com> In-Reply-To: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com> References: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00378.txt.bz2 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