diff options
author | Eric Blake <eblake@redhat.com> | 2015-09-29 16:21:09 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-10-12 18:46:49 +0200 |
commit | f8b7f1a8eafa9f565ebecfe409e8741d38cd786b (patch) | |
tree | d8a260acd9ac0891d62cb02ddccde9569c3b49ab /scripts/qapi-commands.py | |
parent | 2a0f50e8d973b01eda4c63bac4a5c79ea0f584ef (diff) |
qapi: Consistent generated code: prefer visitor 'v'
We had some pointless differences in the generated code for visit,
command marshalling, and events; unifying them makes it easier for
future patches to consolidate to common helper functions.
This is one patch of a series to clean up these differences.
This patch names the local visitor variable 'v' rather than 'm'.
Related objects, such as 'QapiDeallocVisitor', are also named by
their initials instead of an unrelated leading m.
No change in semantics to the generated code.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1443565276-4535-12-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r-- | scripts/qapi-commands.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 21511200e0..475735daf8 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -82,8 +82,8 @@ def gen_marshal_vars(arg_type, ret_type): if arg_type: ret += mcgen(''' -QmpInputVisitor *mi = qmp_input_visitor_new_strict(QOBJECT(args)); -QapiDeallocVisitor *md; +QmpInputVisitor *qiv = qmp_input_visitor_new_strict(QOBJECT(args)); +QapiDeallocVisitor *qdv; Visitor *v; ''') @@ -122,15 +122,15 @@ def gen_marshal_input_visit(arg_type, dealloc=False): errparg = 'NULL' errarg = None ret += mcgen(''' -qmp_input_visitor_cleanup(mi); -md = qapi_dealloc_visitor_new(); -v = qapi_dealloc_get_visitor(md); +qmp_input_visitor_cleanup(qiv); +qdv = qapi_dealloc_visitor_new(); +v = qapi_dealloc_get_visitor(qdv); ''') else: errparg = '&err' errarg = 'err' ret += mcgen(''' -v = qmp_input_get_visitor(mi); +v = qmp_input_get_visitor(qiv); ''') for memb in arg_type.members: @@ -160,7 +160,7 @@ visit_type_%(c_type)s(v, &%(c_name)s, "%(name)s", %(errp)s); if dealloc: ret += mcgen(''' -qapi_dealloc_visitor_cleanup(md); +qapi_dealloc_visitor_cleanup(qdv); ''') pop_indent() return ret @@ -172,24 +172,24 @@ def gen_marshal_output(ret_type): static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, QObject **ret_out, Error **errp) { Error *err = NULL; - QmpOutputVisitor *mo = qmp_output_visitor_new(); - QapiDeallocVisitor *md; + QmpOutputVisitor *qov = qmp_output_visitor_new(); + QapiDeallocVisitor *qdv; Visitor *v; - v = qmp_output_get_visitor(mo); + v = qmp_output_get_visitor(qov); visit_type_%(c_name)s(v, &ret_in, "unused", &err); if (err) { goto out; } - *ret_out = qmp_output_get_qobject(mo); + *ret_out = qmp_output_get_qobject(qov); out: error_propagate(errp, err); - qmp_output_visitor_cleanup(mo); - md = qapi_dealloc_visitor_new(); - v = qapi_dealloc_get_visitor(md); + 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); - qapi_dealloc_visitor_cleanup(md); + qapi_dealloc_visitor_cleanup(qdv); } ''', c_type=ret_type.c_type(), c_name=ret_type.c_name()) |