[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v2 22/47] qapi: QAPISchema code generation h
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RFC v2 22/47] qapi: QAPISchema code generation helper methods |
Date: |
Thu, 23 Jul 2015 06:36:14 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 07/01/2015 02:22 PM, Markus Armbruster wrote:
> New methods c_name(), c_type(), c_null(), json_type(),
> alternate_qtype().
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> scripts/qapi.py | 72
> +++++++++++++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 65 insertions(+), 7 deletions(-)
>
I just noticed:
> @@ -779,6 +811,12 @@ class QAPISchemaEnumType(QAPISchemaType):
> for v in values:
> assert isinstance(v, str)
> self.values = values
> + def c_type(self, is_param=False):
> + return c_name(self.name)
> + def c_null(self):
> + return c_enum_const(self.name, self.values[0])
What does this return for an empty enum, as in { 'enum':'Empty',
'data':[] }? Our testsuite proves we can do that, even if our normal
.json code doesn't use it.
--
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 v2 29/47] qapi: Replace dirty is_c_ptr() by method c_null(), (continued)
[Qemu-devel] [PATCH RFC v2 30/47] qapi: De-duplicate enum code generation, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 34/47] qapi-visit: Rearrange code a bit, Markus Armbruster, 2015/07/01
[Qemu-devel] [PATCH RFC v2 26/47] qapi-types: Convert to QAPISchemaVisitor, fixing flat unions, Markus Armbruster, 2015/07/01