From 55f2219ab98b039f256671c5e584a61ab52bfed0 Mon Sep 17 00:00:00 2001 From: Angelo Mantellini Date: Thu, 30 Jan 2020 10:44:19 +0100 Subject: [HICN-489] Add iOS support to hicn stack Signed-off-by: Angelo Mantellini Change-Id: I8fa8c4eaa3218eb4be46f713b15ab789c6930aa0 --- ctrl/libhicnctrl/src/api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ctrl/libhicnctrl/src/api.c') diff --git a/ctrl/libhicnctrl/src/api.c b/ctrl/libhicnctrl/src/api.c index 7e6a80254..8dcb978e0 100644 --- a/ctrl/libhicnctrl/src/api.c +++ b/ctrl/libhicnctrl/src/api.c @@ -444,7 +444,7 @@ hc_sock_parse_url(const char * url, struct sockaddr * sa) #ifdef __linux__ srand(time(NULL) ^ getpid() ^ gettid()); #else - srand(time(NULL) ^ getpid()); + srand((unsigned int )(time(NULL) ^ getpid())); #endif /* __linux__ */ /* @@ -574,7 +574,7 @@ hc_sock_connect(hc_sock_t * s) size_t size = ss.ss_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); - if (connect(s->fd, (struct sockaddr *)&ss, size) < 0) //sizeof(struct sockaddr)) < 0) + if (connect(s->fd, (struct sockaddr *)&ss, (socklen_t)size) < 0) //sizeof(struct sockaddr)) < 0) goto ERR_CONNECT; return 0; @@ -589,7 +589,7 @@ hc_sock_send(hc_sock_t * s, hc_msg_t * msg, size_t msglen, int seq) { int rc; msg->hdr.seqNum = seq; - rc = send(s->fd, msg, msglen, 0); + rc = (int)send(s->fd, msg, msglen, 0); if (rc < 0) { perror("hc_sock_send"); return -1; @@ -617,7 +617,7 @@ hc_sock_recv(hc_sock_t * s) */ assert(RECV_BUFLEN - s->woff > MIN_BUFLEN); - rc = recv(s->fd, s->buf + s->woff, RECV_BUFLEN - s->woff, 0); + rc = (int)recv(s->fd, s->buf + s->woff, RECV_BUFLEN - s->woff, 0); if (rc == 0) { /* Connection has been closed */ return 0; -- cgit 1.2.3-korg