summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-07-18 18:33:07 +0000
committerngie <ngie@FreeBSD.org>2017-07-18 18:33:07 +0000
commitff061e35bfd3d7561415ab7697e156b4d23cefe9 (patch)
treee1e1ad46e604d39bc52c81921ba1416739e665bd
parent2a6317b0ca7e7d58abe669192006609c35b7dbc4 (diff)
downloadFreeBSD-src-ff061e35bfd3d7561415ab7697e156b4d23cefe9.zip
FreeBSD-src-ff061e35bfd3d7561415ab7697e156b4d23cefe9.tar.gz
MFC r318280:
getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro
-rw-r--r--usr.bin/getconf/fake-gperf.awk3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/getconf/fake-gperf.awk b/usr.bin/getconf/fake-gperf.awk
index 96fcd3c..d56ec01 100644
--- a/usr.bin/getconf/fake-gperf.awk
+++ b/usr.bin/getconf/fake-gperf.awk
@@ -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 "{";
OpenPOWER on IntegriCloud