diff options
author | Olli Salli <olli.salli@collabora.co.uk> | 2012-02-22 21:18:35 +0200 |
---|---|---|
committer | Olli Salli <olli.salli@collabora.co.uk> | 2012-02-22 21:18:35 +0200 |
commit | efa82fa6e961b2119fbb51513e9410d9237e8a12 (patch) | |
tree | ddf50b90ca21bddf6f2488b7ec3d0a7d4cb219f8 | |
parent | fbaff05740530f3df8519ac2c37503c2d0401a2f (diff) |
Fix stuff caught by check-coding-style in siraj's code
-rw-r--r-- | lib/gibber/gibber-listener.c | 2 | ||||
-rw-r--r-- | lib/gibber/gibber-multicast-transport.c | 24 | ||||
-rw-r--r-- | src/connection.c | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/lib/gibber/gibber-listener.c b/lib/gibber/gibber-listener.c index 3ad8b34d..a885294c 100644 --- a/lib/gibber/gibber-listener.c +++ b/lib/gibber/gibber-listener.c @@ -259,7 +259,7 @@ add_listener (GibberListener *self, int family, int type, int protocol, goto error; } - ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof (int)); + ret = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (int)); if (ret == -1) { gibber_socket_set_error (error, "setsockopt failed", diff --git a/lib/gibber/gibber-multicast-transport.c b/lib/gibber/gibber-multicast-transport.c index 5151f43b..fd146d40 100644 --- a/lib/gibber/gibber-multicast-transport.c +++ b/lib/gibber/gibber-multicast-transport.c @@ -150,7 +150,7 @@ _channel_io_in (GIOChannel *source, GIOCondition condition, gpointer data) int ret; socklen_t len = sizeof (struct sockaddr_storage); - ret = recvfrom (priv->fd, (char *)buf, BUFSIZE, 0, (struct sockaddr *)&from, &len); + ret = recvfrom (priv->fd, (char *) buf, BUFSIZE, 0, (struct sockaddr *) &from, &len); if (ret < 0) { @@ -214,25 +214,25 @@ _open_multicast (GibberMulticastTransport *self, GError **error) goto err; } - SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof (yes)); + SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (yes)); #ifdef SO_REUSEPORT SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof (yes)); #endif - SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&yes, sizeof (yes)); - SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&one, sizeof (one)); + SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *) &yes, sizeof (yes)); + SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &one, sizeof (one)); mreq.imr_multiaddr = ((struct sockaddr_in *) &(priv->address))->sin_addr; mreq.imr_interface.s_addr = htonl (INADDR_ANY); - SETSOCKOPT (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof (mreq)); + SETSOCKOPT (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof (mreq)); memset (&baddr, 0, sizeof (baddr)); baddr.sin_family = AF_INET; baddr.sin_addr.s_addr = htonl (INADDR_ANY); - baddr.sin_port = ((struct sockaddr_in *)&(priv->address))->sin_port; + baddr.sin_port = ((struct sockaddr_in *) &(priv->address))->sin_port; - if (bind (fd, (struct sockaddr *)&baddr, sizeof (baddr)) != 0) + if (bind (fd, (struct sockaddr *) &baddr, sizeof (baddr)) != 0) { DEBUG("Failed to bind to socket: %s", strerror (errno)); g_set_error (error, GIBBER_MULTICAST_TRANSPORT_ERROR, @@ -256,13 +256,13 @@ _open_multicast (GibberMulticastTransport *self, GError **error) } mreq6.ipv6mr_multiaddr = - ((struct sockaddr_in6 *)&priv->address)->sin6_addr; + ((struct sockaddr_in6 *) &priv->address)->sin6_addr; mreq6.ipv6mr_interface = 0; - SETSOCKOPT (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *)&mreq6, + SETSOCKOPT (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *) &mreq6, sizeof (mreq6)); - if (bind (fd, (struct sockaddr *)&(priv->address), priv->addrlen) + if (bind (fd, (struct sockaddr *) &(priv->address), priv->addrlen) != 0) { DEBUG("Failed to bind to socket: %s", strerror(errno)); @@ -466,8 +466,8 @@ gibber_multicast_transport_send (GibberTransport *transport, return FALSE; } - if (sendto (priv->fd, (const char *)data, size, 0, - (struct sockaddr *)&(priv->address), + if (sendto (priv->fd, (const char *) data, size, 0, + (struct sockaddr *) &(priv->address), sizeof (struct sockaddr_storage)) < 0) { DEBUG("send failed: %s", strerror (errno)); diff --git a/src/connection.c b/src/connection.c index e612a1eb..f2e92793 100644 --- a/src/connection.c +++ b/src/connection.c @@ -45,7 +45,7 @@ #include <salut/caps-channel-manager.h> #include <salut/plugin-connection.h> -#ifdef USE_BACKEND_AVAHI +#ifdef USE_BACKEND_AVAHI #include "avahi-discovery-client.h" #endif #include "capabilities.h" |