Clang 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 <[email protected]>
---
 include/openvswitch/ofpbuf.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/openvswitch/ofpbuf.h b/include/openvswitch/ofpbuf.h
index 6142f4a588e1..dffd78414ced 100644
--- a/include/openvswitch/ofpbuf.h
+++ b/include/openvswitch/ofpbuf.h
@@ -93,7 +93,7 @@ struct ofpbuf {
  * ofpbuf_use_const().
  */
 static inline struct ofpbuf
-ofpbuf_const_initializer(const void *data, size_t size)
+ofpbuf_const_initializer(const void *data, uint32_t size)
 {
     return (struct ofpbuf) {
         .base = CONST_CAST(void *, data),
-- 
2.13.3

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to