From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <30rHxWQUKCtEGJ1173BB381.zB9107P-01I1885FGF.NO.BE3@flex--tweek.bounces.google.com> Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c06::24a; helo=mail-oi0-x24a.google.com; envelope-from=30rhxwqukctegj1173bb381.zb9107p-01i1885fgf.no.be3@flex--tweek.bounces.google.com; receiver=edk2-devel@lists.01.org Received: from mail-oi0-x24a.google.com (mail-oi0-x24a.google.com [IPv6:2607:f8b0:4003:c06::24a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D6FDF20347171 for ; Thu, 26 Oct 2017 02:54:57 -0700 (PDT) Received: by mail-oi0-x24a.google.com with SMTP id h6so2858994oia.17 for ; Thu, 26 Oct 2017 02:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:message-id:subject:from:to:cc; bh=+yR3l5OrD7fIM3oIvxIW9hkliNeHat226okvZUm6zM4=; b=Wp+OEd4wkRyVLkEIOGitZwSqe/k6Mb5RAZxxJjV0UWvSnJmoLtU7Fu79j40VttS/AH 03diED4nNLBNJagZl49c7iaoYooPyvHOgwmhhQIACKpKwvcqj6f5rn8ntlgTJNwUyjLf D5Na6S5EFtcDXJTWmd6EPm5HhuvPCtdY0aecdlUcDHcI7BDWtJO58ZMeevKT9ZJvvS84 8IiFgl8UUaQpcHIvWivSAhG1CNySt+9+N/Dui05BYZjEzUIvUay/YGcXDMLOso+Th+G4 H2wxGnzWxvjEV1xcuts5N/CeU/Om/oBNZhiFmYqCHS1bmbfVtvOAnWnLVyclc5oUSDAu yeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=+yR3l5OrD7fIM3oIvxIW9hkliNeHat226okvZUm6zM4=; b=dYnEDUyV7muYK3UE9Eo6hXbCmjlSezqB7K5RCQrNUs7weqkb15LCgoL7mSy1FtUayR wxx62eKLHx6BOAfJd1PAN6KspPEnFtq++1v7VvcIaFCV1F7F3OdV0fhC1aoVEj5SQIxS IitS7kc0Ob2HJc9aPbxQ9YHicfrKvKLFQXcuwCxbjM14UK4mW1iv9jwfCuWrwmU//Kcq B8jOJJmzOQTVOfOaHWjYwQVD/xbx7l3ANw+yHL2hMyWSQq3ThLICtW6LyWZ/v7QecO2V J3DtEU1UjZjELxSvKix5zmGLeoNET5rdB4okw+MCTUic7wE0UR+URVNTaRu25PPk+BaI /uLQ== X-Gm-Message-State: AMCzsaV1bO13zOQSwHjoyWNca816VzG0kbrrS3CxfI/atvO5kKiuq2GV X8d4J/f5UmnoX+dfHzA+WI5PC3iahWDiq+1JlVyzo1FgXK7uueDb4VXAT92NxJ2l2kI4mneihXQ VuQHCT9UdxnK7P3UX2TH3CuP9NFDTHcMhDkLU7+RiqLPDIX0Nebccy5zqep73 X-Google-Smtp-Source: ABhQp+S6sqv6e7wSH7PZWKEMdFIA2aFvnSoCx+HtRMzq/iV3opmmteJHgSY9Qo1+musrjR1G+9x0LLswRQ== MIME-Version: 1.0 X-Received: by 10.157.26.100 with SMTP id u33mr2617960otu.113.1509011922717; Thu, 26 Oct 2017 02:58:42 -0700 (PDT) Date: Thu, 26 Oct 2017 11:58:15 +0200 Message-Id: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> X-Mailer: git-send-email 2.15.0.rc2.357.g7e34df9404-goog From: Thiebaud Weksteen To: edk2-devel@lists.01.org Cc: erik.c.bjorge@intel.com, Thiebaud Weksteen Subject: [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 09:54:58 -0000 Content-Type: text/plain; charset="UTF-8" TianoCore BZ#677 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]; -- 2.15.0.rc2.357.g7e34df9404-goog