From 48bd200acbf4b4d8f3fa241373477b3a21001d17 Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 5 May 2020 22:28:59 +0100 Subject: refactor: Disallow multiple initialised declarators per decl. We no longer allow: ```c int a = 0, b = 0; int a[3], b[3]; int a, *b; ``` But we do still allow (for now): ```c int a, b; ``` --- toxcore/LAN_discovery.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'toxcore/LAN_discovery.c') diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index c3d06014..e23550df 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c @@ -70,14 +70,16 @@ static void fetch_broadcast_info(uint16_t port) IP_ADAPTER_INFO *pAdapter = pAdapterInfo; while (pAdapter) { - IP gateway = {0}, subnet_mask = {0}; + IP gateway = {0}; + IP subnet_mask = {0}; if (addr_parse_ip(pAdapter->IpAddressList.IpMask.String, &subnet_mask) && addr_parse_ip(pAdapter->GatewayList.IpAddress.String, &gateway)) { if (net_family_is_ipv4(gateway.family) && net_family_is_ipv4(subnet_mask.family)) { IP_Port *ip_port = &ip_ports[count]; ip_port->ip.family = net_family_ipv4; - uint32_t gateway_ip = net_ntohl(gateway.ip.v4.uint32), subnet_ip = net_ntohl(subnet_mask.ip.v4.uint32); + uint32_t gateway_ip = net_ntohl(gateway.ip.v4.uint32); + uint32_t subnet_ip = net_ntohl(subnet_mask.ip.v4.uint32); uint32_t broadcast_ip = gateway_ip + ~subnet_ip - 1; ip_port->ip.ip.v4.uint32 = net_htonl(broadcast_ip); ip_port->port = port; -- cgit v1.2.3