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: invert condition in build_name



details:   https://anonhg.NetBSD.org/src/rev/bc8d3cdb0083
branches:  trunk
changeset: 1029099:bc8d3cdb0083
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 21 15:24:28 2021 +0000

description:
lint: invert condition in build_name

No functional change.

diffstat:

 usr.bin/xlint/lint1/mem1.c |   7 +++++--
 usr.bin/xlint/lint1/tree.c |  14 +++++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r 7be3e64b0f8a -r bc8d3cdb0083 usr.bin/xlint/lint1/mem1.c
--- a/usr.bin/xlint/lint1/mem1.c        Tue Dec 21 15:15:45 2021 +0000
+++ b/usr.bin/xlint/lint1/mem1.c        Tue Dec 21 15:24:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem1.c,v 1.55 2021/11/16 21:01:05 rillig Exp $ */
+/*     $NetBSD: mem1.c,v 1.56 2021/12/21 15:24:28 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.55 2021/11/16 21:01:05 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.56 2021/12/21 15:24:28 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -354,6 +354,9 @@
 /*
  * Return a freshly allocated tree node that is freed at the end of the
  * current expression.
+ *
+ * The node records whether it comes from a system file, which makes strict
+ * bool mode less restrictive.
  */
 tnode_t *
 expr_zalloc_tnode(void)
diff -r 7be3e64b0f8a -r bc8d3cdb0083 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Tue Dec 21 15:15:45 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Tue Dec 21 15:24:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.400 2021/12/17 00:05:24 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.401 2021/12/21 15:24:28 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.400 2021/12/17 00:05:24 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.401 2021/12/21 15:24:28 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -282,15 +282,15 @@
 
        n = expr_zalloc_tnode();
        n->tn_type = sym->s_type;
-       if (sym->s_scl != CTCONST) {
+       if (sym->s_scl == CTCONST) {
+               n->tn_op = CON;
+               n->tn_val = expr_zalloc(sizeof(*n->tn_val));
+               *n->tn_val = sym->s_value;
+       } else {
                n->tn_op = NAME;
                n->tn_sym = sym;
                if (sym->s_kind == FVFT && sym->s_type->t_tspec != FUNC)
                        n->tn_lvalue = true;
-       } else {
-               n->tn_op = CON;
-               n->tn_val = expr_zalloc(sizeof(*n->tn_val));
-               *n->tn_val = sym->s_value;
        }
 
        return n;



Home | Main Index | Thread Index | Old Index