From owner-svn-src-all@freebsd.org Wed Aug 19 19:59:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B012F9BE64A; Wed, 19 Aug 2015 19:59:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF8617DE; Wed, 19 Aug 2015 19:59:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7JJxjDi012874; Wed, 19 Aug 2015 19:59:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7JJxg4E012862; Wed, 19 Aug 2015 19:59:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508191959.t7JJxg4E012862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 19 Aug 2015 19:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286937 - head/usr.bin/truss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2015 19:59:45 -0000 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.