[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/11] hw/m68k: Clean up local variable shadowing
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 08/11] hw/m68k: Clean up local variable shadowing |
Date: |
Fri, 1 Sep 2023 00:56:03 +0200 |
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>
---
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
- [PATCH 00/11] (few more) Steps towards enabling -Wshadow, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 01/11] tcg: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 02/11] target/arm: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 03/11] target/mips: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 04/11] target/m68k: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 05/11] hw/arm/virt: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 06/11] hw/arm/allwinner: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 07/11] hw/arm/aspeed: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 08/11] hw/m68k: Clean up local variable shadowing,
Philippe Mathieu-Daudé <=
- [PATCH 09/11] hw/ide/ahci: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 10/11] net/eth: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31
- [PATCH 11/11] sysemu/device_tree: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/08/31