From: Ronnie Sahlberg Date: Sat, 3 Sep 2011 01:25:50 +0000 (+1000) Subject: cast to char * to avoid compiler warnings for get/setsockopt X-Git-Tag: upstream/1.9.6^2~324 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bb4e9ed6a88713f6d1da1985f0235bd71d85d017;p=deb_libnfs.git cast to char * to avoid compiler warnings for get/setsockopt --- diff --git a/lib/init.c b/lib/init.c index a247787..464f88a 100644 --- a/lib/init.c +++ b/lib/init.c @@ -83,7 +83,7 @@ void rpc_set_auth(struct rpc_context *rpc, struct AUTH *auth) if (rpc->auth != NULL) { auth_destroy(rpc->auth); } - rpc->auth = auth; + rpc->auth = (AUTH *)auth; } diff --git a/lib/socket.c b/lib/socket.c index e9c103e..f2943cd 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -258,7 +258,7 @@ int rpc_service(struct rpc_context *rpc, int revents) socklen_t err_size = sizeof(err); if (getsockopt(rpc->fd, SOL_SOCKET, SO_ERROR, - &err, &err_size) != 0 || err != 0) { + (char *)&err, &err_size) != 0 || err != 0) { if (err == 0) { err = errno; } @@ -283,7 +283,7 @@ int rpc_service(struct rpc_context *rpc, int revents) socklen_t err_size = sizeof(err); if (getsockopt(rpc->fd, SOL_SOCKET, SO_ERROR, - &err, &err_size) != 0 || err != 0) { + (char *)&err, &err_size) != 0 || err != 0) { if (err == 0) { err = errno; } @@ -488,7 +488,7 @@ int rpc_set_udp_destination(struct rpc_context *rpc, char *addr, int port, int i freeaddrinfo(ai); rpc->is_broadcast = is_broadcast; - setsockopt(rpc->fd, SOL_SOCKET, SO_BROADCAST, &is_broadcast, sizeof(is_broadcast)); + setsockopt(rpc->fd, SOL_SOCKET, SO_BROADCAST, (char *)&is_broadcast, sizeof(is_broadcast)); return 0; }