From patchwork Thu Apr 28 12:11:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 616171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qwbKx6mDhz9t79 for ; Thu, 28 Apr 2016 22:12:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=sfhFGV76; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= SL0BjvVE6wsmKzvMXvmpdICgmY3acx0cMJY93jb7N0yNuqR4n+7mkyGJciz0ogmc ODXHXgtMrMcOKMMwoeI9DUqIg1EpTwTjMGsEH0oGxMhrEzvZv7TXQ5BRf/TbMMqD txmfuvP+y5733iCLoSZ2e5GZ6lrSYTt+q0RIqNlri4I= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=gcr3re EvJrBnA+4grxKm8R9lkUg=; b=sfhFGV76ffUsEcJUwzE9t6rhCpRsjGW223b6Xe pixUXrx6jf9J1pv4Y8MDgxZMMn6h6goqlbJjSIQ3GNiggZkT5RYE9cLTCbAx+hEz fP4pHCeLNqqQs6KlEVJpTXZKjNj1NY8gceikzFdZVA0nVcRSG3FRm/Txpoe22H++ HXrEk= Received: (qmail 124423 invoked by alias); 28 Apr 2016 12:11:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 123434 invoked by uid 89); 28 Apr 2016 12:11:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=xxx X-HELO: mx1.redhat.com Date: Thu, 28 Apr 2016 14:11:46 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] resolv: Assorted preprocessor cleanups User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20160428121146.BDA3D403F10CA@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2016-04-28 Florian Weimer * resolv/res_init.c (isascii): Do not define. Use definition in . * resolv/gethnamaddr.c: Remove USE_OPTIONS_H conditional. (LOG_AUTH): Remove. (SPRINTF): Remove, adjust caller. (MULTI_PTRS_ARE_ALIASES): Remove, always defined. diff --git a/resolv/gethnamaddr.c b/resolv/gethnamaddr.c index 97e2dc3..9ad2c30 100644 --- a/resolv/gethnamaddr.c +++ b/resolv/gethnamaddr.c @@ -69,22 +69,6 @@ #include #include -#ifndef LOG_AUTH -# define LOG_AUTH 0 -#endif - -#define MULTI_PTRS_ARE_ALIASES 1 /* XXX - experimental */ - -#if defined(USE_OPTIONS_H) -# include <../conf/options.h> -#endif - -#ifdef SPRINTF_CHAR -# define SPRINTF(x) strlen(sprintf/**/x) -#else -# define SPRINTF(x) ((size_t)sprintf x) -#endif - #define MAXALIASES 35 #define MAXADDRS 35 @@ -332,7 +316,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) had_error++; break; } -#if MULTI_PTRS_ARE_ALIASES cp += n; if (cp != erdata) { __set_h_errno (NO_RECOVERY); @@ -354,21 +337,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) buflen -= n; } break; -#else - host.h_name = bp; - if (_res.options & RES_USE_INET6) { - n = strlen(bp) + 1; /* for the \0 */ - if (n >= MAXHOSTNAMELEN) { - had_error++; - break; - } - bp += n; - buflen -= n; - map_v4v6_hostent(&host, &bp, &buflen); - } - __set_h_errno (NETDB_SUCCESS); - return (&host); -#endif case T_A: case T_AAAA: if (strcasecmp(host.h_name, bp) != 0) { @@ -660,9 +628,9 @@ gethostbyaddr (const void *addr, socklen_t len, int af) case AF_INET6: qp = qbuf; for (n = IN6ADDRSZ - 1; n >= 0; n--) { - qp += SPRINTF((qp, "%x.%x.", - uaddr[n] & 0xf, - (uaddr[n] >> 4) & 0xf)); + qp += sprintf(qp, "%x.%x.", + uaddr[n] & 0xf, + (uaddr[n] >> 4) & 0xf); } strcpy(qp, "ip6.arpa"); break; diff --git a/resolv/res_init.c b/resolv/res_init.c index 407e609..915a70a 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -94,10 +94,6 @@ static const char sort_mask_chars[] = "/&"; #define ISSORTMASK(ch) (strchr(sort_mask_chars, ch) != NULL) static u_int32_t net_mask (struct in_addr) __THROW; -#if !defined(isascii) /* XXX - could be a function */ -# define isascii(c) (!(c & 0200)) -#endif - unsigned long long int __res_initstamp attribute_hidden; /*