diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qapi-commands.py | 4 | ||||
-rw-r--r-- | scripts/qapi-event.py | 2 | ||||
-rw-r--r-- | scripts/qapi-types.py | 2 | ||||
-rw-r--r-- | scripts/qapi-visit.py | 28 | ||||
-rw-r--r-- | scripts/qapi.py | 4 |
5 files changed, 20 insertions, 20 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 561e47a42b..91c5a4e8cd 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -131,7 +131,7 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, QObject **ret_out, Visitor *v; v = qmp_output_get_visitor(qov); - visit_type_%(c_name)s(v, &ret_in, "unused", &err); + visit_type_%(c_name)s(v, "unused", &ret_in, &err); if (err) { goto out; } @@ -142,7 +142,7 @@ out: qmp_output_visitor_cleanup(qov); qdv = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(qdv); - visit_type_%(c_name)s(v, &ret_in, "unused", NULL); + visit_type_%(c_name)s(v, "unused", &ret_in, NULL); qapi_dealloc_visitor_cleanup(qdv); } ''', diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index 0f5534f6c3..edd446b74d 100644 --- a/scripts/qapi-event.py +++ b/scripts/qapi-event.py @@ -63,7 +63,7 @@ def gen_event_send(name, arg_type): qov = qmp_output_visitor_new(); v = qmp_output_get_visitor(qov); - visit_start_struct(v, NULL, NULL, "%(name)s", 0, &err); + visit_start_struct(v, "%(name)s", NULL, NULL, 0, &err); ''', name=name) ret += gen_err_check() diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 0d862698a4..d3f631a2f4 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -155,7 +155,7 @@ void qapi_free_%(c_name)s(%(c_name)s *obj) qdv = qapi_dealloc_visitor_new(); v = qapi_dealloc_get_visitor(qdv); - visit_type_%(c_name)s(v, &obj, NULL, NULL); + visit_type_%(c_name)s(v, NULL, &obj, NULL); qapi_dealloc_visitor_cleanup(qdv); } ''', 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)) diff --git a/scripts/qapi.py b/scripts/qapi.py index 9254e48fe3..7519cf8e7a 100644 --- a/scripts/qapi.py +++ b/scripts/qapi.py @@ -1647,7 +1647,7 @@ def gen_visit_fields(members, prefix='', need_cast=False, skiperr=False, for memb in members: if memb.optional: ret += mcgen(''' - if (visit_optional(v, &%(prefix)shas_%(c_name)s, "%(name)s")) { + if (visit_optional(v, "%(name)s", &%(prefix)shas_%(c_name)s)) { ''', prefix=prefix, c_name=c_name(memb.name), name=memb.name) @@ -1660,7 +1660,7 @@ def gen_visit_fields(members, prefix='', need_cast=False, skiperr=False, cast = '' ret += mcgen(''' - visit_type_%(c_type)s(v, %(cast)s&%(prefix)s%(c_name)s, "%(name)s", %(errp)s); + visit_type_%(c_type)s(v, "%(name)s", %(cast)s&%(prefix)s%(c_name)s, %(errp)s); ''', c_type=memb.type.c_name(), prefix=prefix, cast=cast, c_name=c_name(memb.name), name=memb.name, |