Code

Fixed some compiler warnings identified by gcc's -Wextra option.
[collectd.git] / src / apcups.c
index 08df0b50fbcb2cb36253bd2c97f9019f689962bb..5a03764f59f5ea53bc1ac63cd549f183d22e40d1 100644 (file)
@@ -112,7 +112,7 @@ static int apcups_shutdown (void)
  * Returns -1 on error
  * Returns socket file descriptor otherwise
  */
-static int net_open (char *host, char *service, int port)
+static int net_open (char *host, int port)
 {
        int              sd;
        int              status;
@@ -270,7 +270,7 @@ static int apc_query_server (char *host, int port,
 
        if (global_sockfd < 0)
        {
-               global_sockfd = net_open (host, NULL, port);
+               global_sockfd = net_open (host, port);
                if (global_sockfd < 0)
                {
                        ERROR ("apcups plugin: Connecting to the "
@@ -287,7 +287,7 @@ static int apc_query_server (char *host, int port,
 
        while ((n = net_recv (&global_sockfd, recvline, sizeof (recvline) - 1)) > 0)
        {
-               assert (n < sizeof (recvline));
+               assert ((unsigned int)n < sizeof (recvline));
                recvline[n] = '\0';
 #if APCMAIN
                printf ("net_recv = `%s';\n", recvline);