StdLib/BsdSocketLib: Remove unused variables

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>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Thiebaud Weksteen 2017-10-26 02:58:15 -07:00 committed by Jaben Carsey
parent 207bc6a38c
commit cb12056591
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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];