2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

flow: Make compile with MSVC.

MSVC does not like zero sized arrays in structs.  Hence, remove the
'values' member from struct miniflow and add back the getters
miniflow_values() and miniflow_get_values().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2015-07-16 17:42:24 -07:00
parent 2cd87fce12
commit 09b0fa9c55
6 changed files with 72 additions and 54 deletions

View File

@@ -1698,8 +1698,8 @@ miniflow_and_mask_matches_flow(const struct miniflow *flow,
const struct minimask *mask,
const struct flow *target)
{
const uint64_t *flowp = flow->values;
const uint64_t *maskp = mask->masks.values;
const uint64_t *flowp = miniflow_get_values(flow);
const uint64_t *maskp = miniflow_get_values(&mask->masks);
int idx;
MAP_FOR_EACH_INDEX(idx, mask->masks.map) {
@@ -1747,8 +1747,8 @@ miniflow_and_mask_matches_flow_wc(const struct miniflow *flow,
const struct flow *target,
struct flow_wildcards *wc)
{
const uint64_t *flowp = flow->values;
const uint64_t *maskp = mask->masks.values;
const uint64_t *flowp = miniflow_get_values(flow);
const uint64_t *maskp = miniflow_get_values(&mask->masks);
int idx;
MAP_FOR_EACH_INDEX(idx, mask->masks.map) {
@@ -2191,7 +2191,7 @@ static const ovs_be32 *
minimatch_get_prefix(const struct minimatch *match, const struct mf_field *mf)
{
return (OVS_FORCE const ovs_be32 *)
(match->flow->values
(miniflow_get_values(match->flow)
+ count_1bits(match->flow->map &
((UINT64_C(1) << mf->flow_be32ofs / 2) - 1)))
+ (mf->flow_be32ofs & 1);