aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-10-04 14:00:11 +0200
committerMarkus Armbruster <armbru@redhat.com>2023-10-06 13:27:48 +0200
commite0c7de8dc4a3c0b7a0d0fa21fa0561a4dc763716 (patch)
tree966e545b2af004df908e85ea313ace10f388c10e /qom
parent21c029e65fe6245a64bbab8047903c4883476bd2 (diff)
qom/object_interfaces: Clean up global variable shadowing
Fix: qom/object_interfaces.c:262:53: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:298:46: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool user_creatable_add_from_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:313:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void user_creatable_process_cmdline(const char *optarg) ^ /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-9-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/object_interfaces.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 7d31589b04..e0833c8bfe 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -259,7 +259,7 @@ static void user_creatable_print_help_from_qdict(QDict *args)
}
}
-ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp)
+ObjectOptions *user_creatable_parse_str(const char *str, Error **errp)
{
ERRP_GUARD();
QObject *obj;
@@ -267,14 +267,14 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp)
Visitor *v;
ObjectOptions *options;
- if (optarg[0] == '{') {
- obj = qobject_from_json(optarg, errp);
+ if (str[0] == '{') {
+ obj = qobject_from_json(str, errp);
if (!obj) {
return NULL;
}
v = qobject_input_visitor_new(obj);
} else {
- QDict *args = keyval_parse(optarg, "qom-type", &help, errp);
+ QDict *args = keyval_parse(str, "qom-type", &help, errp);
if (*errp) {
return NULL;
}
@@ -295,12 +295,12 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp)
return options;
}
-bool user_creatable_add_from_str(const char *optarg, Error **errp)
+bool user_creatable_add_from_str(const char *str, Error **errp)
{
ERRP_GUARD();
ObjectOptions *options;
- options = user_creatable_parse_str(optarg, errp);
+ options = user_creatable_parse_str(str, errp);
if (!options) {
return false;
}
@@ -310,9 +310,9 @@ bool user_creatable_add_from_str(const char *optarg, Error **errp)
return !*errp;
}
-void user_creatable_process_cmdline(const char *optarg)
+void user_creatable_process_cmdline(const char *cmdline)
{
- if (!user_creatable_add_from_str(optarg, &error_fatal)) {
+ if (!user_creatable_add_from_str(cmdline, &error_fatal)) {
/* Help was printed */
exit(EXIT_SUCCESS);
}