diff options
author | 2019-02-10 13:34:22 +0100 | |
---|---|---|
committer | 2019-02-10 14:23:51 +0100 | |
commit | 1ac41cb08281bf5460dfea5fc40ff6f8e14873a1 (patch) | |
tree | 3926983e45afa7e805cca1429fc3452c57a5b6c3 /hicn-light/src/io/udpListener.c | |
parent | 13ec18b4b3ec8455daad674a0c0e616885b83608 (diff) |
[HICN-49] Remove warnings hicn-light on windows
Change-Id: I106713c285ad5cc47cb5ae3aaf9c837685156e36
Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'hicn-light/src/io/udpListener.c')
-rw-r--r-- | hicn-light/src/io/udpListener.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hicn-light/src/io/udpListener.c b/hicn-light/src/io/udpListener.c index 3264e70fa..6c2947c66 100644 --- a/hicn-light/src/io/udpListener.c +++ b/hicn-light/src/io/udpListener.c @@ -81,7 +81,7 @@ ListenerOps *udpListener_CreateInet6(Forwarder *forwarder, udp->localAddress = addressCreateFromInet6(&sin6); udp->id = forwarder_GetNextConnectionId(forwarder); - udp->udp_socket = socket(AF_INET6, SOCK_DGRAM, 0); + udp->udp_socket = (SocketType)socket(AF_INET6, SOCK_DGRAM, 0); parcAssertFalse(udp->udp_socket < 0, "Error opening UDP socket: (%d) %s", errno, strerror(errno)); @@ -164,7 +164,7 @@ ListenerOps *udpListener_CreateInet(Forwarder *forwarder, udp->localAddress = addressCreateFromInet(&sin); udp->id = forwarder_GetNextConnectionId(forwarder); - udp->udp_socket = socket(AF_INET, SOCK_DGRAM, 0); + udp->udp_socket = (SocketType)socket(AF_INET, SOCK_DGRAM, 0); parcAssertFalse(udp->udp_socket < 0, "Error opening UDP socket: (%d) %s", errno, strerror(errno)); @@ -314,12 +314,11 @@ static size_t _peekMessageLength(UdpListener *udp, int fd, // Also returns the socket information for the remote peer ssize_t res = recvfrom( - fd, fixedHeader, messageHandler_GetIPHeaderLength(IPv6), MSG_PEEK, + fd, fixedHeader, (int)messageHandler_GetIPHeaderLength(IPv6), MSG_PEEK, (struct sockaddr *)peerIpAddress, peerIpAddressLengthPtr); if (res == messageHandler_GetIPHeaderLength(IPv6)) { - packetLength = - messageHandler_GetTotalPacketLength(fixedHeader); + packetLength = messageHandler_GetTotalPacketLength(fixedHeader); } else { if (res < 0) { printf("error while readin packet\n"); @@ -446,7 +445,7 @@ static Message *_readMessage(UdpListener *udp, int fd, size_t packetLength, AddressPair *pair) { uint8_t *msgBuffer = parcMemory_AllocateAndClear(packetLength); - ssize_t readLength = read(fd, msgBuffer, packetLength); + ssize_t readLength = read(fd, msgBuffer, (unsigned int)packetLength); Message *message = NULL; |