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: un-abbreviate rvused and rvdisc
details: https://anonhg.NetBSD.org/src/rev/7ff925993486
branches: trunk
changeset: 1023529:7ff925993486
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Sep 12 10:06:03 2021 +0000
description:
lint: un-abbreviate rvused and rvdisc
No functional change.
diffstat:
usr.bin/xlint/lint1/emit1.c | 14 +++++++-------
usr.bin/xlint/lint1/tree.c | 18 +++++++++---------
2 files changed, 16 insertions(+), 16 deletions(-)
diffs (113 lines):
diff -r 1e18d33323c9 -r 7ff925993486 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c Sun Sep 12 09:51:14 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c Sun Sep 12 10:06:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.58 2021/09/04 18:58:57 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.59 2021/09/12 10:06:03 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.58 2021/09/04 18:58:57 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.59 2021/09/12 10:06:03 rillig Exp $");
#endif
#include "lint1.h"
@@ -342,12 +342,12 @@
* write out all information necessary for lint2 to check function
* calls
*
- * rvused is set if the return value is used (assigned to a variable)
- * rvdisc is set if the return value is not used and not ignored
- * (casted to void)
+ * retval_used is set if the return value is used (assigned to a variable)
+ * retval_discarded is set if the return value is neither used nor ignored
+ * (that is, cast to void)
*/
void
-outcall(const tnode_t *tn, bool rvused, bool rvdisc)
+outcall(const tnode_t *tn, bool retval_used, bool retval_discarded)
{
tnode_t *args, *arg;
int narg, n, i;
@@ -411,7 +411,7 @@
}
/* return value discarded/used/ignored */
- outchar((char)(rvdisc ? 'd' : (rvused ? 'u' : 'i')));
+ outchar((char)(retval_discarded ? 'd' : (retval_used ? 'u' : 'i')));
/* name of the called function */
outname(tn->tn_left->tn_left->tn_sym->s_name);
diff -r 1e18d33323c9 -r 7ff925993486 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sun Sep 12 09:51:14 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sun Sep 12 10:06:03 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.380 2021/09/05 18:34:50 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.381 2021/09/12 10:06:03 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.380 2021/09/05 18:34:50 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.381 2021/09/12 10:06:03 rillig Exp $");
#endif
#include <float.h>
@@ -3977,19 +3977,19 @@
static void
check_expr_call(const tnode_t *tn, const tnode_t *ln,
- bool szof, bool vctx, bool tctx, bool rvdisc)
+ bool szof, bool vctx, bool tctx, bool retval_discarded)
{
lint_assert(ln->tn_op == ADDR);
lint_assert(ln->tn_left->tn_op == NAME);
if (!szof &&
!is_compiler_builtin(ln->tn_left->tn_sym->s_name))
- outcall(tn, vctx || tctx, rvdisc);
+ outcall(tn, vctx || tctx, retval_discarded);
}
static bool
check_expr_op(const tnode_t *tn, op_t op, const tnode_t *ln,
- bool szof, bool fcall, bool vctx, bool tctx, bool rvdisc,
- bool eqwarn)
+ bool szof, bool fcall, bool vctx, bool tctx,
+ bool retval_discarded, bool eqwarn)
{
switch (op) {
case ADDR:
@@ -4021,7 +4021,7 @@
check_expr_assign(ln, szof);
break;
case CALL:
- check_expr_call(tn, ln, szof, vctx, tctx, rvdisc);
+ check_expr_call(tn, ln, szof, vctx, tctx, retval_discarded);
break;
case EQ:
if (hflag && eqwarn)
@@ -4078,7 +4078,7 @@
/* ARGSUSED */
void
check_expr_misc(const tnode_t *tn, bool vctx, bool tctx,
- bool eqwarn, bool fcall, bool rvdisc, bool szof)
+ bool eqwarn, bool fcall, bool retval_discarded, bool szof)
{
tnode_t *ln, *rn;
const mod_t *mp;
@@ -4092,7 +4092,7 @@
mp = &modtab[op = tn->tn_op];
if (!check_expr_op(tn, op, ln,
- szof, fcall, vctx, tctx, rvdisc, eqwarn))
+ szof, fcall, vctx, tctx, retval_discarded, eqwarn))
return;
bool cvctx = mp->m_left_value_context;
Home |
Main Index |
Thread Index |
Old Index