Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: convert bitfieldtype_ok from int t...



details:   https://anonhg.NetBSD.org/src/rev/b17ffe043531
branches:  trunk
changeset: 949142:b17ffe043531
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 02 18:44:58 2021 +0000

description:
lint: convert bitfieldtype_ok from int to bool

No functional change intended, except for the output in debug mode.

diffstat:

 usr.bin/xlint/lint1/decl.c     |  12 ++++++------
 usr.bin/xlint/lint1/externs1.h |   4 ++--
 usr.bin/xlint/lint1/func.c     |  12 ++++++------
 3 files changed, 14 insertions(+), 14 deletions(-)

diffs (116 lines):

diff -r 377278e98214 -r b17ffe043531 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sat Jan 02 18:26:44 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sat Jan 02 18:44:58 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.102 2021/01/02 18:26:44 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.103 2021/01/02 18:44:58 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.102 2021/01/02 18:26:44 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.103 2021/01/02 18:44:58 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1106,7 +1106,7 @@
                 */
                if (t == CHAR || t == UCHAR || t == SCHAR ||
                    t == SHORT || t == USHORT || t == ENUM) {
-                       if (bitfieldtype_ok == 0) {
+                       if (!bitfieldtype_ok) {
                                if (sflag) {
                                        /* bit-field type '%s' invalid ... */
                                        warning(273, type_name(tp));
@@ -1116,7 +1116,7 @@
                                }
                        }
                } else if (t == INT && dcs->d_smod == NOTSPEC) {
-                       if (pflag && bitfieldtype_ok == 0) {
+                       if (pflag && !bitfieldtype_ok) {
                                /* nonportable bit-field type */
                                warning(34);
                        }
@@ -1127,7 +1127,7 @@
                         * Integer types not dealt with above are
                         * okay only if BITFIELDTYPE is in effect.
                         */
-                       if (bitfieldtype_ok == 0 || tspec_is_int(t) == 0) {
+                       if (!bitfieldtype_ok || !tspec_is_int(t)) {
                                /* illegal bit-field type */
                                warning(35);
                                sz = tp->t_flen;
@@ -1194,7 +1194,7 @@
         * Clear the BITFIELDTYPE indicator after processing each
         * structure element.
         */
-       bitfieldtype_ok = 0;
+       bitfieldtype_ok = false;
 
        return dsym;
 }
diff -r 377278e98214 -r b17ffe043531 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h    Sat Jan 02 18:26:44 2021 +0000
+++ b/usr.bin/xlint/lint1/externs1.h    Sat Jan 02 18:44:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs1.h,v 1.43 2021/01/01 10:55:28 rillig Exp $     */
+/*     $NetBSD: externs1.h,v 1.44 2021/01/02 18:44:58 rillig Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -239,7 +239,7 @@
 extern int     constcond_flag;
 extern int     llibflg;
 extern int     lwarn;
-extern int     bitfieldtype_ok;
+extern bool    bitfieldtype_ok;
 extern int     plibflg;
 extern int     quadflg;
 
diff -r 377278e98214 -r b17ffe043531 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sat Jan 02 18:26:44 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sat Jan 02 18:44:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.46 2021/01/01 11:41:01 rillig Exp $ */
+/*     $NetBSD: func.c,v 1.47 2021/01/02 18:44:58 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.46 2021/01/01 11:41:01 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.47 2021/01/02 18:44:58 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -138,10 +138,10 @@
 int    lwarn = LWARN_ALL;
 
 /*
- * Nonzero if bitfield type errors are suppressed by a BITFIELDTYPE
+ * Whether bitfield type errors are suppressed by a BITFIELDTYPE
  * directive.
  */
-int    bitfieldtype_ok;
+bool   bitfieldtype_ok;
 
 /*
  * Nonzero if complaints about use of "long long" are suppressed in
@@ -1261,10 +1261,10 @@
 {
 
 #ifdef DEBUG
-       printf("%s, %d: bitfieldtype_ok = 1\n", curr_pos.p_file,
+       printf("%s, %d: bitfieldtype_ok = true\n", curr_pos.p_file,
            curr_pos.p_line);
 #endif
-       bitfieldtype_ok = 1;
+       bitfieldtype_ok = true;
 }
 
 /*



Home | Main Index | Thread Index | Old Index