svn commit: r321151 - stable/10/usr.bin/getconf
Ngie Cooper
ngie at FreeBSD.org
Tue Jul 18 18:33:06 UTC 2017
Author: ngie
Date: Tue Jul 18 18:33:05 2017
New Revision: 321151
URL: https://svnweb.freebsd.org/changeset/base/321151
Log:
MFC r318280:
getconf: use nitems(..) to compute NWORDS instead of hardcoding
the equivalent macro
Modified:
stable/10/usr.bin/getconf/fake-gperf.awk
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.bin/getconf/fake-gperf.awk
==============================================================================
--- stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:23:56 2017 (r321150)
+++ stable/10/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:05 2017 (r321151)
@@ -36,7 +36,8 @@ state == 1 { print; next; }
state = 3;
print "\t{ NULL, 0, 0 }";
print "};";
- print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)";
+ print "#include <sys/param.h>";
+ print "#define\tNWORDS\t(nitems(wordlist) - 1)";
print "static const struct map *";
print "in_word_set(const char *word)";
print "{";
More information about the svn-src-all
mailing list