Skip to content

Commit ca84e7b

Browse files
philmdMarkus Armbruster
authored andcommitted
util/guest-random: Clean up global variable shadowing
Fix: util/guest-random.c:90:45: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] int qemu_guest_random_seed_main(const char *optarg, Error **errp) ^ /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é <[email protected]> Message-ID: <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Signed-off-by: Markus Armbruster <[email protected]>
1 parent 5bebe03 commit ca84e7b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/qemu/guest-random.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
#define QEMU_GUEST_RANDOM_H
1414

1515
/**
16-
* qemu_guest_random_seed_main(const char *optarg, Error **errp)
17-
* @optarg: a non-NULL pointer to a C string
16+
* qemu_guest_random_seed_main(const char *seedstr, Error **errp)
17+
* @seedstr: a non-NULL pointer to a C string
1818
* @errp: an error indicator
1919
*
20-
* The @optarg value is that which accompanies the -seed argument.
20+
* The @seedstr value is that which accompanies the -seed argument.
2121
* This forces qemu_guest_getrandom into deterministic mode.
2222
*
2323
* Returns 0 on success, < 0 on failure while setting *errp.
2424
*/
25-
int qemu_guest_random_seed_main(const char *optarg, Error **errp);
25+
int qemu_guest_random_seed_main(const char *seedstr, Error **errp);
2626

2727
/**
2828
* qemu_guest_random_seed_thread_part1(void)

util/guest-random.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ void qemu_guest_random_seed_thread_part2(uint64_t seed)
8787
}
8888
}
8989

90-
int qemu_guest_random_seed_main(const char *optarg, Error **errp)
90+
int qemu_guest_random_seed_main(const char *seedstr, Error **errp)
9191
{
9292
uint64_t seed;
93-
if (parse_uint_full(optarg, 0, &seed)) {
94-
error_setg(errp, "Invalid seed number: %s", optarg);
93+
if (parse_uint_full(seedstr, 0, &seed)) {
94+
error_setg(errp, "Invalid seed number: %s", seedstr);
9595
return -1;
9696
} else {
9797
deterministic = true;

0 commit comments

Comments
 (0)