From 87a9deed3c8a41ee3e853e781b45eac700fc2190 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 28 May 2017 04:41:06 +0000 Subject: [PATCH] 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 --- lib/libc/tests/nss/getpw_test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 0bdbf7087e5f..c7ad2e5a4889 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -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(). */