From c6ce030ba9cbe741053426c4b03b33c0785d6b41 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 15 Dec 2023 22:19:25 -0500 Subject: [PATCH] sim: erc32: fix -Wunused-variable warnings --- sim/erc32/erc32.c | 3 --- sim/erc32/func.c | 2 ++ sim/erc32/interf.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sim/erc32/erc32.c b/sim/erc32/erc32.c index 32c45bddb68..c4abab2889c 100644 --- a/sim/erc32/erc32.c +++ b/sim/erc32/erc32.c @@ -1632,10 +1632,7 @@ memory_read(int32_t asi, uint32_t addr, void *data, int32_t sz, int32_t *ws) int memory_write(int32_t asi, uint32_t addr, uint32_t *data, int32_t sz, int32_t *ws) { - uint32_t byte_addr; - uint32_t byte_mask; uint32_t waddr; - uint32_t *ram; int32_t mexc; int i; int wphit[2]; diff --git a/sim/erc32/func.c b/sim/erc32/func.c index f1b230a8f91..3d1296ba230 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -614,7 +614,9 @@ reset_stat(struct pstate *sregs) void show_stat(struct pstate *sregs) { +#ifdef STAT uint32_t iinst; +#endif uint32_t stime; if (sregs->tottime == 0.0) diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c index b487c7ca230..79f01473565 100644 --- a/sim/erc32/interf.c +++ b/sim/erc32/interf.c @@ -332,7 +332,7 @@ sim_fetch_register(SIM_DESC sd, int regno, void *buf, int length) uint64_t sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length) { - int i, len; + int i; const unsigned char *data = buffer; for (i = 0; i < length; i++) { @@ -344,7 +344,7 @@ sim_write (SIM_DESC sd, uint64_t mem, const void *buffer, uint64_t length) uint64_t sim_read (SIM_DESC sd, uint64_t mem, void *buffer, uint64_t length) { - int i, len; + int i; unsigned char *data = buffer; for (i = 0; i < length; i++) {