From: Thiebaud Weksteen <tweek@google.com>
To: edk2-devel@lists.01.org
Cc: erik.c.bjorge@intel.com, Thiebaud Weksteen <tweek@google.com>
Subject: [PATCH] StdLib/BsdSocketLib: Remove unused variables
Date: Thu, 26 Oct 2017 11:58:15 +0200 [thread overview]
Message-ID: <2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com> (raw)
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 <tweek@google.com>
---
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 <net/servent.h>
#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
next reply other threads:[~2017-10-26 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 9:58 Thiebaud Weksteen [this message]
2017-10-26 11:12 ` [PATCH] StdLib/BsdSocketLib: Remove unused variables Laszlo Ersek
2017-11-13 13:27 ` Laszlo Ersek
2017-11-13 15:40 ` Carsey, Jaben
2017-11-13 16:30 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c8db66b18b93d008b1bb8028c23f51ce2b76b29.1509011535.git.tweek@google.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox