> On Feb 28, 2018, at 1:18 PM, Ben Pfaff <[email protected]> wrote:
> 
> Good work.
> 
> It's a little confusing to see CURSOR_NAME as both a macro name and a
> macro argument name.  Could you get rid of the macro entirely, e.g. like
> this?  Otherwise, two different names would be nice.
> 
> diff --git a/lib/cmap.h b/lib/cmap.h
> index 4746c0b3c6f5..2662681c4e38 100644
> --- a/lib/cmap.h
> +++ b/lib/cmap.h
> @@ -236,7 +236,6 @@ void cmap_cursor_advance(struct cmap_cursor *);
>  * allow nesting of CMAP_FOR_EACH loops. */
> #define CURSOR_JOIN2(x,y) x##y
> #define CURSOR_JOIN(x, y) CURSOR_JOIN2(x,y)
> -#define CURSOR_NAME CURSOR_JOIN(cursor_, __COUNTER__)
> 
> #define CMAP_FOR_EACH__(NODE, MEMBER, CMAP, CURSOR_NAME)           \
>     for (struct cmap_cursor CURSOR_NAME = cmap_cursor_start(CMAP); \
> @@ -244,7 +243,8 @@ void cmap_cursor_advance(struct cmap_cursor *);
>         )
> 
> #define CMAP_FOR_EACH(NODE, MEMBER, CMAP) \
> -          CMAP_FOR_EACH__(NODE, MEMBER, CMAP, CURSOR_NAME)
> +          CMAP_FOR_EACH__(NODE, MEMBER, CMAP, \
> +                          CURSOR_JOIN(cursor_, __COUNTER__))
> 
> static inline struct cmap_node *cmap_first(const struct cmap *);
> 
> 
> Acked-by: Ben Pfaff <[email protected]>

That is better.  Thanks!

--Justin


_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to