From patchwork Sun Aug 30 14:40:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 512232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 5A8EE1401F6 for ; Mon, 31 Aug 2015 00:40:38 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 5FDFE10CC1; Sun, 30 Aug 2015 07:40:37 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id C520210CBE for ; Sun, 30 Aug 2015 07:40:36 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id E78BBD487C for ; Sun, 30 Aug 2015 08:40:35 -0600 (MDT) X-ASG-Debug-ID: 1440945635-03dc211ad5366c60001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar4.cudamail.com with ESMTP id ThSR2zKz2mV3TBTY (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 30 Aug 2015 08:40:35 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pa0-f53.google.com) (209.85.220.53) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 30 Aug 2015 14:40:35 -0000 Received-SPF: unknown (mx3-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.53 Received: by pabzx8 with SMTP id zx8so111333398pab.1 for ; Sun, 30 Aug 2015 07:40:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mM62+hq0cNqMbQWvsAN2tiaohA/iYgQoY8syv9KKo+k=; b=fNaadm1uFX/Iyj2vVZDCnck/fzJgD6WnJU5ujA5dKAmXcqhFzudpJxzsqMKp9lvQdP EmUjwoLY7s/kUkapQiNcJeGy5/HYfq8DW9xKrs1Ld2QYPSAzlCOZR2lQNBVAXqgRephT 80ARRuQwcMQBj9RTsQVCgaDJl7Lq4gWplZXXI1zR+0fvqDaPCqnOVa74RGSZCOrANUb9 6YrORc2NgAWb0WgXHAVO1V8qg77gWgaBvYxZkCgH4O98Qm3V4dLU9m7NhdjL0iF/UzJ4 YAHPbzwPiglR0xj+K3xef5jyxgNJS2z6vNgRSkEIj7AtEB3RZDLELeu23Zs801rjQhj9 BzEQ== X-Gm-Message-State: ALoCoQkTeWSTee9N97fv3PPWYWR9+BccJm4UdmK7q76VIsl9k8lAKDK76J5xvLXazlo57BfkfMcU X-Received: by 10.66.148.71 with SMTP id tq7mr37322184pab.0.1440945634355; Sun, 30 Aug 2015 07:40:34 -0700 (PDT) Received: from sigabrt.benpfaff.org (173-228-112-192.dsl.dynamic.fusionbroadband.com. [173.228.112.192]) by smtp.gmail.com with ESMTPSA id si1sm11454802pbc.72.2015.08.30.07.40.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Aug 2015 07:40:32 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com X-Barracuda-Apparent-Source-IP: 173.228.112.192 From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V1-829006662 X-CudaMail-DTE: 083015 X-CudaMail-Originating-IP: 209.85.220.53 Date: Sun, 30 Aug 2015 07:40:31 -0700 X-ASG-Orig-Subj: [##CM-V1-829006662##][PATCH] flow: Fix MSVC compile errors. Message-Id: <1440945631-11972-1-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1440945635 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH] flow: Fix MSVC compile errors. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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 Signed-off-by: Ben Pfaff Acked-by: Nithin Raju Tested-by: Nithin Raju --- lib/flow.c | 2 +- lib/flow.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index 4236e87..84048e8 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -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); diff --git a/lib/flow.h b/lib/flow.h index 6ed7de3..d8632ff 100644 --- a/lib/flow.h +++ b/lib/flow.h @@ -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; @@ -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; @@ -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;