From 6b3e59c5a670d5117ed293ae612082dcd047ba8a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 30 Jun 2015 14:39:51 +0100 Subject: [PATCH] agent: Remove unused inet_pton() function As spotted by Felix . 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 | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/agent/address.c b/agent/address.c index 01eebab..3c20220 100644 --- a/agent/address.c +++ b/agent/address.c @@ -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 -- 2.7.4