getpw_test: fix -Wunused warnings

- Mark unused parameters __unused.
- Put dump_passwd under DEBUG as it's only used in that case.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-05-28 04:41:06 +00:00
parent 58c03e4e08
commit 87a9deed3c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=319043

View File

@ -57,7 +57,9 @@ static int compare_passwd(struct passwd *, struct passwd *, void *);
static void free_passwd(struct passwd *);
static void sdump_passwd(struct passwd *, char *, size_t);
#ifdef DEBUG
static void dump_passwd(struct passwd *);
#endif
static int passwd_read_snapshot_func(struct passwd *, char *);
@ -95,7 +97,7 @@ clone_passwd(struct passwd *dest, struct passwd const *src)
}
static int
compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata)
compare_passwd(struct passwd *pwd1, struct passwd *pwd2, void *mdata __unused)
{
ATF_REQUIRE(pwd1 != NULL);
ATF_REQUIRE(pwd2 != NULL);
@ -140,6 +142,7 @@ sdump_passwd(struct passwd *pwd, char *buffer, size_t buflen)
pwd->pw_fields);
}
#ifdef DEBUG
static void
dump_passwd(struct passwd *pwd)
{
@ -150,6 +153,7 @@ dump_passwd(struct passwd *pwd)
} else
printf("(null)\n");
}
#endif
static int
passwd_read_snapshot_func(struct passwd *pwd, char *line)
@ -249,7 +253,7 @@ passwd_fill_test_data(struct passwd_test_data *td)
}
static int
passwd_test_correctness(struct passwd *pwd, void *mdata)
passwd_test_correctness(struct passwd *pwd, void *mdata __unused)
{
#ifdef DEBUG
@ -361,7 +365,7 @@ passwd_test_getpwuid(struct passwd *pwd_model, void *mdata)
}
static int
passwd_test_getpwent(struct passwd *pwd, void *mdata)
passwd_test_getpwent(struct passwd *pwd, void *mdata __unused)
{
/* Only correctness can be checked when doing 1-pass test for
* getpwent(). */