Module Name: src
Committed By: rillig
Date: Tue Oct 17 19:29:09 UTC 2023
Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c
Log Message:
lint: fix debug output of convert/cast operators
The default name of the 'CVT' operator is 'convert', therefore the
override is only needed for 'cast'.
To generate a diff of this commit:
cvs rdiff -u -r1.474 -r1.475 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/xlint/lint1/debug.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.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.474 src/usr.bin/xlint/lint1/cgram.y:1.475
--- src/usr.bin/xlint/lint1/cgram.y:1.474 Thu Sep 14 22:20:08 2023
+++ src/usr.bin/xlint/lint1/cgram.y Tue Oct 17 19:29:09 2023
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.474 2023/09/14 22:20:08 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.475 2023/10/17 19:29:09 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.474 2023/09/14 22:20:08 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.475 2023/10/17 19:29:09 rillig Exp $");
#endif
#include <limits.h>
@@ -159,7 +159,7 @@ is_either(const char *s, const char *a,
/* for Bison:
%printer {
if (is_integer($$->v_tspec))
- fprintf(yyo, "%lld", (unsigned long long)$$->u.integer);
+ fprintf(yyo, "%lld", (long long)$$->u.integer);
else
fprintf(yyo, "%Lg", $$->u.floating);
} <y_val>
@@ -2280,8 +2280,8 @@ cgram_declare(sym_t *decl, bool has_init
}
/*
- * Discard all input tokens up to and including the next
- * unmatched right paren
+ * Discard all input tokens up to and including the next unmatched right
+ * parenthesis.
*/
static void
read_until_rparen(void)
Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.62 src/usr.bin/xlint/lint1/debug.c:1.63
--- src/usr.bin/xlint/lint1/debug.c:1.62 Wed Sep 13 20:31:58 2023
+++ src/usr.bin/xlint/lint1/debug.c Tue Oct 17 19:29:09 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.62 2023/09/13 20:31:58 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.63 2023/10/17 19:29:09 rillig Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.62 2023/09/13 20:31:58 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.63 2023/10/17 19:29:09 rillig Exp $");
#endif
#include <stdlib.h>
@@ -187,16 +187,15 @@ debug_type(const type_t *tp)
void
debug_node(const tnode_t *tn) // NOLINT(misc-no-recursion)
{
- op_t op;
if (tn == NULL) {
debug_step("null");
return;
}
- op = tn->tn_op;
+ op_t op = tn->tn_op;
debug_printf("'%s'",
- op == CVT && !tn->tn_cast ? "convert" : op_name(op));
+ op == CVT && tn->tn_cast ? "cast" : op_name(op));
if (op == NAME)
debug_printf(" '%s' with %s",
tn->tn_sym->s_name,