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: make typeok_quest simpler
details: https://anonhg.NetBSD.org/src/rev/f1b11e52ac80
branches: trunk
changeset: 985675:f1b11e52ac80
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Sep 04 09:18:25 2021 +0000
description:
lint: make typeok_quest simpler
No functional change.
diffstat:
usr.bin/xlint/lint1/tree.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diffs (46 lines):
diff -r 18d283ef2fb0 -r f1b11e52ac80 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sat Sep 04 05:47:31 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sat Sep 04 09:18:25 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.372 2021/09/03 22:48:49 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.373 2021/09/04 09:18: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.372 2021/09/03 22:48:49 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.373 2021/09/04 09:18:25 rillig Exp $");
#endif
#include <float.h>
@@ -1014,16 +1014,14 @@
}
static bool
-typeok_quest(tspec_t lt, const tnode_t **rn)
+typeok_quest(tspec_t lt, const tnode_t *rn)
{
if (!is_scalar(lt)) {
/* first operand must have scalar type, op ? : */
error(170);
return false;
}
- while ((*rn)->tn_op == CVT)
- *rn = (*rn)->tn_left;
- lint_assert((*rn)->tn_op == COLON);
+ lint_assert(before_conversion(rn)->tn_op == COLON);
return true;
}
@@ -1235,7 +1233,7 @@
return false;
break;
case QUEST:
- if (!typeok_quest(lt, &rn))
+ if (!typeok_quest(lt, rn))
return false;
break;
case COLON:
Home |
Main Index |
Thread Index |
Old Index