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: inline access to type properties i...
details: https://anonhg.NetBSD.org/src/rev/4419189b38d4
branches: trunk
changeset: 953778:4419189b38d4
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Mar 20 18:38:25 2021 +0000
description:
lint: inline access to type properties in check_bad_enum_operation
No functional change.
diffstat:
usr.bin/xlint/lint1/tree.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diffs (44 lines):
diff -r 6bdcbd93ad8f -r 4419189b38d4 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sat Mar 20 17:18:50 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sat Mar 20 18:38:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.238 2021/03/20 17:18:50 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.239 2021/03/20 18:38:25 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.238 2021/03/20 17:18:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.239 2021/03/20 18:38:25 rillig Exp $");
#endif
#include <float.h>
@@ -1683,15 +1683,12 @@
static void
check_bad_enum_operation(op_t op, const tnode_t *ln, const tnode_t *rn)
{
- mod_t *mp;
if (!eflag)
return;
- mp = &modtab[op];
-
if (!(ln->tn_type->t_is_enum ||
- (mp->m_binary && rn->tn_type->t_is_enum))) {
+ (modtab[op].m_binary && rn->tn_type->t_is_enum))) {
return;
}
@@ -1706,7 +1703,7 @@
}
/* dubious operation on enum, op %s */
- warning(241, mp->m_name);
+ warning(241, getopname(op));
}
Home |
Main Index |
Thread Index |
Old Index