aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-visit.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r--scripts/qapi-visit.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index ba75667e03..35505acd98 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -29,7 +29,7 @@ def gen_visit_decl(name, scalar=False):
if not scalar:
c_type += '*'
return mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_type)sobj, const char *name, Error **errp);
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_type)sobj, Error **errp);
''',
c_name=c_name(name), c_type=c_type)
@@ -118,11 +118,11 @@ def gen_visit_struct(name, base, members):
# call qapi_free_FOO() to avoid a memory leak of the partial FOO.
ret += mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error **errp)
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error **errp)
{
Error *err = NULL;
- visit_start_struct(v, (void **)obj, "%(name)s", name, sizeof(%(c_name)s), &err);
+ visit_start_struct(v, name, (void **)obj, "%(name)s", sizeof(%(c_name)s), &err);
if (err) {
goto out;
}
@@ -150,7 +150,7 @@ def gen_visit_list(name, element_type):
# call qapi_free_FOOList() to avoid a memory leak of the partial FOOList.
return mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error **errp)
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error **errp)
{
Error *err = NULL;
GenericList *i, **prev;
@@ -164,7 +164,7 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
!err && (i = visit_next_list(v, prev, &err)) != NULL;
prev = &i) {
%(c_name)s *native_i = (%(c_name)s *)i;
- visit_type_%(c_elt_type)s(v, &native_i->value, NULL, &err);
+ visit_type_%(c_elt_type)s(v, NULL, &native_i->value, &err);
}
error_propagate(errp, err);
@@ -180,10 +180,10 @@ out:
def gen_visit_enum(name):
return mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_name)s *obj, const char *name, Error **errp)
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s *obj, Error **errp)
{
int value = *obj;
- visit_type_enum(v, &value, %(c_name)s_lookup, "%(name)s", name, errp);
+ visit_type_enum(v, name, &value, %(c_name)s_lookup, "%(name)s", errp);
*obj = value;
}
''',
@@ -198,7 +198,7 @@ def gen_visit_alternate(name, variants):
ret = mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error **errp)
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error **errp)
{
Error *err = NULL;
@@ -206,7 +206,7 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
if (err) {
goto out;
}
- visit_get_next_type(v, &(*obj)->type, %(promote_int)s, name, &err);
+ visit_get_next_type(v, name, &(*obj)->type, %(promote_int)s, &err);
if (err) {
goto out_obj;
}
@@ -217,7 +217,7 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
for var in variants.variants:
ret += mcgen('''
case %(case)s:
- visit_type_%(c_type)s(v, &(*obj)->u.%(c_name)s, name, &err);
+ visit_type_%(c_type)s(v, name, &(*obj)->u.%(c_name)s, &err);
break;
''',
case=var.type.alternate_qtype(),
@@ -255,11 +255,11 @@ def gen_visit_union(name, base, variants):
ret += mcgen('''
-void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error **errp)
+void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error **errp)
{
Error *err = NULL;
- visit_start_struct(v, (void **)obj, "%(name)s", name, sizeof(%(c_name)s), &err);
+ visit_start_struct(v, name, (void **)obj, "%(name)s", sizeof(%(c_name)s), &err);
if (err) {
goto out;
}
@@ -276,7 +276,7 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
c_name=base.c_name())
else:
ret += mcgen('''
- visit_type_%(c_type)s(v, &(*obj)->%(c_name)s, "%(name)s", &err);
+ visit_type_%(c_type)s(v, "%(name)s", &(*obj)->%(c_name)s, &err);
''',
c_type=variants.tag_member.type.c_name(),
c_name=c_name(variants.tag_member.name),
@@ -300,7 +300,7 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
var.name))
if simple_union_type:
ret += mcgen('''
- visit_type_%(c_type)s(v, &(*obj)->u.%(c_name)s, "data", &err);
+ visit_type_%(c_type)s(v, "data", &(*obj)->u.%(c_name)s, &err);
''',
c_type=simple_union_type.c_name(),
c_name=c_name(var.name))