qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list()
Date: Thu, 10 Dec 2015 10:32:14 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/07/2015 08:55 PM, Eric Blake wrote:

> We can greatly simplify things by hoisting the special case
> into the start() routine, and flipping the order in the loop
> to visit before advance:
> 
> start(head)
> element = *head
> while (element) {
>     visit(element)
>     element = next(element)
> }
> 

> +++ b/include/qapi/visitor-impl.h
> @@ -40,9 +40,10 @@ struct Visitor
>      void (*end_implicit_struct)(Visitor *v);
> 
>      /* Must be set */
> -    void (*start_list)(Visitor *v, const char *name, Error **errp);
> +    void (*start_list)(Visitor *v, const char *name, GenericList **list,
> +                       Error **errp);

Looking at this, it is inconsistent with start_struct (where name comes
AFTER the object); that is, I think this should probably be:

void (*start_list)(Visitor *v, GenericList **list, const char *name,
Error **errp);

although I'll still wait for review comments before respinning.

-- 
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]