cast to char * to avoid compiler warnings for get/setsockopt
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Sep 2011 01:25:50 +0000 (11:25 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sat, 3 Sep 2011 01:25:50 +0000 (11:25 +1000)
lib/init.c
lib/socket.c

index a247787d4dfa364b17b80bbae9a6f1d8ce3177dd..464f88a2f940d79de6375ac81da51c3226d82036 100644 (file)
@@ -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;
 }
 
 
index e9c103e55b0cd124ce04baaeef1721fb43d5e5fd..f2943cdfb4c1c7d379ae2f189206d0d8580215be 100644 (file)
@@ -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;
 }