Avoid conversion warnings calling Windows sockets

Some Windows socket functions accepts char* instead of classic void*
causing some warning. Force the cast.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2019-05-25 07:34:32 +01:00 committed by Frediano Ziglio
parent e54224730e
commit 2561f1db94

View File

@ -48,7 +48,7 @@ void socket_win32_set_errno(void);
static inline ssize_t socket_read(int sock, void *buf, size_t count)
{
ssize_t res = recv(sock, buf, count, 0);
ssize_t res = recv(sock, (char *) buf, count, 0);
if (res < 0) {
socket_win32_set_errno();
}
@ -57,7 +57,7 @@ static inline ssize_t socket_read(int sock, void *buf, size_t count)
static inline ssize_t socket_write(int sock, const void *buf, size_t count)
{
ssize_t res = send(sock, buf, count, 0);
ssize_t res = send(sock, (const char *) buf, count, 0);
if (res < 0) {
socket_win32_set_errno();
}
@ -82,7 +82,7 @@ static inline ssize_t socket_writev(int sock, const struct iovec *iov, int n_iov
static inline int
socket_getsockopt(int sock, int lvl, int type, void *value, socklen_t *len)
{
int res = getsockopt(sock, lvl, type, value, len);
int res = getsockopt(sock, lvl, type, (char *) value, len);
if (res < 0) {
socket_win32_set_errno();
}
@ -94,7 +94,7 @@ socket_getsockopt(int sock, int lvl, int type, void *value, socklen_t *len)
static inline int
socket_setsockopt(int sock, int lvl, int type, const void *value, socklen_t len)
{
int res = setsockopt(sock, lvl, type, value, len);
int res = setsockopt(sock, lvl, type, (const char*) value, len);
if (res < 0) {
socket_win32_set_errno();
}