qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/4] qapi: Correctly handle downstream extens


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 3/4] qapi: Correctly handle downstream extensions in more locations
Date: Tue, 05 May 2015 06:33:41 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/29/2015 05:29 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
>> Now that c_var() handles '.' in downstream extension names, fix
>> the generator to support such names as additional types, enums,
>> members within an enum, branches of a union or alternate, and
>> in arrays.
>>

>> -def generate_visit_list(name, members):
>> +def generate_visit_list(name, members, builtin=False):
>> +    if not builtin:
>> +        name = c_var(name)
> 
> Fun.
> 
> c_var() does two things:
> 
> (a) it protects certain words if protect=True
> 
> (b) it maps funny characters to '_'.
> 
> When builtin, (a) is unwanted, and (b) does nothing.  That's why we need
> the conditional.
> 
> A possible alternative could be c_var(name, not builtin).  Matter of
> taste.
> 
> Hmm, just saw what type_name() does.  Why not just
> 
>     name = type_name(name)
> 
> ?

Oops, I think I missed this comment in my v3 posting, amidst all my
patch splitting.


> 
> If it was my patch, I'd be tempted to split it up some.  Matter of
> taste, feel free to keep it a single patch.

v3 splits it up.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]