agent: Remove unused inet_pton() function
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 30 Jun 2015 13:39:51 +0000 (14:39 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Tue, 18 Aug 2015 13:01:34 +0000 (14:01 +0100)
As spotted by Felix <felixschlitter@gmail.com>. This is a static
function which is totally unused in this compilation unit and is causing
build failures with -Werror=unused-function.

http://phabricator.freedesktop.org/T123

agent/address.c

index 01eebab..3c20220 100644 (file)
@@ -51,7 +51,6 @@
 #include "address.h"
 
 #ifdef G_OS_WIN32
-#define inet_pton inet_pton_win32
 #define inet_ntop inet_ntop_win32
 
 /* Defined in recent versions of mingw:
@@ -86,36 +85,6 @@ inet_ntop_win32 (int af, const void *src, char *dst, socklen_t cnt)
   return NULL;
 }
 
-static int
-inet_pton_win32(int af, const char *src, void *dst)
-{
-  struct addrinfo hints, *res, *ressave;
-
-  memset(&hints, 0, sizeof(struct addrinfo));
-  hints.ai_family = af;
-
-  if (getaddrinfo(src, NULL, &hints, &res) != 0) {
-    return 0;
-  }
-
-  ressave = res;
-
-  while (res)  {
-    if( res->ai_addr->sa_family == AF_INET) {
-      memcpy(dst, &((struct sockaddr_in *) res->ai_addr)->sin_addr,
-          sizeof(struct in_addr));
-      res = res->ai_next;
-    } else if(res->ai_addr->sa_family == AF_INET6) {
-      memcpy(dst, &((struct sockaddr_in6 *) res->ai_addr)->sin6_addr,
-          sizeof(struct in_addr6));
-      res = res->ai_next;
-    }
-  }
-
-  freeaddrinfo(ressave);
-  return 1;
-}
-
 #endif