From 03b4367a556179e3e59affa535493427bd009e9d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 16 Sep 2015 13:06:20 +0200 Subject: qapi: De-duplicate parameter list generation Generated qapi-event.[ch] lose line breaks. No change otherwise. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Daniel P. Berrange Message-Id: <1442401589-24189-18-git-send-email-armbru@redhat.com> --- scripts/qapi-event.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'scripts/qapi-event.py') diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index 5873a05..d15fad9 100644 --- a/scripts/qapi-event.py +++ b/scripts/qapi-event.py @@ -15,21 +15,9 @@ from qapi import * def gen_event_send_proto(name, arg_type): - api_name = "void qapi_event_send_%s(" % c_name(name).lower() - l = len(api_name) - - if arg_type: - for m in arg_type.members: - if m.optional: - api_name += "bool has_%s,\n" % c_name(m.name) - api_name += "".ljust(l) - - api_name += "%s %s,\n" % (m.type.c_type(is_param=True), - c_name(m.name)) - api_name += "".ljust(l) - - api_name += "Error **errp)" - return api_name + return 'void qapi_event_send_%(c_name)s(%(param)s)' % { + 'c_name': c_name(name.lower()), + 'param': gen_params(arg_type, 'Error **errp')} def gen_event_send_decl(name, arg_type): -- cgit v1.1