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

2015-12-10 Thread Eric Blake
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 =

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

2015-12-10 Thread Eric Blake
On 12/10/2015 10:32 AM, Eric Blake wrote: > 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

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

2015-12-08 Thread David Gibson
On Mon, Dec 07, 2015 at 08:55:19PM -0700, Eric Blake wrote: > We have two uses of list visits in the entire code base: one in > spapr_drc (which completely avoids visit_next_list(), feeding in > integers from a different source than uint8List), and one in > qapi-visit.py (that is, all other list

[Qemu-devel] [PATCH v7 29/31] qapi: Simplify semantics of visit_next_list()

2015-12-07 Thread Eric Blake
We have two uses of list visits in the entire code base: one in spapr_drc (which completely avoids visit_next_list(), feeding in integers from a different source than uint8List), and one in qapi-visit.py (that is, all other list visitors are generated in qapi-visit.c, and share the same paradigm