On 08/04/2015 09:58 AM, Markus Armbruster wrote: > Generated qapi-event.[ch] lose line breaks. No change otherwise. > > Signed-off-by: Markus Armbruster <arm...@redhat.com> --- > scripts/qapi-commands.py | 11 ++--------- scripts/qapi-event.py | > 18 +++--------------- scripts/qapi.py | 16 ++++++++++++++++ > 3 files changed, 21 insertions(+), 24 deletions(-) >
> +++ b/scripts/qapi-event.py @@ -14,21 +14,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)) Converting from "" % (list) to... > - 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')} ...direct "" % {dict}. I hadn't seen that before in any of the qapi*.py (I guess I'm too used to seeing mcgen() calls, where the dict is implied via the **kwds magic). But since you don't want to call mcgen() on the same input twice, it looks correct. Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature