From patchwork Fri Dec 22 01:23:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82723 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6307C386C5B2 for ; Fri, 22 Dec 2023 01:24:54 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 66C3B3858C2F for ; Fri, 22 Dec 2023 01:24:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 66C3B3858C2F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 66C3B3858C2F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208245; cv=none; b=xp+NrGU4MUvm16m3W3Ye45lXE3fyWU5v6FlysrOoQBiPwhi/lNrR7cBjg8gjWP/+rTfywZsOKYA6U/TykoeCqt5aF2D04beKmpYAEh7aHi+j80IY7MRQv/HD8axeULzwUteTjFol6GpZ6RhNma+Gt6PLmopFYACwBThNZ6NUdz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208245; c=relaxed/simple; bh=8jktfVC5mWVUHxANkhb1mVlQLz4sk1UyGrhfCWqTKtU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=fpXSQETDSlTReynBG+8ed9DW/P1j73qmeth9S5bAxNGpzsAwyd0aoPJs3ANvTTlLQeobP/RMH5UwHAgUZ8BPrzvilSEbM3B2iTpKH7/zHqdLnZt9Pmi8wJHVo0n3cBTAzHV/2GwE4yieGtfjvKzIAMQU7vjAckuqLjre/vS4xdU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id E3EF7340DE6; Fri, 22 Dec 2023 01:24:03 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 04/15] sim: common: fix -Wshadow=local warnings Date: Thu, 21 Dec 2023 20:23:44 -0500 Message-ID: <20231222012355.7504-4-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222012355.7504-1-vapier@gentoo.org> References: <20231222012355.7504-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Rename shadowed vars with different types, and delete redundant decls. --- sim/common/sim-fpu.c | 4 ++-- sim/common/sim-options.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sim/common/sim-fpu.c b/sim/common/sim-fpu.c index 491a99b7212e..4ee26723ee26 100644 --- a/sim/common/sim-fpu.c +++ b/sim/common/sim-fpu.c @@ -413,9 +413,9 @@ unpack_fpu (sim_fpu *dst, uint64_t packed, int is_double) } else { - uint32_t val = pack_fpu (dst, 0); + uint32_t fval = pack_fpu (dst, 0); uint32_t org = packed; - ASSERT (val == org); + ASSERT (fval == org); } } } diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index 9f238339fb8f..c695db687cb1 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -496,7 +496,7 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, case OPTION_ENV_UNSET: { - int i, varlen; + int varlen; char **envp; if (STATE_PROG_ENVP (sd) == NULL)