svn commit: r319043 - head/lib/libc/tests/nss

Ngie Cooper ngie at FreeBSD.org
Sun May 28 04:41:07 UTC 2017


Author: ngie
Date: Sun May 28 04:41:06 2017
New Revision: 319043
URL: https://svnweb.freebsd.org/changeset/base/319043

Log:
  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

Modified:
  head/lib/libc/tests/nss/getpw_test.c

Modified: head/lib/libc/tests/nss/getpw_test.c
==============================================================================
--- head/lib/libc/tests/nss/getpw_test.c	Sun May 28 04:34:57 2017	(r319042)
+++ head/lib/libc/tests/nss/getpw_test.c	Sun May 28 04:41:06 2017	(r319043)
@@ -57,7 +57,9 @@ static int compare_passwd(struct passwd 
 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
 }
 
 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 *b
 	    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
 }
 
 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_
 }
 
 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(). */


More information about the svn-src-head mailing list