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: in debug mode, output value of boo...



details:   https://anonhg.NetBSD.org/src/rev/b1ee774833ea
branches:  trunk
changeset: 1029049:b1ee774833ea
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 20 00:10:07 2021 +0000

description:
lint: in debug mode, output value of boolean expressions

diffstat:

 usr.bin/xlint/lint1/debug.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 632deb6e162f -r b1ee774833ea usr.bin/xlint/lint1/debug.c
--- a/usr.bin/xlint/lint1/debug.c       Sun Dec 19 23:50:27 2021 +0000
+++ b/usr.bin/xlint/lint1/debug.c       Mon Dec 20 00:10:07 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.5 2021/11/16 21:01:05 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.6 2021/12/20 00:10:07 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: debug.c,v 1.5 2021/11/16 21:01:05 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.6 2021/12/20 00:10:07 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -132,6 +132,9 @@
                debug_printf(", value %llu\n", (unsigned long long)tn->tn_val->v_quad);
        else if (op == CON && is_integer(tn->tn_type->t_tspec))
                debug_printf(", value %lld\n", (long long)tn->tn_val->v_quad);
+       else if (op == CON && tn->tn_type->t_tspec == BOOL)
+               debug_printf(", value %s\n",
+                   tn->tn_val->v_quad != 0 ? "true" : "false");
        else if (op == CON)
                debug_printf(", unknown value\n");
        else if (op == STRING && tn->tn_string->st_tspec == CHAR)



Home | Main Index | Thread Index | Old Index