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