[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v10 07/25] qapi-visit: Split off visit_type_FOO_
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v10 07/25] qapi-visit: Split off visit_type_FOO_fields forward decl |
Date: |
Fri, 23 Oct 2015 13:44:22 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 10/23/2015 12:05 PM, Markus Armbruster wrote:
>>>> def gen_visit_struct_fields(name, base, members):
>>>> - struct_fields_seen.add(name)
>>>> -
>>>> ret = ''
>>>>
>>>> if base:
>>>> ret += gen_visit_implicit_struct(base)
>>>>
>>>> + struct_fields_seen.add(name)
>>>> ret += mcgen('''
>>>>
>>>
>>> Minor cleanup not mentioned in commit message. Okay.
>>
>> Not minor, and I probably should mention it explicitly in the message. I
>> moved it to make sure that gen_visit_implicit_struct() properly emits a
>> forward declaration when necessary; we must not modify
>> struct_fields_seen any sooner than when the next thing in the output
>> stream is either the forward declaration or the implementation.
>
> The proper place for the .add() is right next to where the thing it
> tracks gets done, no argument.
>
> I believe your cleanup makes an actual difference only when
> gen_visit_implicit_struct(base) can call gen_visit_struct_fields(name).
> Obviously impossible now, which is why I called it "minor".
Oh, I was probably confusing that the implicit struct is for a different
type (base) than what we are adding to struct_fields_seen (name).
>
> PATCH 10 will drop the code between the old spot and the new spot.
> Unless something between this patch and PATCH 10 depends on this
> cleanup, I'd simply leave it dirty until then.
Indeed, dropping this hunk and letting subsequent cleanup do it right
makes no difference. Will add it to my fixup queue.
--
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 v10 01/25] tests/qapi-schema: Test for reserved names, empty struct, (continued)
[Qemu-devel] [PATCH v10 04/25] qapi: Reserve '*List' type names for list types, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 13/25] qapi-visit: Convert to new qapi union layout, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 07/25] qapi-visit: Split off visit_type_FOO_fields forward decl, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 10/25] qapi: Unbox base members, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 21/25] tpm: Convert to new qapi union layout, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 17/25] net: Convert to new qapi union layout, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 25/25] qapi: Simplify gen_struct_field(), Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 12/25] qapi: Start converting to new qapi union layout, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 15/25] block: Convert to new qapi union layout, Eric Blake, 2015/10/23
[Qemu-devel] [PATCH v10 14/25] tests: Convert to new qapi union layout, Eric Blake, 2015/10/23