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: rename operator AMPER to ADDR
details: https://anonhg.NetBSD.org/src/rev/2231c1d125ba
branches: trunk
changeset: 979932:2231c1d125ba
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jan 17 14:50:11 2021 +0000
description:
lint: rename operator AMPER to ADDR
There is no operator called 'ampersand'. The ampersand sign is merely
the textual representation of both the operator ADDR and the operator
BITAND.
diffstat:
usr.bin/xlint/lint1/cgram.y | 6 +++---
usr.bin/xlint/lint1/emit1.c | 6 +++---
usr.bin/xlint/lint1/func.c | 6 +++---
usr.bin/xlint/lint1/ops.def | 4 ++--
usr.bin/xlint/lint1/tree.c | 24 ++++++++++++------------
5 files changed, 23 insertions(+), 23 deletions(-)
diffs (202 lines):
diff -r 21905cc750f2 -r 2231c1d125ba usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y Sun Jan 17 14:45:21 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y Sun Jan 17 14:50:11 2021 +0000
@@ -1,5 +1,5 @@
%{
-/* $NetBSD: cgram.y,v 1.141 2021/01/16 16:03:46 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.142 2021/01/17 14:50:11 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.141 2021/01/16 16:03:46 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.142 2021/01/17 14:50:11 rillig Exp $");
#endif
#include <limits.h>
@@ -1903,7 +1903,7 @@
$$ = build(STAR, $2, NULL);
}
| T_AND term {
- $$ = build(AMPER, $2, NULL);
+ $$ = build(ADDR, $2, NULL);
}
| T_UNOP term {
$$ = build($1, $2, NULL);
diff -r 21905cc750f2 -r 2231c1d125ba usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c Sun Jan 17 14:45:21 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c Sun Jan 17 14:50:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.38 2021/01/16 16:53:23 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.39 2021/01/17 14:50:11 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.38 2021/01/16 16:53:23 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.39 2021/01/17 14:50:11 rillig Exp $");
#endif
#include <ctype.h>
@@ -460,7 +460,7 @@
}
outint(n);
}
- } else if (arg->tn_op == AMPER &&
+ } else if (arg->tn_op == ADDR &&
arg->tn_left->tn_op == STRING &&
arg->tn_left->tn_string->st_tspec == CHAR) {
/* constant string, write all format specifiers */
diff -r 21905cc750f2 -r 2231c1d125ba usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c Sun Jan 17 14:45:21 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c Sun Jan 17 14:50:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: func.c,v 1.61 2021/01/17 11:28:01 rillig Exp $ */
+/* $NetBSD: func.c,v 1.62 2021/01/17 14:50:11 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.61 2021/01/17 11:28:01 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.62 2021/01/17 14:50:11 rillig Exp $");
#endif
#include <stdlib.h>
@@ -1010,7 +1010,7 @@
rn = tn->tn_right;
while ((op = rn->tn_op) == CVT || op == PLUS)
rn = rn->tn_left;
- if (rn->tn_op == AMPER && rn->tn_left->tn_op == NAME &&
+ if (rn->tn_op == ADDR && rn->tn_left->tn_op == NAME &&
rn->tn_left->tn_sym->s_scl == AUTO) {
/* %s returns pointer to automatic object */
warning(302, funcsym->s_name);
diff -r 21905cc750f2 -r 2231c1d125ba usr.bin/xlint/lint1/ops.def
--- a/usr.bin/xlint/lint1/ops.def Sun Jan 17 14:45:21 2021 +0000
+++ b/usr.bin/xlint/lint1/ops.def Sun Jan 17 14:50:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.def,v 1.12 2021/01/16 19:03:47 rillig Exp $ */
+/* $NetBSD: ops.def,v 1.13 2021/01/17 14:50:11 rillig Exp $ */
begin_ops()
@@ -19,7 +19,7 @@
op( UPLUS, "+", , , , , , ,1, ,1,1, , , , , , , , ,1,1,1)
op( UMINUS, "-", , , , , , ,1, ,1,1, , , ,1, , , , ,1,1,1)
op( STAR, "*", , , , , , , , , ,1, , , , , , , , , , ,1)
-op( AMPER, "&", , ,1, , , , , , , , , , , , , , , , , ,1)
+op( ADDR, "&", , ,1, , , , , , , , , , , , , , , , , ,1)
/* name repr b l b o i c a s f v t b s l r p c e e = act */
op( MULT, "*", 1, , , , , ,1, ,1,1, ,1, , ,1, , , ,1,1,1)
diff -r 21905cc750f2 -r 2231c1d125ba usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sun Jan 17 14:45:21 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sun Jan 17 14:50:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.168 2021/01/17 14:45:21 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.169 2021/01/17 14:50:11 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.168 2021/01/17 14:45:21 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.169 2021/01/17 14:50:11 rillig Exp $");
#endif
#include <float.h>
@@ -585,7 +585,7 @@
case DECBEF:
ntn = build_prepost_incdec(op, ln);
break;
- case AMPER:
+ case ADDR:
ntn = build_address(ln, 0);
break;
case STAR:
@@ -692,9 +692,9 @@
if (!tn->tn_lvalue) {
/* XXX print correct operator */
/* %soperand of '%s' must be lvalue */
- gnuism(114, "", modtab[AMPER].m_name);
+ gnuism(114, "", modtab[ADDR].m_name);
}
- tn = new_tnode(AMPER, tincref(tn->tn_type->t_subt, PTR),
+ tn = new_tnode(ADDR, tincref(tn->tn_type->t_subt, PTR),
tn, NULL);
}
@@ -1283,7 +1283,7 @@
if (!typeok_incdec(mp, ln, ltp))
return false;
break;
- case AMPER:
+ case ADDR:
if (!typeok_amper(mp, ln, ltp, lt))
return false;
break;
@@ -2719,7 +2719,7 @@
return tn->tn_left;
}
- ntn = new_tnode(AMPER, tincref(tn->tn_type, PTR), tn, NULL);
+ ntn = new_tnode(ADDR, tincref(tn->tn_type, PTR), tn, NULL);
return ntn;
}
@@ -3898,7 +3898,7 @@
mp = &modtab[op = tn->tn_op];
switch (op) {
- case AMPER:
+ case ADDR:
if (ln->tn_op == NAME && (reached || rchflg)) {
if (!szof)
mark_as_set(ln->tn_sym);
@@ -3961,7 +3961,7 @@
check_array_index(ln->tn_left, 0);
break;
case CALL:
- lint_assert(ln->tn_op == AMPER);
+ lint_assert(ln->tn_op == ADDR);
lint_assert(ln->tn_left->tn_op == NAME);
if (!szof)
outcall(tn, vctx || tctx, rvdisc);
@@ -4074,7 +4074,7 @@
return;
/* Return if the left node does not stem from an array. */
- if (ln->tn_op != AMPER)
+ if (ln->tn_op != ADDR)
return;
if (ln->tn_left->tn_op != STRING && ln->tn_left->tn_op != NAME)
return;
@@ -4179,7 +4179,7 @@
* the result is returned in *offsp. In the second case, the static
* object is returned in *symp and the offset in *offsp.
*
- * The expression can consist of PLUS, MINUS, AMPER, NAME, STRING and
+ * The expression can consist of PLUS, MINUS, ADDR, NAME, STRING and
* CON. Type conversions are allowed if they do not change binary
* representation (including width).
*/
@@ -4215,7 +4215,7 @@
*symp = sym;
*offsp = offs1 + offs2;
break;
- case AMPER:
+ case ADDR:
if (tn->tn_left->tn_op == NAME) {
*symp = tn->tn_left->tn_sym;
*offsp = 0;
Home |
Main Index |
Thread Index |
Old Index