Skip to content

Commit

Permalink
flow: Fix MSVC compile errors.
Browse files Browse the repository at this point in the history
This fixes some MSVC build errors introduced by commit 74ff329
(userspace: Define and use struct eth_addr.)

MSVC doesn't like the change in 'const' between function declaration and
definition: it reports "formal parameter 2 different from declaration" for
each of the functions in flow.h corrected by this (commit.  I think it's
technically wrong about that, standards-wise.)

MSVC doesn't like an empty-brace initializer.  (I think it's technically
right about that, standards-wise.)

This commit attempts to fix both problems, but I have not tested it with
MSVC.

CC: Jarno Rajahalme <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Nithin Raju <[email protected]>
Tested-by: Nithin Raju <[email protected]>
  • Loading branch information
blp committed Aug 31, 2015
1 parent 572e54f commit aba5d6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ miniflow_extract(struct dp_packet *packet, struct miniflow *dst)
} else if (OVS_LIKELY(nw_proto == IPPROTO_ICMPV6)) {
if (OVS_LIKELY(size >= sizeof(struct icmp6_hdr))) {
const struct in6_addr *nd_target = NULL;
struct eth_addr arp_buf[2] = { };
struct eth_addr arp_buf[2] = { { { { 0 } } } };
const struct icmp6_hdr *icmp = data_pull(&data, &size,
sizeof *icmp);
parse_icmpv6(&data, &size, icmp, &nd_target, arp_buf);
Expand Down
6 changes: 3 additions & 3 deletions lib/flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ flowmap_clear(struct flowmap *fm, size_t idx, unsigned int n_bits)

/* OR the bits in the flowmaps. */
static inline struct flowmap
flowmap_or(struct flowmap a, const struct flowmap b)
flowmap_or(struct flowmap a, struct flowmap b)
{
struct flowmap map;
size_t unit;
Expand All @@ -542,7 +542,7 @@ flowmap_or(struct flowmap a, const struct flowmap b)

/* AND the bits in the flowmaps. */
static inline struct flowmap
flowmap_and(struct flowmap a, const struct flowmap b)
flowmap_and(struct flowmap a, struct flowmap b)
{
struct flowmap map;
size_t unit;
Expand All @@ -554,7 +554,7 @@ flowmap_and(struct flowmap a, const struct flowmap b)
}

static inline bool
flowmap_is_empty(const struct flowmap fm)
flowmap_is_empty(struct flowmap fm)
{
map_t map;

Expand Down

0 comments on commit aba5d6d

Please sign in to comment.