Fix -Wunused and -Wshadow warnings

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-05-28 05:26:45 +00:00
parent 91c53523fd
commit 981aa50fc2

View File

@ -87,8 +87,6 @@ static int hostent_test_gethostbyaddr(struct hostent *, void *);
static int hostent_test_getaddrinfo_eq(struct hostent *, void *);
static int hostent_test_getnameinfo_eq(struct hostent *, void *);
static void usage(void) __attribute__((__noreturn__));
IMPLEMENT_TEST_DATA(hostent)
IMPLEMENT_TEST_FILE_SNAPSHOT(hostent)
IMPLEMENT_1PASS_TEST(hostent)
@ -677,7 +675,7 @@ dump_hostent(struct hostent *result)
}
static int
hostent_test_correctness(struct hostent *ht, void *mdata)
hostent_test_correctness(struct hostent *ht, void *mdata __unused)
{
#ifdef DEBUG
@ -760,7 +758,7 @@ hostent_test_gethostbyaddr(struct hostent *he, void *mdata)
}
static int
hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata)
hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata __unused)
{
struct addrinfo *ai, hints;
int rv;
@ -799,7 +797,7 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata)
}
static int
hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
hostent_test_getnameinfo_eq(struct hostent *he, void *mdata __unused)
{
char **cp;
char buffer[NI_MAXHOST];
@ -923,14 +921,14 @@ hostent_test_getnameinfo_eq(struct hostent *he, void *mdata)
}
static int
run_tests(const char *hostlist_file, const char *snapshot_file, int af_type,
run_tests(const char *hostlist_file, const char *snapshot_file, int _af_type,
enum test_methods method, bool use_ipv6_mapping)
{
struct hostent_test_data td, td_addr, td_snap;
res_state statp;
int rv = -2;
switch (af_type) {
switch (_af_type) {
case AF_INET:
ATF_REQUIRE_FEATURE("inet");
ATF_REQUIRE(!use_ipv6_mapping);
@ -939,7 +937,7 @@ run_tests(const char *hostlist_file, const char *snapshot_file, int af_type,
ATF_REQUIRE_FEATURE("inet6");
break;
default:
atf_tc_fail("unhandled address family: %d", af_type);
atf_tc_fail("unhandled address family: %d", _af_type);
break;
}