Module Name: src
Committed By: rillig
Date: Sun Jan 17 16:01:19 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: clean up typeok_ordered_comparison
To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/usr.bin/xlint/lint1/tree.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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.174 src/usr.bin/xlint/lint1/tree.c:1.175
--- src/usr.bin/xlint/lint1/tree.c:1.174 Sun Jan 17 15:40:27 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 17 16:01:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.174 2021/01/17 15:40:27 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.175 2021/01/17 16:01:19 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.174 2021/01/17 15:40:27 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.175 2021/01/17 16:01:19 rillig Exp $");
#endif
#include <float.h>
@@ -959,7 +959,7 @@ typeok_eq(const tnode_t *ln, tspec_t lt,
}
static bool
-typeok_ordered_comparison(op_t op, const mod_t *mp,
+typeok_ordered_comparison(op_t op,
const tnode_t *ln, const type_t *ltp, tspec_t lt,
const tnode_t *rn, const type_t *rtp, tspec_t rt)
{
@@ -971,7 +971,7 @@ typeok_ordered_comparison(op_t op, const
"pointer" : "integer";
/* illegal combination of %s (%s) and ... */
warning(123, lx, type_name(ltp),
- rx, type_name(rtp), mp->m_name);
+ rx, type_name(rtp), getopname(op));
} else {
warn_incompatible_types(op, lt, rt);
return false;
@@ -1320,8 +1320,7 @@ typeok_op(op_t op, const mod_t *mp, int
case GT:
case LE:
case GE:
- if (!typeok_ordered_comparison(op, mp,
- ln, ltp, lt, rn, rtp, rt))
+ if (!typeok_ordered_comparison(op, ln, ltp, lt, rn, rtp, rt))
return false;
break;
case QUEST: