From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16221 invoked by alias); 13 Dec 2011 03:47:18 -0000 Received: (qmail 16212 invoked by uid 22791); 13 Dec 2011 03:47:17 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ 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:47:03 +0000 Received: by mail-iy0-f169.google.com with SMTP id k25so11429390iah.0 for ; Mon, 12 Dec 2011 19:47:03 -0800 (PST) Received: by 10.50.155.195 with SMTP id vy3mr14113997igb.46.1323747679451; Mon, 12 Dec 2011 19:41:19 -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.18 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 19:41:19 -0800 (PST) From: Andrey Smirnov To: gdb-patches@sourceware.org Cc: Andrey Smirnov Subject: [PATCH 050/238] [index] coffread.c: -Wshadow fix Date: Tue, 13 Dec 2011 03:47:00 -0000 Message-Id: <1323747545-29987-16-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/msg00382.txt.bz2 To ChangeLog: * coffread.c (coff_lookup_type): Rename `index' to `idx'(-Wshadow). (coff_alloc_type): Ditto. (coff_read_struct_type): Ditto. (coff_read_enum_type): Ditto. --- gdb/coffread.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/coffread.c b/gdb/coffread.c index cf8fb54..70b430f 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -325,15 +325,15 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd) or for associating a new type with the index. */ static struct type ** -coff_lookup_type (int index) +coff_lookup_type (int idx) { - if (index >= type_vector_length) + if (idx >= type_vector_length) { int old_vector_length = type_vector_length; type_vector_length *= 2; - if (index /* is still */ >= type_vector_length) - type_vector_length = index * 2; + if (idx /* is still */ >= type_vector_length) + type_vector_length = idx * 2; type_vector = (struct type **) xrealloc ((char *) type_vector, @@ -341,7 +341,7 @@ coff_lookup_type (int index) memset (&type_vector[old_vector_length], 0, (type_vector_length - old_vector_length) * sizeof (struct type *)); } - return &type_vector[index]; + return &type_vector[idx]; } /* Make sure there is a type allocated for type number index @@ -349,9 +349,9 @@ coff_lookup_type (int index) This can create an empty (zeroed) type object. */ static struct type * -coff_alloc_type (int index) +coff_alloc_type (int idx) { - struct type **type_addr = coff_lookup_type (index); + struct type **type_addr = coff_lookup_type (idx); struct type *type = *type_addr; /* If we are referring to a type not known at all yet, @@ -1977,7 +1977,7 @@ decode_base_type (struct coff_symbol *cs, object describing the type. */ static struct type * -coff_read_struct_type (int index, int length, int lastsym, +coff_read_struct_type (int idx, int length, int lastsym, struct objfile *objfile) { struct nextfield @@ -1998,7 +1998,7 @@ coff_read_struct_type (int index, int length, int lastsym, union internal_auxent sub_aux; int done = 0; - type = coff_alloc_type (index); + type = coff_alloc_type (idx); TYPE_CODE (type) = TYPE_CODE_STRUCT; INIT_CPLUS_SPECIFIC (type); TYPE_LENGTH (type) = length; @@ -2070,7 +2070,7 @@ coff_read_struct_type (int index, int length, int lastsym, Also defines the symbols that represent the values of the type. */ static struct type * -coff_read_enum_type (int index, int length, int lastsym, +coff_read_enum_type (int idx, int length, int lastsym, struct objfile *objfile) { struct gdbarch *gdbarch = get_objfile_arch (objfile); @@ -2089,7 +2089,7 @@ coff_read_enum_type (int index, int length, int lastsym, char *name; int unsigned_enum = 1; - type = coff_alloc_type (index); + type = coff_alloc_type (idx); if (within_function) symlist = &local_symbols; else -- 1.7.5.4