From 039d6d48afe00a0fa9e11bcdbfea8e996cce4ad0 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 15 Apr 2016 12:42:30 +0200 Subject: [PATCH] Fix some compiler warnings from MinGW. --- src/multicast_device.c | 4 ++-- src/net_packet.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/multicast_device.c b/src/multicast_device.c index 931a8d02..8dab9e06 100644 --- a/src/multicast_device.c +++ b/src/multicast_device.c @@ -162,7 +162,7 @@ static void close_device(void) { static bool read_packet(vpn_packet_t *packet) { int lenin; - if((lenin = recv(device_fd, DATA(packet), MTU, 0)) <= 0) { + if((lenin = recv(device_fd, (void *)DATA(packet), MTU, 0)) <= 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Error while reading from %s %s: %s", device_info, device, sockstrerror(sockerrno)); return false; @@ -185,7 +185,7 @@ static bool write_packet(vpn_packet_t *packet) { logger(DEBUG_TRAFFIC, LOG_DEBUG, "Writing packet of %d bytes to %s", packet->len, device_info); - if(sendto(device_fd, DATA(packet), packet->len, 0, ai->ai_addr, ai->ai_addrlen) < 0) { + if(sendto(device_fd, (void *)DATA(packet), packet->len, 0, ai->ai_addr, ai->ai_addrlen) < 0) { logger(DEBUG_ALWAYS, LOG_ERR, "Can't write to %s %s: %s", device_info, device, sockstrerror(sockerrno)); return false; diff --git a/src/net_packet.c b/src/net_packet.c index f8c6ac9b..7d61e7b2 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -729,7 +729,7 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) { #if defined(IPPROTO_IPV6) & defined(IPV6_TCLASS) case AF_INET6: logger(DEBUG_TRAFFIC, LOG_DEBUG, "Setting IPv6 outgoing packet priority to %d", origpriority); - if(setsockopt(listen_socket[sock].udp.fd, IPPROTO_IPV6, IPV6_TCLASS, &origpriority, sizeof origpriority)) /* SO_PRIORITY doesn't seem to work */ + if(setsockopt(listen_socket[sock].udp.fd, IPPROTO_IPV6, IPV6_TCLASS, (void *)&origpriority, sizeof origpriority)) /* SO_PRIORITY doesn't seem to work */ logger(DEBUG_ALWAYS, LOG_ERR, "System call `%s' failed: %s", "setsockopt", sockstrerror(sockerrno)); break; #endif @@ -738,7 +738,7 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) { } } - if(sendto(listen_socket[sock].udp.fd, SEQNO(inpkt), inpkt->len, 0, &sa->sa, SALEN(sa->sa)) < 0 && !sockwouldblock(sockerrno)) { + if(sendto(listen_socket[sock].udp.fd, (void *)SEQNO(inpkt), inpkt->len, 0, &sa->sa, SALEN(sa->sa)) < 0 && !sockwouldblock(sockerrno)) { if(sockmsgsize(sockerrno)) { if(n->maxmtu >= origlen) n->maxmtu = origlen - 1; @@ -1555,7 +1555,7 @@ void handle_incoming_vpn_data(void *data, int flags) { socklen_t addrlen = sizeof addr; pkt.offset = 0; - int len = recvfrom(ls->udp.fd, DATA(&pkt), MAXSIZE, 0, &addr.sa, &addrlen); + int len = recvfrom(ls->udp.fd, (void *)DATA(&pkt), MAXSIZE, 0, &addr.sa, &addrlen); if(len <= 0 || len > MAXSIZE) { if(!sockwouldblock(sockerrno)) -- 2.20.1