From nobody Fri Apr 05 22:57:53 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBDR543tXz5HMNV; Fri, 5 Apr 2024 22:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBDR52Bw5z59JW; Fri, 5 Apr 2024 22:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712357873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAspqJJ/T5MJsbo7QxWleZnis5r9GDK+IGOnxTJ1JDY=; b=RTk5T1Xc2xnnNAeOJxgQdxZXIhkNtRsMNe3kqVGF7DhUWJxoiPUd+ALjWpeaZHCGCL11AF RAiiEw58FYmPrNGLeoM4QNE8o/lN0k6HEOeLA2rbcfKvt7840/RMBCMjfy4U+VWUywQUO+ u72AY3SOGFlKm6hHpnOVKLZHNNjhctY1h1dIhuCmCk1VOnOzCokue1jz6Cj68fdd198STg IFyQAyZvd44+lG8eRa1XPOq7g4eTt1+pxeHde4n1xbkgJSODqvg34IxqyPjfuKeaQgHCBn mtXaN0xqvueZGqIBpNqxmbDsdtR5VeKeXo7kWn+/k038xa4V9gMgRiMwrY8c6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712357873; a=rsa-sha256; cv=none; b=LXoEHBKLt0RcCiErtswbm/FR2SoY+lfhqSSe10gGuii3q8dcJjWQnaTuvG1Nznv+GZCzFE gIY0KEur8wALSMh7ghbVz2ssHrjy4wlvm5u+g1RYA+mJ8AHhyv0s0Vih8+jxm8jssgvGSp NAHYZeB3Hm1bOogg8spfLVrerEM/93HmGp9+6A6VVWFQypPfSW8iD5C0Yanrp6kRKJlyyn 4US3G/K3LF58Be2AZecG8N4XqFqK+J1Yo0Zxjiqx4Ol2joXtp9/uAeQnwwWvRoloL3rysV r11W3M2iDxbIaiHOR68bdYiJsx/FtBtRRMV715wue+J5+Q5ZTa9iPwGKgOSQcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712357873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAspqJJ/T5MJsbo7QxWleZnis5r9GDK+IGOnxTJ1JDY=; b=YFIRU7v3LoJXSIgQN2NXuJlPWDZSNgDJc/yn99r9QdQIeI3f23a8WbHi7nYovIxRVwmgx+ FgpziwQlCYadfy8Mr9Z7MhBPt3rsL6w4wpc8y3BONZEHbGTE2lQXxvwEv9om2/tUQ6IGFb KRtGlMYF+2IggrbCOV4dOK1Gu5q9Cfqp0vUGHhQ5CXv/+1r7A5IfM3DdXuo0n+4cuMh66S oILzQg3ZTsdkueHpke2mteqCyCNu3zug7kOs6pRzMRz6H0bZzAOd/fIAc/rs7p03M2IVAj Pot89xnQ3iIa9e8cr5NxUp+tmXOEZRYf0gvQ9pMrCcsFQjOlYwE2yoqWzvqpAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VBDR51dS3zHvb; Fri, 5 Apr 2024 22:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 435Mvrml058863; Fri, 5 Apr 2024 22:57:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 435MvrHT058861; Fri, 5 Apr 2024 22:57:53 GMT (envelope-from git) Date: Fri, 5 Apr 2024 22:57:53 GMT Message-Id: <202404052257.435MvrHT058861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ea002c1017f8 - main - devmatch: Convert command line flags to bools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea002c1017f86fd5d1b778f9600b06f3561ab868 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ea002c1017f86fd5d1b778f9600b06f3561ab868 commit ea002c1017f86fd5d1b778f9600b06f3561ab868 Author: Warner Losh AuthorDate: 2024-04-05 22:34:03 +0000 Commit: Warner Losh CommitDate: 2024-04-05 22:53:47 +0000 devmatch: Convert command line flags to bools These are bools, and should have been bools from the start. Make them bools. Sponsored by: Netflix --- sbin/devmatch/devmatch.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/sbin/devmatch/devmatch.c b/sbin/devmatch/devmatch.c index 6124794d113a..49f9be00a2e7 100644 --- a/sbin/devmatch/devmatch.c +++ b/sbin/devmatch/devmatch.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -54,13 +55,13 @@ static struct option longopts[] = { #define DEVMATCH_MAX_HITS 256 -static int all_flag; -static int dump_flag; +static bool all_flag; +static bool dump_flag; static char *linker_hints; static char *nomatch_str; -static int quiet_flag; -static int unbound_flag; -static int verbose_flag; +static bool quiet_flag; +static bool unbound_flag; +static bool verbose_flag; static void *hints; static void *hints_end; @@ -573,10 +574,10 @@ main(int argc, char **argv) longopts, NULL)) != -1) { switch (ch) { case 'a': - all_flag++; + all_flag = true; break; case 'd': - dump_flag++; + dump_flag = true; break; case 'h': linker_hints = optarg; @@ -585,13 +586,13 @@ main(int argc, char **argv) nomatch_str = optarg; break; case 'q': - quiet_flag++; + quiet_flag = true; break; case 'u': - unbound_flag++; + unbound_flag = true; break; case 'v': - verbose_flag++; + verbose_flag = true; break; default: usage();