diff --git a/lib/core-net/private-lib-core-net.h b/lib/core-net/private-lib-core-net.h index 4dc8ec644..b7c0bbba1 100644 --- a/lib/core-net/private-lib-core-net.h +++ b/lib/core-net/private-lib-core-net.h @@ -885,7 +885,7 @@ user_callback_handle_rxflow(lws_callback_function, struct lws *wsi, void *in, size_t len); LWS_EXTERN int -lws_plat_set_nonblocking(int fd); +lws_plat_set_nonblocking(lws_sockfd_type fd); LWS_EXTERN int lws_plat_set_socket_options(struct lws_vhost *vhost, lws_sockfd_type fd, diff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c index cafde9e27..3ea34dd83 100644 --- a/lib/core/libwebsockets.c +++ b/lib/core/libwebsockets.c @@ -149,7 +149,7 @@ lws_hex_to_byte_array(const char *h, uint8_t *dest, int max) if (max < 0) return -1; - return dest - odest; + return lws_ptr_diff(dest, odest); } diff --git a/lib/plat/freertos/freertos-sockets.c b/lib/plat/freertos/freertos-sockets.c index c979a59de..404dbce3f 100644 --- a/lib/plat/freertos/freertos-sockets.c +++ b/lib/plat/freertos/freertos-sockets.c @@ -76,7 +76,7 @@ lws_plat_check_connection_error(struct lws *wsi) } int -lws_plat_set_nonblocking(int fd) +lws_plat_set_nonblocking(lws_sockfd_type fd) { return fcntl(fd, F_SETFL, O_NONBLOCK) < 0; } diff --git a/lib/plat/optee/lws-plat-optee.c b/lib/plat/optee/lws-plat-optee.c index 674cda932..9d3b5ff85 100644 --- a/lib/plat/optee/lws-plat-optee.c +++ b/lib/plat/optee/lws-plat-optee.c @@ -126,7 +126,7 @@ void lwsl_emit_optee(int level, const char *line) } int -lws_plat_set_nonblocking(int fd) +lws_plat_set_nonblocking(lws_sockfd_type fd) { return 0; } diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c index 5894e2fa2..7c054c898 100644 --- a/lib/plat/unix/unix-sockets.c +++ b/lib/plat/unix/unix-sockets.c @@ -79,7 +79,7 @@ lws_send_pipe_choked(struct lws *wsi) } int -lws_plat_set_nonblocking(int fd) +lws_plat_set_nonblocking(lws_sockfd_type fd) { return fcntl(fd, F_SETFL, O_NONBLOCK) < 0; } diff --git a/lib/plat/windows/windows-sockets.c b/lib/plat/windows/windows-sockets.c index 50dbb26cb..d78a494e7 100644 --- a/lib/plat/windows/windows-sockets.c +++ b/lib/plat/windows/windows-sockets.c @@ -67,7 +67,7 @@ lws_poll_listen_fd(struct lws_pollfd *fd) } int -lws_plat_set_nonblocking(int fd) +lws_plat_set_nonblocking(lws_sockfd_type fd) { u_long optl = 1;