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: replace LERROR with lint_assert in...



details:   https://anonhg.NetBSD.org/src/rev/1b55ff21bc44
branches:  trunk
changeset: 979663:1b55ff21bc44
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jan 04 22:33:47 2021 +0000

description:
lint: replace LERROR with lint_assert in check_expr_misc

This reduces the visual clutter.  There is no reason for anyone to
modify the code around the CALL operator, therefore the assertion is not
expected to fail anytime soon.

diffstat:

 usr.bin/xlint/lint1/tree.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 8ff99c25bd09 -r 1b55ff21bc44 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Mon Jan 04 22:29:00 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Mon Jan 04 22:33:47 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.127 2021/01/04 22:26:50 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.128 2021/01/04 22:33:47 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.127 2021/01/04 22:26:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.128 2021/01/04 22:33:47 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -3646,10 +3646,8 @@
                        check_array_index(ln->tn_left, 0);
                break;
        case CALL:
-               if (ln->tn_op != AMPER || ln->tn_left->tn_op != NAME)
-                       LERROR("check_expr_misc(op=%s != %s || %s != %s)",
-                           getopname(ln->tn_op), getopname(AMPER),
-                           getopname(ln->tn_left->tn_op), getopname(NAME));
+               lint_assert(ln->tn_op == AMPER);
+               lint_assert(ln->tn_left->tn_op == NAME);
                if (!szof)
                        outcall(tn, vctx || tctx, rvdisc);
                break;



Home | Main Index | Thread Index | Old Index