]> git.proxmox.com Git - mirror_ovs.git/commit
ofpbuf: Fix parameter for const initializer.
authorJoe Stringer <joe@ovn.org>
Tue, 1 Aug 2017 00:16:11 +0000 (17:16 -0700)
committerJoe Stringer <joe@ovn.org>
Tue, 1 Aug 2017 17:23:57 +0000 (10:23 -0700)
commit952646cbfdbf7d708e93446f617b2eb8c94900e0
tree5c353e5d0b989aa154acdc680ce6928ea6096673
parentc94d81549bd4788924a77eb706f019251018c755
ofpbuf: Fix parameter for const initializer.

Clang 4.0 complains:

In file included from include/openvswitch/cxxtest.cc:11:0:
../include/openvswitch/ofpbuf.h: In function ‘ofpbuf ofpbuf_const_initializer(const void*, size_t)’:
../include/openvswitch/ofpbuf.h:107:5: warning: narrowing conversion of ‘size’ from ‘size_t {aka long unsigned int}’ to ‘uint32_t {aka unsigned int}’ inside { } [-Wnarrowing]
     };
     ^
../include/openvswitch/ofpbuf.h:107:5: warning: narrowing conversion of ‘size’ from ‘size_t {aka long unsigned int}’ to ‘uint32_t {aka unsigned int}’ inside { } [-Wnarrowing]

This is because the ofpbuf struct's "size" parameter is a uint32_t,
while ofpbuf_const_initializer() takes a size_t for the size. Fix this
function to take a uint32_t instead.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
include/openvswitch/ofpbuf.h