From patchwork Fri Dec 22 01:23:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 82720 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 CBEFF385E01F for ; Fri, 22 Dec 2023 01:24:43 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 059163858427 for ; Fri, 22 Dec 2023 01:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 059163858427 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 059163858427 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=1703208258; cv=none; b=FTYLdq8AgE/ugrYS/6oVESLItj+wTMuLRBDilBAb4Fr4ERZW7W7NvBxGeSqV9O/kWeAOqaX47w5eglLpYuC2ovQEqHxzDVVBcoqvTMA+CQ2dkag4OfTDBLBjfKSHR0nBcDLmRe/eb8GuEakIA9dCH/vAMGT2AqVUOYMxm8GhCro= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703208258; c=relaxed/simple; bh=t0VqkLzbS4Ex2eZ7dUPJTl6QN5dkmXfPTAo09pP054Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=KlanO/l2KNFRJ9biPyDBOP0ugtlsNu2vr9bf8AsZkm8aFT/nmco4aoWpqeHZzxdvZEwQnZ19OAI4O467b3Oj22kP8UUcD9g6bvCQEbS2Pa9FdktVJCgtK1Gjn6qy0jsDxQ1C+/NCvsiMohGYHo0l+1ju4BtjFmdZvQR0RJbIsAs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id A7CBF342F65; Fri, 22 Dec 2023 01:24:16 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH 10/15] sim: m68hc11: fix -Wshadow=local warnings Date: Thu, 21 Dec 2023 20:23:50 -0500 Message-ID: <20231222012355.7504-10-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 Delete redundant decls when the existing scope has the same var and type available for use. --- sim/m68hc11/dv-m68hc11.c | 3 +-- sim/m68hc11/dv-m68hc11sio.c | 2 +- sim/m68hc11/interp.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sim/m68hc11/dv-m68hc11.c b/sim/m68hc11/dv-m68hc11.c index ef18f0999360..fc8b22cede3f 100644 --- a/sim/m68hc11/dv-m68hc11.c +++ b/sim/m68hc11/dv-m68hc11.c @@ -782,7 +782,6 @@ m68hc11_option_handler (SIM_DESC sd, sim_cpu *cpu, osc = &controller->oscillators[i]; if (osc->event) { - double f; int cur_value; int next_value; char freq[32]; @@ -927,7 +926,7 @@ m68hc11cpu_set_port (struct hw *me, sim_cpu *cpu, /* Scan IC3, IC2 and IC1. Bit number is 3 - i. */ for (i = 0; i < 3; i++) { - uint8_t mask = (1 << i); + mask = (1 << i); if (delta & mask) { diff --git a/sim/m68hc11/dv-m68hc11sio.c b/sim/m68hc11/dv-m68hc11sio.c index 03b44613c180..f77dfdec1f99 100644 --- a/sim/m68hc11/dv-m68hc11sio.c +++ b/sim/m68hc11/dv-m68hc11sio.c @@ -227,7 +227,7 @@ m68hc11sio_port_event (struct hw *me, simulate some initial setup by the internal rom. */ if (((m68hc11_cpu->ios[M6811_HPRIO]) & (M6811_SMOD | M6811_MDA)) == M6811_SMOD) { - unsigned char val = 0x33; + val = 0x33; m68hc11sio_io_write_buffer (me, &val, io_map, (unsigned_word) M6811_BAUD, 1); diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index df6bd7bea565..c4d5c22fa075 100644 --- a/sim/m68hc11/interp.c +++ b/sim/m68hc11/interp.c @@ -478,7 +478,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, /* CPU specific initialization. */ for (i = 0; i < MAX_NR_PROCESSORS; ++i) { - SIM_CPU *cpu = STATE_CPU (sd, i); + cpu = STATE_CPU (sd, i); CPU_REG_FETCH (cpu) = m68hc11_reg_fetch; CPU_REG_STORE (cpu) = m68hc11_reg_store;