diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-10-04 14:00:04 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2023-10-06 13:16:57 +0200 |
commit | badf708d698853ce572c7dd41de6d81de1dedcbe (patch) | |
tree | 5db23b49f39c8fbaf0cca1c2c1de9b5bd7365344 /hw | |
parent | 71efffbcfc4ee4fb68228e7bafcc35cc6b2d8af0 (diff) |
hw/audio/soundhw: Clean up global variable shadowing
Fix:
hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
void select_soundhw(const char *optarg, const char *audiodev)
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here
extern char *optarg; /* getopt(3) external variables */
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20231004120019.93101-2-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/audio/soundhw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 94d9463e42..b387b0ef7d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -83,7 +83,7 @@ void show_valid_soundhw(void) static struct soundhw *selected = NULL; static const char *audiodev_id; -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } for (c = soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected = c; audiodev_id = audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } |