[PATCH] remove confusing intermediate 'where' in evaluate_assignment()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In evaluate_assignment(), a local variable (named 'where') contains
the input expression (named 'expr', like in most other function).

This is doubly confusing because:
*) both variables hold the same pointer.
*) the name 'where' is normally used for a string with extra
   information for error messages.

So, remove this intermediate and use the original 'expr' instead.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 evaluate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/evaluate.c b/evaluate.c
index 947b121f4..53b66cc2d 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -1577,7 +1577,6 @@ static void evaluate_assign_to(struct expression *left, struct symbol *type)
 static struct symbol *evaluate_assignment(struct expression *expr)
 {
 	struct expression *left = expr->left;
-	struct expression *where = expr;
 	struct symbol *ltype;
 
 	if (!lvalue_expression(left)) {
@@ -1591,7 +1590,7 @@ static struct symbol *evaluate_assignment(struct expression *expr)
 		if (!evaluate_assign_op(expr))
 			return NULL;
 	} else {
-		if (!compatible_assignment_types(where, ltype, &expr->right, "assignment"))
+		if (!compatible_assignment_types(expr, ltype, &expr->right, "assignment"))
 			return NULL;
 	}
 
-- 
2.20.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux