[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 02/19] qapi: Fix C identifiers generated for
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RFC 02/19] qapi: Fix C identifiers generated for names containing '.' |
Date: |
Thu, 02 Apr 2015 15:48:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 04/02/2015 11:28 AM, Markus Armbruster wrote:
> c_fun() maps '.' to '_', c_var() doesn't. Nothing prevents '.' in
> QAPI names that get passed to c_var().
>
> Which QAPI names get passed to c_fun(), to c_var(), or to both is not
> obvious. Names of command parameters and struct type members get
> passed to c_var().
>
> c_var() strips a leading '*', but this cannot happen. c_fun()
> doesn't.
>
> Fix c_var() to work exactly like c_fun().
>
> Perhaps they should be replaced by a single mapping function.
How much harder is that to do?
Also, this commit probably means my qapi testsuite enhancements ought to
add tests that we support downstream extensions (__name.name_blah) in a
variety of situations. But I'm merely adding it to my (growing) list of
post-series additions, and won't hold up v6 adding it.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> scripts/qapi.py | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
If it's not too hard to use a single mapping function, that might look
prettier. But from the raw perspective of fixing an inconsistency in
the code:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH RFC 04/19] qapi: Rename generate_enum_full_value() to c_enum_const(), (continued)
- [Qemu-devel] [PATCH RFC 03/19] qapi: Rename _generate_enum_string() to camel_to_upper(), Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 05/19] qapi: Simplify c_enum_const(), Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 01/19] tests: Add missing dependencies on $(qapi-py), Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 08/19] qapi: qapi-event.py option -b does nothing, drop it, Markus Armbruster, 2015/04/02
- [Qemu-devel] [PATCH RFC 02/19] qapi: Fix C identifiers generated for names containing '.', Markus Armbruster, 2015/04/02
- Re: [Qemu-devel] [PATCH RFC 00/19] qapi: QMP introspection, Eric Blake, 2015/04/02
- Re: [Qemu-devel] [PATCH RFC 00/19] qapi: QMP introspection, Eric Blake, 2015/04/06