diff options
author | jhb <jhb@FreeBSD.org> | 2015-08-19 19:59:42 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2015-08-19 19:59:42 +0000 |
commit | 293323ab762589ae57869b2ecf4293511e3b5905 (patch) | |
tree | 807e2469ff312cf1ac91c063405ac9ea2bf827ed /usr.bin/truss | |
parent | 2dee86e95fc7cb678db00f91d2b8bf07dd7349c2 (diff) | |
download | FreeBSD-src-293323ab762589ae57869b2ecf4293511e3b5905.zip FreeBSD-src-293323ab762589ae57869b2ecf4293511e3b5905.tar.gz |
Use nitems().
Diffstat (limited to 'usr.bin/truss')
-rw-r--r-- | usr.bin/truss/amd64-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/amd64-fbsd32.c | 3 | ||||
-rw-r--r-- | usr.bin/truss/amd64-linux32.c | 6 | ||||
-rw-r--r-- | usr.bin/truss/arm-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/i386-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/i386-linux.c | 6 | ||||
-rw-r--r-- | usr.bin/truss/mips-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/powerpc-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/powerpc64-fbsd.c | 2 | ||||
-rw-r--r-- | usr.bin/truss/sparc64-fbsd.c | 2 |
10 files changed, 12 insertions, 17 deletions
diff --git a/usr.bin/truss/amd64-fbsd.c b/usr.bin/truss/amd64-fbsd.c index d0be3e6..7ece9ca 100644 --- a/usr.bin/truss/amd64-fbsd.c +++ b/usr.bin/truss/amd64-fbsd.c @@ -64,7 +64,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/amd64-fbsd32.c b/usr.bin/truss/amd64-fbsd32.c index 74d45a2..42a4e47 100644 --- a/usr.bin/truss/amd64-fbsd32.c +++ b/usr.bin/truss/amd64-fbsd32.c @@ -64,8 +64,7 @@ static const char rcsid[] = #include "freebsd32_syscalls.h" -static int nsyscalls = sizeof(freebsd32_syscallnames) / - sizeof(freebsd32_syscallnames[0]); +static int nsyscalls = nitems(freebsd32_syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/amd64-linux32.c b/usr.bin/truss/amd64-linux32.c index 2c025a3..be5029e 100644 --- a/usr.bin/truss/amd64-linux32.c +++ b/usr.bin/truss/amd64-linux32.c @@ -61,8 +61,7 @@ static const char rcsid[] = #include "linux32_syscalls.h" -static int nsyscalls = - sizeof(linux32_syscallnames) / sizeof(linux32_syscallnames[0]); +static int nsyscalls = nitems(linux32_syscallnames); /* * This is what this particular file uses to keep track of a system call. @@ -310,8 +309,7 @@ amd64_linux32_syscall_exit(struct trussinfo *trussinfo, * but that complicates things considerably. */ if (errorp) { - for (i = 0; - (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) { + for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) { if (retval == bsd_to_linux_errno[i]) break; } diff --git a/usr.bin/truss/arm-fbsd.c b/usr.bin/truss/arm-fbsd.c index dd1ae08..2fef59d 100644 --- a/usr.bin/truss/arm-fbsd.c +++ b/usr.bin/truss/arm-fbsd.c @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/i386-fbsd.c b/usr.bin/truss/i386-fbsd.c index 89879d2..788d008 100644 --- a/usr.bin/truss/i386-fbsd.c +++ b/usr.bin/truss/i386-fbsd.c @@ -64,7 +64,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c index 84f1451..5057449 100644 --- a/usr.bin/truss/i386-linux.c +++ b/usr.bin/truss/i386-linux.c @@ -61,8 +61,7 @@ static const char rcsid[] = #include "linux_syscalls.h" -static int nsyscalls = - sizeof(linux_syscallnames) / sizeof(linux_syscallnames[0]); +static int nsyscalls = nitems(linux_syscallnames); /* * This is what this particular file uses to keep track of a system call. @@ -309,8 +308,7 @@ i386_linux_syscall_exit(struct trussinfo *trussinfo, int syscall_num __unused) * but that complicates things considerably. */ if (errorp) { - for (i = 0; - (size_t)i < sizeof(bsd_to_linux_errno) / sizeof(int); i++) { + for (i = 0; (size_t)i < nitems(bsd_to_linux_errno); i++) { if (retval == bsd_to_linux_errno[i]) break; } diff --git a/usr.bin/truss/mips-fbsd.c b/usr.bin/truss/mips-fbsd.c index 71e9efa..3282695 100644 --- a/usr.bin/truss/mips-fbsd.c +++ b/usr.bin/truss/mips-fbsd.c @@ -68,7 +68,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/powerpc-fbsd.c b/usr.bin/truss/powerpc-fbsd.c index 990da29..7215dca 100644 --- a/usr.bin/truss/powerpc-fbsd.c +++ b/usr.bin/truss/powerpc-fbsd.c @@ -68,7 +68,7 @@ static const char rcsid[] = #include "syscalls.h" #endif -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/powerpc64-fbsd.c b/usr.bin/truss/powerpc64-fbsd.c index 9d5cbd9..6509e65 100644 --- a/usr.bin/truss/powerpc64-fbsd.c +++ b/usr.bin/truss/powerpc64-fbsd.c @@ -63,7 +63,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. diff --git a/usr.bin/truss/sparc64-fbsd.c b/usr.bin/truss/sparc64-fbsd.c index 3c6de5f..f415c96 100644 --- a/usr.bin/truss/sparc64-fbsd.c +++ b/usr.bin/truss/sparc64-fbsd.c @@ -69,7 +69,7 @@ static const char rcsid[] = #include "syscalls.h" -static int nsyscalls = sizeof(syscallnames) / sizeof(syscallnames[0]); +static int nsyscalls = nitems(syscallnames); /* * This is what this particular file uses to keep track of a system call. |