From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12644 invoked by alias); 22 Nov 2011 13:07:50 -0000 Received: (qmail 12636 invoked by uid 22791); 22 Nov 2011 13:07:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 13:07:30 +0000 Received: by faas10 with SMTP id s10so459408faa.0 for ; Tue, 22 Nov 2011 05:07:29 -0800 (PST) Received: by 10.205.127.139 with SMTP id ha11mr19352926bkc.111.1321967249258; Tue, 22 Nov 2011 05:07:29 -0800 (PST) Received: from bulbasaur (l49-9-169.cn.ru. [178.49.9.169]) by mx.google.com with ESMTPS id f14sm10042762bkv.3.2011.11.22.05.07.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 05:07:28 -0800 (PST) From: Andrey Smirnov To: gdb-patches@sourceware.org Subject: [PATCH 22/348] Fix -Wsahdow warnings Date: Tue, 22 Nov 2011 13:07:00 -0000 Message-ID: <878vn88fw3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/x-diff Content-Disposition: inline; filename=0022-Fix-Wshadow-warnings.patch Content-Description: Fix -Wshadow warnings 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-11/txt/msg00557.txt.bz2 >From c372a035d5c676f7f4e0f63af1ba43726ad29333 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 22 Nov 2011 17:34:32 +0700 Subject: [PATCH 22/39] Fix -Wshadow warnings. * bcache.c (expand_hash_table): Fix -Wshadow warnings. --- gdb/ChangeLog | 5 +++++ gdb/bcache.c | 30 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f6711e4..d972e6a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2011-11-22 Andrey Smirnov + * bcache.c (expand_hash_table): Fix -Wshadow + warnings. + +2011-11-22 Andrey Smirnov + * annotate.c (annotate_array_section_begin): Fix -Wshadow warnings. diff --git a/gdb/bcache.c b/gdb/bcache.c index 76e3893..f7543f4 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -130,7 +130,7 @@ hash_continue (const void *addr, int length, unsigned long h) #define CHAIN_LENGTH_THRESHOLD (5) static void -expand_hash_table (struct bcache *bcache) +expand_hash_table (struct bcache *cahce) { /* A table of good hash table sizes. Whenever we grow, we pick the next larger size from this table. sizes[i] is close to 1 << (i+10), @@ -149,13 +149,13 @@ expand_hash_table (struct bcache *bcache) /* Count the stats. Every unique item needs to be re-hashed and re-entered. */ - bcache->expand_count++; - bcache->expand_hash_count += bcache->unique_count; + cahce->expand_count++; + cahce->expand_hash_count += cahce->unique_count; /* Find the next size. */ - new_num_buckets = bcache->num_buckets * 2; + new_num_buckets = cahce->num_buckets * 2; for (i = 0; i < (sizeof (sizes) / sizeof (sizes[0])); i++) - if (sizes[i] > bcache->num_buckets) + if (sizes[i] > cahce->num_buckets) { new_num_buckets = sizes[i]; break; @@ -168,22 +168,22 @@ expand_hash_table (struct bcache *bcache) new_buckets = (struct bstring **) xmalloc (new_size); memset (new_buckets, 0, new_size); - bcache->structure_size -= (bcache->num_buckets - * sizeof (bcache->bucket[0])); - bcache->structure_size += new_size; + cahce->structure_size -= (cahce->num_buckets + * sizeof (cahce->bucket[0])); + cahce->structure_size += new_size; } /* Rehash all existing strings. */ - for (i = 0; i < bcache->num_buckets; i++) + for (i = 0; i < cahce->num_buckets; i++) { struct bstring *s, *next; - for (s = bcache->bucket[i]; s; s = next) + for (s = cahce->bucket[i]; s; s = next) { struct bstring **new_bucket; next = s->next; - new_bucket = &new_buckets[(bcache->hash_function (&s->d.data, + new_bucket = &new_buckets[(cahce->hash_function (&s->d.data, s->length) % new_num_buckets)]; s->next = *new_bucket; @@ -192,10 +192,10 @@ expand_hash_table (struct bcache *bcache) } /* Plug in the new table. */ - if (bcache->bucket) - xfree (bcache->bucket); - bcache->bucket = new_buckets; - bcache->num_buckets = new_num_buckets; + if (cahce->bucket) + xfree (cahce->bucket); + cahce->bucket = new_buckets; + cahce->num_buckets = new_num_buckets; } -- 1.7.5.4