Module Name: src Committed By: rillig Date: Mon May 13 20:38:05 UTC 2024
Modified Files: src/usr.sbin/flashctl: Makefile flashctl.c Log Message: usr.sbin/flashctl: skip lint's strict bool mode with Clang The strict bool mode is already checked in GCC mode, so restore the previous idiomatic code. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/flashctl/Makefile cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/flashctl/flashctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/flashctl/Makefile diff -u src/usr.sbin/flashctl/Makefile:1.3 src/usr.sbin/flashctl/Makefile:1.4 --- src/usr.sbin/flashctl/Makefile:1.3 Sun Jan 8 15:49:51 2023 +++ src/usr.sbin/flashctl/Makefile Mon May 13 20:38:05 2024 @@ -1,11 +1,12 @@ -# $NetBSD: Makefile,v 1.3 2023/01/08 15:49:51 rillig Exp $ +# $NetBSD: Makefile,v 1.4 2024/05/13 20:38:05 rillig Exp $ SRCS= flashctl.c PROG= flashctl MAN= flashctl.8 -LINTFLAGS+= -T # strict bool mode +LINTFLAGS+= ${MKLLVM:U-T:D} # strict bool mode WARNS= 4 .include <bsd.prog.mk> + Index: src/usr.sbin/flashctl/flashctl.c diff -u src/usr.sbin/flashctl/flashctl.c:1.10 src/usr.sbin/flashctl/flashctl.c:1.11 --- src/usr.sbin/flashctl/flashctl.c:1.10 Sun May 12 19:03:55 2024 +++ src/usr.sbin/flashctl/flashctl.c Mon May 13 20:38:05 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $ */ +/* $NetBSD: flashctl.c,v 1.11 2024/05/13 20:38:05 rillig Exp $ */ /*- * Copyright (c) 2010 Department of Software Engineering, @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: flashctl.c,v 1.10 2024/05/12 19:03:55 rillig Exp $"); +__RCSID("$NetBSD: flashctl.c,v 1.11 2024/05/13 20:38:05 rillig Exp $"); #include <sys/ioctl.h> #include <sys/flashio.h> @@ -233,11 +233,11 @@ to_intmax(intmax_t *num, const char *str errno = 0; if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X')) { - if (isxdigit((unsigned char)str[2]) == 0) + if (!isxdigit((unsigned char)str[2])) return EINVAL; *num = strtoimax(str, &endptr, 16); } else { - if (isdigit((unsigned char)str[0]) == 0) + if (!isdigit((unsigned char)str[0])) return EINVAL; *num = strtoimax(str, &endptr, 10); }