summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-07-18 18:33:05 +0000
committerngie <ngie@FreeBSD.org>2017-07-18 18:33:05 +0000
commit9ed216b14d557dd900adf69b2fd95c1875e6a94e (patch)
tree6780be7dc6fb041a41f001da21bbfc0fa9255d49
parent7c8456b8f62b08f38f8c35d5fd255087d054c6ad (diff)
downloadFreeBSD-src-9ed216b14d557dd900adf69b2fd95c1875e6a94e.zip
FreeBSD-src-9ed216b14d557dd900adf69b2fd95c1875e6a94e.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