Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 10:08:58 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r293904 - user/ngie/socket-tests/tools/regression/sockets/unix_cmsg
Message-ID:  <201601141008.u0EA8wc2037593@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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[] = {
 	{



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601141008.u0EA8wc2037593>