qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, akong@redhat.com, berto@igalia.com,
	qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
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	[thread overview]
Message-ID: <5548B8A5.3040303@redhat.com> (raw)
In-Reply-To: <87y4lb6uls.fsf@blackfin.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

On 04/29/2015 05:29 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  parent reply	other threads:[~2015-05-05 12:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-11 18:09 [Qemu-devel] [PATCH v2 0/4] Fix C identifiers generated for names containing '.' Eric Blake
2015-04-11 18:09 ` [Qemu-devel] [PATCH v2 1/4] qapi: " Eric Blake
2015-04-15  8:01   ` Alberto Garcia
2015-04-11 18:09 ` [Qemu-devel] [PATCH v2 2/4] qapi: Drop duplicate c_fun() in favor of c_var() Eric Blake
2015-04-15  8:03   ` Alberto Garcia
2015-04-29 11:04   ` Markus Armbruster
2015-05-01 17:00     ` Eric Blake
2015-04-11 18:09 ` [Qemu-devel] [PATCH v2 3/4] qapi: Correctly handle downstream extensions in more locations Eric Blake
2015-04-29 11:29   ` Markus Armbruster
2015-04-29 15:30     ` Eric Blake
2015-04-30 22:30       ` Eric Blake
2015-05-05 12:33     ` Eric Blake [this message]
2015-04-11 18:09 ` [Qemu-devel] [PATCH v2 4/4] qapi: Test name mangling of downstream extensions Eric Blake
2015-04-29 11:32   ` Markus Armbruster
2015-04-29 15:45     ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5548B8A5.3040303@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).