From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 10/15] sim: m68hc11: fix -Wshadow=local warnings
Date: Thu, 21 Dec 2023 20:23:50 -0500 [thread overview]
Message-ID: <20231222012355.7504-10-vapier@gentoo.org> (raw)
In-Reply-To: <20231222012355.7504-1-vapier@gentoo.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;
--
2.43.0
next prev parent reply other threads:[~2023-12-22 1:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 1:23 [PATCH 01/15] sim: aarch64: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 02/15] sim: arm: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 03/15] sim: bfin: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 04/15] sim: common: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 05/15] sim: cris: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 06/15] sim: erc32: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 07/15] sim: frv: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 08/15] sim: h8300: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 09/15] sim: iq2000: " Mike Frysinger
2023-12-22 1:23 ` Mike Frysinger [this message]
2023-12-22 1:23 ` [PATCH 11/15] sim: mips: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 12/15] sim: ppc: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 13/15] sim: riscv: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 14/15] sim: sh: " Mike Frysinger
2023-12-22 1:23 ` [PATCH 15/15] sim: warnings: enable -Wshadow=local Mike Frysinger
2023-12-22 15:26 ` Tom Tromey
2023-12-23 4:28 ` [PATCH] sim: m32c: fix -Wshadow=local warnings Mike Frysinger
2023-12-23 4:28 ` [PATCH] sim: cris: disable -Wshadow=local in generated mloop files Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231222012355.7504-10-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).