[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/56] hw/m68k: Clean up local variable shadowing
From: |
Markus Armbruster |
Subject: |
[PULL 17/56] hw/m68k: Clean up local variable shadowing |
Date: |
Fri, 29 Sep 2023 10:50:14 +0200 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Fix:
hw/m68k/virt.c:263:13: error: declaration shadows a local variable
[-Werror,-Wshadow]
BOOTINFOSTR(param_ptr, BI_COMMAND_LINE,
^
hw/m68k/bootinfo.h:47:13: note: expanded from macro 'BOOTINFOSTR'
int i; \
^
hw/m68k/virt.c:130:9: note: previous declaration is here
int i;
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904161235.84651-13-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
hw/m68k/bootinfo.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/m68k/bootinfo.h b/hw/m68k/bootinfo.h
index a3d37e3c80..0e6e3eea87 100644
--- a/hw/m68k/bootinfo.h
+++ b/hw/m68k/bootinfo.h
@@ -44,15 +44,14 @@
#define BOOTINFOSTR(base, id, string) \
do { \
- int i; \
stw_p(base, id); \
base += 2; \
stw_p(base, \
(sizeof(struct bi_record) + strlen(string) + \
1 /* null termination */ + 3 /* padding */) & ~3); \
base += 2; \
- for (i = 0; string[i]; i++) { \
- stb_p(base++, string[i]); \
+ for (unsigned i_ = 0; string[i_]; i_++) { \
+ stb_p(base++, string[i_]); \
} \
stb_p(base++, 0); \
base = QEMU_ALIGN_PTR_UP(base, 4); \
@@ -60,7 +59,6 @@
#define BOOTINFODATA(base, id, data, len) \
do { \
- int i; \
stw_p(base, id); \
base += 2; \
stw_p(base, \
@@ -69,8 +67,8 @@
base += 2; \
stw_p(base, len); \
base += 2; \
- for (i = 0; i < len; ++i) { \
- stb_p(base++, data[i]); \
+ for (unsigned i_ = 0; i_ < len; ++i_) { \
+ stb_p(base++, data[i_]); \
} \
base = QEMU_ALIGN_PTR_UP(base, 4); \
} while (0)
--
2.41.0
- [PULL 04/56] block/dirty-bitmap: Clean up local variable shadowing, (continued)
- [PULL 04/56] block/dirty-bitmap: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 02/56] migration: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 49/56] seccomp: avoid shadowing of 'action' variable, Markus Armbruster, 2023/09/29
- [PULL 47/56] intel_iommu: Fix shadow local variables on "size", Markus Armbruster, 2023/09/29
- [PULL 12/56] target/m68k: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 34/56] spapr/drc: Clean up local variable shadowing in rtas_ibm_configure_connector(), Markus Armbruster, 2023/09/29
- [PULL 38/56] hw/acpi: changes towards enabling -Wshadow=local, Markus Armbruster, 2023/09/29
- [PULL 32/56] spapr: Clean up local variable shadowing in spapr_init_cpus(), Markus Armbruster, 2023/09/29
- [PULL 23/56] linux-user/strace: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 13/56] target/tricore: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 17/56] hw/m68k: Clean up local variable shadowing,
Markus Armbruster <=
- [PULL 25/56] softmmu/memory: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 26/56] softmmu/physmem: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 41/56] hw/arm/smmuv3.c: Avoid shadowing variable, Markus Armbruster, 2023/09/29
- [PULL 21/56] crypto/cipher-gnutls.c: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 29/56] hw/ppc: Clean up local variable shadowing in _FDT helper routine, Markus Armbruster, 2023/09/29
- [PULL 16/56] hw/arm/allwinner: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 20/56] net/eth: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 10/56] target/arm/hvf: Clean up local variable shadowing, Markus Armbruster, 2023/09/29
- [PULL 39/56] hw/intc/arm_gicv3_its: Avoid shadowing variable in do_process_its_cmd(), Markus Armbruster, 2023/09/29
- [PULL 33/56] spapr: Clean up local variable shadowing in spapr_get_fw_dev_path(), Markus Armbruster, 2023/09/29