Date: Wed, 19 Aug 2015 19:59:42 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286937 - head/usr.bin/truss Message-ID: <201508191959.t7JJxg4E012862@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Wed Aug 19 19:59:42 2015 New Revision: 286937 URL: https://svnweb.freebsd.org/changeset/base/286937 Log: Use nitems(). Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/amd64-linux32.c head/usr.bin/truss/arm-fbsd.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/i386-linux.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-fbsd32.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/amd64-linux32.c ============================================================================== --- head/usr.bin/truss/amd64-linux32.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/amd64-linux32.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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 trussi * 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; } Modified: head/usr.bin/truss/arm-fbsd.c ============================================================================== --- head/usr.bin/truss/arm-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/arm-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/i386-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/i386-linux.c ============================================================================== --- head/usr.bin/truss/i386-linux.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/i386-linux.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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 * 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; } Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/mips-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/powerpc-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/powerpc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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. Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 18:33:25 2015 (r286936) +++ head/usr.bin/truss/sparc64-fbsd.c Wed Aug 19 19:59:42 2015 (r286937) @@ -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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508191959.t7JJxg4E012862>