From owner-svn-src-head@freebsd.org Sat Aug 18 20:23:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F6B61074B1A; Sat, 18 Aug 2018 20:23:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11319746D3; Sat, 18 Aug 2018 20:23:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E644B1C5E7; Sat, 18 Aug 2018 20:23:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7IKNr28095985; Sat, 18 Aug 2018 20:23:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7IKNrei095984; Sat, 18 Aug 2018 20:23:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201808182023.w7IKNrei095984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 18 Aug 2018 20:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338021 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 338021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Aug 2018 20:23:54 -0000 Author: jhb Date: Sat Aug 18 20:23:53 2018 New Revision: 338021 URL: https://svnweb.freebsd.org/changeset/base/338021 Log: Use 'bool' instead of 'int' for various boolean flags. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16611 Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Sat Aug 18 19:45:56 2018 (r338020) +++ head/usr.bin/kdump/kdump.c Sat Aug 18 20:23:53 2018 (r338021) @@ -125,8 +125,9 @@ void usage(void); #define TIMESTAMP_ELAPSED 0x2 #define TIMESTAMP_RELATIVE 0x4 -static int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, - resolv = 0, abiflag = 0, syscallno = 0; +static bool abiflag, decimal, fancy = true, resolv, suppressdata, syscallno, + tail, threads; +static int timestamp, maxdata; static const char *tracefile = DEF_TRACEFILE; static struct ktr_header ktr_header; @@ -363,40 +364,40 @@ main(int argc, char *argv[]) while ((ch = getopt(argc,argv,"f:dElm:np:AHRrSsTt:")) != -1) switch (ch) { case 'A': - abiflag = 1; + abiflag = true; break; case 'f': tracefile = optarg; break; case 'd': - decimal = 1; + decimal = true; break; case 'l': - tail = 1; + tail = true; break; case 'm': maxdata = atoi(optarg); break; case 'n': - fancy = 0; + fancy = false; break; case 'p': pid = atoi(optarg); break; case 'r': - resolv = 1; + resolv = true; break; case 'S': - syscallno = 1; + syscallno = true; break; case 's': - suppressdata = 1; + suppressdata = true; break; case 'E': timestamp |= TIMESTAMP_ELAPSED; break; case 'H': - threads = 1; + threads = true; break; case 'R': timestamp |= TIMESTAMP_RELATIVE; @@ -427,18 +428,18 @@ main(int argc, char *argv[]) caph_cache_tzdata(); #ifdef WITH_CASPER - if (resolv != 0) { + if (resolv) { if (cappwdgrp_setup(&cappwd, &capgrp) < 0) { cappwd = NULL; capgrp = NULL; } } - if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) { + if (!resolv || (cappwd != NULL && capgrp != NULL)) { if (caph_enter() < 0) err(1, "unable to enter capability mode"); } #else - if (resolv == 0) { + if (!resolv) { if (caph_enter() < 0) err(1, "unable to enter capability mode"); } @@ -1835,14 +1836,14 @@ ktrstat(struct stat *statp) printf("struct stat {"); printf("dev=%ju, ino=%ju, ", (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino); - if (resolv == 0) + if (!resolv) printf("mode=0%jo, ", (uintmax_t)statp->st_mode); else { strmode(statp->st_mode, mode); printf("mode=%s, ", mode); } printf("nlink=%ju, ", (uintmax_t)statp->st_nlink); - if (resolv == 0) { + if (!resolv) { pwd = NULL; } else { #ifdef WITH_CASPER @@ -1856,7 +1857,7 @@ ktrstat(struct stat *statp) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else printf("uid=\"%s\", ", pwd->pw_name); - if (resolv == 0) { + if (!resolv) { grp = NULL; } else { #ifdef WITH_CASPER @@ -1872,7 +1873,7 @@ ktrstat(struct stat *statp) printf("gid=\"%s\", ", grp->gr_name); printf("rdev=%ju, ", (uintmax_t)statp->st_rdev); printf("atime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_atim.tv_sec); else { tm = localtime(&statp->st_atim.tv_sec); @@ -1884,7 +1885,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("mtime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_mtim.tv_sec); else { tm = localtime(&statp->st_mtim.tv_sec); @@ -1896,7 +1897,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("ctime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_ctim.tv_sec); else { tm = localtime(&statp->st_ctim.tv_sec); @@ -1908,7 +1909,7 @@ ktrstat(struct stat *statp) else printf(", "); printf("birthtime="); - if (resolv == 0) + if (!resolv) printf("%jd", (intmax_t)statp->st_birthtim.tv_sec); else { tm = localtime(&statp->st_birthtim.tv_sec);