commit 47a6ca4eca00f15ebe7aa6ac72680449805be2e4
parent 620085692aafb38eddaace247bfbbd2b09b4641f
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 4 Nov 2021 07:30:56 +0100
cc1: Change name of variables in cast()
Casts are unary operators and talking about left and right
is really confusing, specially when one of them is just a
temporary variable used to stored the node returned by the
recursion.
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/cmd/cc/cc1/expr.c b/src/cmd/cc/cc1/expr.c
@@ -889,7 +889,7 @@ chk_decay:
static Node *
cast(int needdecay)
{
- Node *lp, *rp;
+ Node *tmp, *np;
Type *tp;
static int nested;
@@ -910,24 +910,24 @@ cast(int needdecay)
case ARY:
error("cast specifies an array type");
default:
- lp = cast(needdecay);
- if ((rp = convert(lp, tp, 1)) == NULL)
+ tmp = cast(needdecay);
+ if ((np = convert(tmp, tp, 1)) == NULL)
error("bad type conversion requested");
- rp->flags &= ~NLVAL;
+ np->flags &= ~NLVAL;
}
break;
default:
if (nested == NR_SUBEXPR)
error("too many expressions nested by parentheses");
++nested;
- rp = xexpr();
+ np = xexpr();
--nested;
expect(')');
- rp = postfix(rp);
+ np = postfix(np);
break;
}
- return rp;
+ return np;
}
static Node *