list: make LIST_FOR_EACH_ENTRY look more like a for loop

Robert Shearman rob at codeweavers.com
Thu May 19 07:36:06 CDT 2005


Dimi Paun wrote:

>I've always been a bit confused about the parameters to the
>list macros. If you don't use them much (which I didn't) it's
>hard to remember them. I think it would be best if we are
>consistent with other for loops out there.
>
>ChangeLog
>    Change the parameter order for LIST_FOR_EACH_ENTRY()
>    to more closely match the for loop.
>
>
>  
>
>------------------------------------------------------------------------
>
>Index: ./include/wine/list.h
>===================================================================
>RCS file: /var/cvs/wine/include/wine/list.h,v
>retrieving revision 1.6
>diff -u -p -r1.6 list.h
>--- ./include/wine/list.h	18 May 2005 13:24:46 -0000	1.6
>+++ ./include/wine/list.h	19 May 2005 12:19:33 -0000
>@@ -55,7 +55,7 @@ struct list
>  * And to iterate over it:
>  *
>  *   struct gadget *gadget;
>- *   LIST_FOR_EACH_ENTRY( gadget, &global_gadgets, struct gadget, entry )
>+ *   LIST_FOR_EACH_ENTRY( struct gadget, entry, &global_gadgets, gadget )
>  *   {
>  *       ...
>  *   }
>  
>

I don't think this makes any more sense with your patch than before. 
LIST_FOR_EACH_ENTRY is different to a for statement because 
LIST_FOR_EACH_ENTRY doesn't declare the start condition, end condition 
and iterator because these are defined by the macro itself. The 
parameters are really just defining what you are iterating on and what 
you are using.

Rob



More information about the wine-devel mailing list