From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10806 invoked by alias); 13 Dec 2011 03:41:34 -0000 Received: (qmail 10610 invoked by uid 22791); 13 Dec 2011 03:41:31 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 03:41:17 +0000 Received: by mail-gx0-f169.google.com with SMTP id i2so7693164ggn.0 for ; Mon, 12 Dec 2011 19:41:17 -0800 (PST) Received: by 10.50.182.199 with SMTP id eg7mr17390004igc.57.1323747677208; Mon, 12 Dec 2011 19:41:17 -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.16 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Dec 2011 19:41:17 -0800 (PST) From: Andrey Smirnov To: gdb-patches@sourceware.org Cc: Andrey Smirnov Subject: [PATCH 047/238] [index] cp-support.c: -Wshadow fix Date: Tue, 13 Dec 2011 03:41:00 -0000 Message-Id: <1323747545-29987-13-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/msg00368.txt.bz2 To ChangeLog: * cp-support.c (cp_find_first_component_aux): Rename `index' to `idx'(-Wshadow). --- gdb/cp-support.c | 60 +++++++++++++++++++++++++++--------------------------- 1 files changed, 30 insertions(+), 30 deletions(-) diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 9e001b2..e2ade9c 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -899,7 +899,7 @@ cp_find_first_component (const char *name) static unsigned int cp_find_first_component_aux (const char *name, int permissive) { - unsigned int index = 0; + unsigned int idx = 0; /* Operator names can show up in unexpected places. Since these can contain parentheses or angle brackets, they can screw up the recursion. But not every string 'operator' is part of an @@ -908,49 +908,49 @@ cp_find_first_component_aux (const char *name, int permissive) 'operator' as starting an operator. */ int operator_possible = 1; - for (;; ++index) + for (;; ++idx) { - switch (name[index]) + switch (name[idx]) { case '<': /* Template; eat it up. The calls to cp_first_component should only return (I hope!) when they reach the '>' terminating the component or a '::' between two components. (Hence the '+ 2'.) */ - index += 1; - for (index += cp_find_first_component_aux (name + index, 1); - name[index] != '>'; - index += cp_find_first_component_aux (name + index, 1)) + idx += 1; + for (idx += cp_find_first_component_aux (name + idx, 1); + name[idx] != '>'; + idx += cp_find_first_component_aux (name + idx, 1)) { - if (name[index] != ':') + if (name[idx] != ':') { demangled_name_complaint (name); return strlen (name); } - index += 2; + idx += 2; } operator_possible = 1; break; case '(': /* Similar comment as to '<'. */ - index += 1; - for (index += cp_find_first_component_aux (name + index, 1); - name[index] != ')'; - index += cp_find_first_component_aux (name + index, 1)) + idx += 1; + for (idx += cp_find_first_component_aux (name + idx, 1); + name[idx] != ')'; + idx += cp_find_first_component_aux (name + idx, 1)) { - if (name[index] != ':') + if (name[idx] != ':') { demangled_name_complaint (name); return strlen (name); } - index += 2; + idx += 2; } operator_possible = 1; break; case '>': case ')': if (permissive) - return index; + return idx; else { demangled_name_complaint (name); @@ -958,39 +958,39 @@ cp_find_first_component_aux (const char *name, int permissive) } case '\0': case ':': - return index; + return idx; case 'o': /* Operator names can screw up the recursion. */ if (operator_possible - && strncmp (name + index, "operator", + && strncmp (name + idx, "operator", LENGTH_OF_OPERATOR) == 0) { - index += LENGTH_OF_OPERATOR; - while (ISSPACE(name[index])) - ++index; - switch (name[index]) + idx += LENGTH_OF_OPERATOR; + while (ISSPACE(name[idx])) + ++idx; + switch (name[idx]) { /* Skip over one less than the appropriate number of characters: the for loop will skip over the last one. */ case '<': - if (name[index + 1] == '<') - index += 1; + if (name[idx + 1] == '<') + idx += 1; else - index += 0; + idx += 0; break; case '>': case '-': - if (name[index + 1] == '>') - index += 1; + if (name[idx + 1] == '>') + idx += 1; else - index += 0; + idx += 0; break; case '(': - index += 1; + idx += 1; break; default: - index += 0; + idx += 0; break; } } -- 1.7.5.4