From a0a64a59babffdb84a515b43ae0254da381ec2c1 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Tue, 7 Feb 2017 10:03:33 -0600 Subject: [PATCH] Fix sockets on MSVC after IPv6 zone work This fixes the following build failure with MSVC 2013: sockets.c(323): warning C4242: '=' : conversion from 'const u32_t' to 'u8_t', possible loss of data This casts sin6_scope_id to a u8_t before calling ip6_addr_set_zone() --- src/api/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index 9368e5b4..2e2810e1 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -100,7 +100,7 @@ #define SOCKADDR6_TO_IP6ADDR_PORT(sin6, ipaddr, port) do { \ inet6_addr_to_ip6addr(ip_2_ip6(ipaddr), &((sin6)->sin6_addr)); \ if (ip6_addr_has_scope(ip_2_ip6(ipaddr), IP6_UNKNOWN)) { \ - ip6_addr_set_zone(ip_2_ip6(ipaddr), (sin6)->sin6_scope_id); \ + ip6_addr_set_zone(ip_2_ip6(ipaddr), (u8_t)(sin6)->sin6_scope_id); \ } \ (port) = lwip_ntohs((sin6)->sin6_port); }while(0) #endif /* LWIP_IPV6 */