From: Florian Forster Date: Wed, 8 Jul 2015 10:39:03 +0000 (+0200) Subject: Fix -Wshorten-64-to-32 warnings. X-Git-Tag: collectd-5.6.0~646 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=aef50716bb84482979124ba1120546ada9ca6705;p=collectd.git Fix -Wshorten-64-to-32 warnings. --- diff --git a/src/daemon/common.c b/src/daemon/common.c index 068b9999..abe9a6e8 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -356,7 +356,7 @@ int strjoin (char *buffer, size_t buffer_size, } assert (buffer[buffer_size - 1] == 0); - return (strlen (buffer)); + return ((int) strlen (buffer)); } int strsubstitute (char *str, char c_from, char c_to) diff --git a/src/libcollectdclient/client.c b/src/libcollectdclient/client.c index a97dc509..eaee9c0f 100644 --- a/src/libcollectdclient/client.c +++ b/src/libcollectdclient/client.c @@ -287,7 +287,7 @@ static int lcc_receive (lcc_connection_t *c, /* {{{ */ * beginning of the message. */ ptr = NULL; errno = 0; - res.status = strtol (buffer, &ptr, 0); + res.status = (int) strtol (buffer, &ptr, 0); if ((errno != 0) || (ptr == &buffer[0])) { lcc_set_errno (c, errno); diff --git a/src/libcollectdclient/network.c b/src/libcollectdclient/network.c index f76be5ba..0539cd0c 100644 --- a/src/libcollectdclient/network.c +++ b/src/libcollectdclient/network.c @@ -457,8 +457,8 @@ int lcc_server_set_interface (lcc_server_t *srv, char const *interface) /* {{{ * /* else: Not a multicast interface. */ #if defined(SO_BINDTODEVICE) - status = setsockopt (srv->fd, SOL_SOCKET, SO_BINDTODEVICE, - interface, strlen (interface) + 1); + status = setsockopt (srv->fd, SOL_SOCKET, SO_BINDTODEVICE, interface, + (socklen_t) (strlen (interface) + 1)); if (status != 0) return (-1); #endif