Date: Tue, 18 Jul 2017 18:33:07 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321152 - stable/11/usr.bin/getconf Message-ID: <201707181833.v6IIX73Z085945@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Tue Jul 18 18:33:07 2017 New Revision: 321152 URL: https://svnweb.freebsd.org/changeset/base/321152 Log: MFC r318280: getconf: use nitems(..) to compute NWORDS instead of hardcoding the equivalent macro Modified: stable/11/usr.bin/getconf/fake-gperf.awk Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getconf/fake-gperf.awk ============================================================================== --- stable/11/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:05 2017 (r321151) +++ stable/11/usr.bin/getconf/fake-gperf.awk Tue Jul 18 18:33:07 2017 (r321152) @@ -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 "{";
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707181833.v6IIX73Z085945>