svn commit: r293904 - user/ngie/socket-tests/tools/regression/sockets/unix_cmsg

Garrett Cooper ngie at FreeBSD.org
Thu Jan 14 10:09:00 UTC 2016


Author: ngie
Date: Thu Jan 14 10:08:58 2016
New Revision: 293904
URL: https://svnweb.freebsd.org/changeset/base/293904

Log:
  Use nitems(x) instead of handrolling sizeof(x) / sizeof(*x)

Modified:
  user/ngie/socket-tests/tools/regression/sockets/unix_cmsg/unix_cmsg.c

Modified: user/ngie/socket-tests/tools/regression/sockets/unix_cmsg/unix_cmsg.c
==============================================================================
--- user/ngie/socket-tests/tools/regression/sockets/unix_cmsg/unix_cmsg.c	Thu Jan 14 09:22:01 2016	(r293903)
+++ user/ngie/socket-tests/tools/regression/sockets/unix_cmsg/unix_cmsg.c	Thu Jan 14 10:08:58 2016	(r293904)
@@ -131,7 +131,7 @@ static const struct test_func test_strea
 };
 
 #define TEST_STREAM_TBL_SIZE \
-	(sizeof(test_stream_tbl) / sizeof(test_stream_tbl[0]))
+	nitems(test_stream_tbl)
 
 static const struct test_func test_dgram_tbl[] = {
 	{


More information about the svn-src-user mailing list