diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-01 16:41:41 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-07-12 17:51:54 +0200 |
commit | 086ee7a6200fa5ad795b12110b5b3d5a93dcac3e (patch) | |
tree | 0de1897c3b5fa65572d1d7972b7ab8477bbc16e6 /scripts/qapi-commands.py | |
parent | 8a4613a0ab4b6e9271e64aaa88f588ed1b749eb4 (diff) | |
download | qemu-086ee7a6200fa5ad795b12110b5b3d5a93dcac3e.zip qemu-086ee7a6200fa5ad795b12110b5b3d5a93dcac3e.tar.gz qemu-086ee7a6200fa5ad795b12110b5b3d5a93dcac3e.tar.bz2 |
scripts: use build_ prefix for string not piped through cgen()
The gen_ prefix is awkward. Generated C should go through cgen()
exactly once (see commit 1f9a7a1). The common way to get this wrong is
passing a foo=gen_foo() keyword argument to mcgen(). I'd like us to
adopt a naming convention where gen_ means "something that's been piped
through cgen(), and thus must not be passed to cgen() or mcgen()".
Requires renaming gen_params(), gen_marshal_proto() and
gen_event_send_proto().
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170601124143.10915-1-marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 1943de4..974d0a4 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -21,7 +21,7 @@ def gen_command_decl(name, arg_type, boxed, ret_type): ''', c_type=(ret_type and ret_type.c_type()) or 'void', c_name=c_name(name), - params=gen_params(arg_type, boxed, 'Error **errp')) + params=build_params(arg_type, boxed, 'Error **errp')) def gen_call(name, arg_type, boxed, ret_type): @@ -82,7 +82,7 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, QObject **ret_out, c_type=ret_type.c_type(), c_name=ret_type.c_name()) -def gen_marshal_proto(name): +def build_marshal_proto(name): return ('void qmp_marshal_%s(QDict *args, QObject **ret, Error **errp)' % c_name(name)) @@ -91,7 +91,7 @@ def gen_marshal_decl(name): return mcgen(''' %(proto)s; ''', - proto=gen_marshal_proto(name)) + proto=build_marshal_proto(name)) def gen_marshal(name, arg_type, boxed, ret_type): @@ -103,7 +103,7 @@ def gen_marshal(name, arg_type, boxed, ret_type): { Error *err = NULL; ''', - proto=gen_marshal_proto(name)) + proto=build_marshal_proto(name)) if ret_type: ret += mcgen(''' |