From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4467C202E60ED for ; Thu, 26 Oct 2017 04:08:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E540C2D0FB5; Thu, 26 Oct 2017 11:12:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E540C2D0FB5 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-110.rdu2.redhat.com [10.10.120.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A1FF7B536; Thu, 26 Oct 2017 11:12:12 +0000 (UTC) To: Thiebaud Weksteen , edk2-devel@lists.01.org Cc: erik.c.bjorge@intel.com References: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> From: Laszlo Ersek Message-ID: <2f1ecf34-139e-d40c-aefa-da24bc3bc401@redhat.com> Date: Thu, 26 Oct 2017 13:12:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 26 Oct 2017 11:12:14 +0000 (UTC) Subject: Re: [PATCH] StdLib/BsdSocketLib: Remove unused variables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 11:08:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hello Thiebaud, On 10/26/17 11:58, Thiebaud Weksteen wrote: > TianoCore BZ#677 would you consider registering in the TianoCore Bugzilla, assigning this item to yourself, and flipping its status to IN_PROGRESS? Thanks! Laszlo > > Remove unused variables and turn nsdispatch macro into a function. This > is not what is recommended in the bug ticket but avoid heavier > modification of the code (and deviation from upsteam). > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thiebaud Weksteen > --- > StdLib/BsdSocketLib/getaddrinfo.c | 10 ++++++---- > StdLib/BsdSocketLib/gethostbydns.c | 2 ++ > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/StdLib/BsdSocketLib/getaddrinfo.c b/StdLib/BsdSocketLib/getaddrinfo.c > index 5a0baf6d45..9d1acdb3fb 100644 > --- a/StdLib/BsdSocketLib/getaddrinfo.c > +++ b/StdLib/BsdSocketLib/getaddrinfo.c > @@ -92,7 +92,6 @@ __RCSID("$NetBSD: getaddrinfo.c,v 1.91.6.1 2009/01/26 00:27:34 snj Exp $"); > #include > > #define endservent_r(svd) endservent() > -#define nsdispatch(pResult,dtab,database,routine,files,hostname,pai) NS_NOTFOUND > #define res_nmkquery(state,op,dname,class,type,data,datalen,newrr_in,buf,buflen) res_mkquery( op, dname, class, type, data, datalen, newrr_in, buf, buflen ) > #define res_nsend(state,buf,buflen,ans,anssiz) res_send ( buf, buflen, ans, anssiz ) > > @@ -306,6 +305,12 @@ do { \ > #define MATCH(x, y, w) \ > ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) > > +int nsdispatch(void *result, const ns_dtab dist_tab[], const char* database, > + const char *method, const ns_src defaults[], ...) > +{ > + return NS_NOTFOUND; > +} > + > const char * > gai_strerror(int ecode) > { > @@ -1062,9 +1067,6 @@ ip6_str2scopeid(char *scope, struct sockaddr_in6 *sin6, u_int32_t *scopeid) > > /* code duplicate with gethnamaddr.c */ > > -static const char AskedForGot[] = > - "gethostby*.getanswer: asked for \"%s\", got \"%s\""; > - > static struct addrinfo * > getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, > const struct addrinfo *pai) > diff --git a/StdLib/BsdSocketLib/gethostbydns.c b/StdLib/BsdSocketLib/gethostbydns.c > index 25e7c3b142..17c43ba59c 100644 > --- a/StdLib/BsdSocketLib/gethostbydns.c > +++ b/StdLib/BsdSocketLib/gethostbydns.c > @@ -129,8 +129,10 @@ u_int16_t _getshort(const u_char *src); > #define MAXALIASES 35 > #define MAXADDRS 35 > > +#ifdef _ORG_FREEBSD_ > static const char AskedForGot[] = > "gethostby*.gethostanswer: asked for \"%s\", got \"%s\""; > +#endif > > static char *h_addr_ptrs[MAXADDRS + 1]; > >