Module Name: src
Committed By: rillig
Date: Sun Sep 12 10:06:03 UTC 2021
Modified Files:
src/usr.bin/xlint/lint1: emit1.c tree.c
Log Message:
lint: un-abbreviate rvused and rvdisc
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.380 -r1.381 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/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.58 src/usr.bin/xlint/lint1/emit1.c:1.59
--- src/usr.bin/xlint/lint1/emit1.c:1.58 Sat Sep 4 18:58:57 2021
+++ src/usr.bin/xlint/lint1/emit1.c Sun Sep 12 10:06:03 2021
@@ -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 @@ outfdef(const sym_t *fsym, const pos_t *
* 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 @@ outcall(const tnode_t *tn, bool rvused,
}
/* 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);
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.380 src/usr.bin/xlint/lint1/tree.c:1.381
--- src/usr.bin/xlint/lint1/tree.c:1.380 Sun Sep 5 18:34:50 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Sep 12 10:06:03 2021
@@ -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 @@ check_expr_assign(const tnode_t *ln, boo
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_op(const tnode_t *tn, op_t op
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 @@ check_expr_op(const tnode_t *tn, op_t op
/* 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 @@ check_expr_misc(const tnode_t *tn, bool
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;