[ovs-dev] [mirror 05/13] flow: Rename flow_compare() to flow_compare_3way().

Ben Pfaff blp at nicira.com
Thu Oct 27 14:53:33 UTC 2011


Did a Justin Petbot post get misdirected?

On Wed, Oct 26, 2011 at 11:28:01PM -0700, Justin Pettit wrote:
> I'm not square.  Go for it, man!
> 
> --Justin
> 
> 
> On Oct 26, 2011, at 10:09 AM, Ben Pfaff wrote:
> 
> > I like the _3way suffix convention.  It makes the interpretation of the
> > return value clear.  We use it elsewhere in the tree, so use it here too.
> > 
> > There weren't any users of flow_compare() outside of flow.h, but there soon
> > will be.
> > ---
> > lib/flow.h |    6 +++---
> > 1 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/lib/flow.h b/lib/flow.h
> > index e9da2ad..ae4138d 100644
> > --- a/lib/flow.h
> > +++ b/lib/flow.h
> > @@ -91,14 +91,14 @@ void flow_zero_wildcards(struct flow *, const struct flow_wildcards *);
> > char *flow_to_string(const struct flow *);
> > void flow_format(struct ds *, const struct flow *);
> > void flow_print(FILE *, const struct flow *);
> > -static inline int flow_compare(const struct flow *, const struct flow *);
> > +static inline int flow_compare_3way(const struct flow *, const struct flow *);
> > static inline bool flow_equal(const struct flow *, const struct flow *);
> > static inline size_t flow_hash(const struct flow *, uint32_t basis);
> > 
> > void flow_compose(struct ofpbuf *, const struct flow *);
> > 
> > static inline int
> > -flow_compare(const struct flow *a, const struct flow *b)
> > +flow_compare_3way(const struct flow *a, const struct flow *b)
> > {
> >     return memcmp(a, b, FLOW_SIG_SIZE);
> > }
> > @@ -106,7 +106,7 @@ flow_compare(const struct flow *a, const struct flow *b)
> > static inline bool
> > flow_equal(const struct flow *a, const struct flow *b)
> > {
> > -    return !flow_compare(a, b);
> > +    return !flow_compare_3way(a, b);
> > }
> > 
> > static inline size_t
> > -- 
> > 1.7.2.5
> > 
> 



More information about the dev mailing list