diff options
author | Marcelo Araujo <araujo@FreeBSD.org> | 2016-08-16 15:52:10 +0000 |
---|---|---|
committer | Marcelo Araujo <araujo@FreeBSD.org> | 2016-08-16 15:52:10 +0000 |
commit | 4c59a8860a03f90a1c0f62be12b29f7e431c5ddb (patch) | |
tree | 3cba995ee01e2bae26ac08d5d58f81f9151df006 | |
parent | eadd00f81ad281cc2bdf08d070f96733f912c618 (diff) | |
download | src-4c59a8860a03f90a1c0f62be12b29f7e431c5ddb.tar.gz src-4c59a8860a03f90a1c0f62be12b29f7e431c5ddb.zip |
Use nitems() from sys/param.h.
MFC after: 2 weeks.
Notes
Notes:
svn path=/head/; revision=304225
-rw-r--r-- | usr.bin/systat/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 4c55ff4cfe29..74195f606aec 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -261,7 +261,7 @@ display(void) int i, j; /* Get the load average over the last minute. */ - (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); (*curcmd->c_fetch)(); if (curcmd->c_flags & CF_LOADAV) { j = 5.0*avenrun[0] + 0.5; @@ -293,7 +293,7 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc[5]); GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc[6]); wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < sizeof(arc) / sizeof(arc[0]) ; i++) { + for (i = 0 ; i < nitems(arc); i++) { if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { wprintw(wload, "%7lluG", arc[i] >> 30); } @@ -318,7 +318,7 @@ void load(void) { - (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f", avenrun[0], avenrun[1], avenrun[2]); clrtoeol(); |