Skip to contentSkip to conversation

evaluate_compare() can just use evaluate_arith() for non-pointer cases

PATCH New Al Viro 1 participant 1 message Oct 1, 2006 Sparse checker

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 3/7 evaluate_compare() can just use evaluate_arith() for non-pointer cases

---
 evaluate.c |   17 +----------------
 1 files changed, 1 insertions(+), 16 deletions(-)
evaluate.c +1 -16
index b3a79e7..1d33c58 100644
@@ -999,26 +999,11 @@ static struct symbol *evaluate_compare(s
 		goto OK;
 	}
 
-	ctype = compatible_integer_binop(&expr->left, &expr->right);
+	ctype = evaluate_arith(expr, 1);
 	if (ctype) {
 		if (ctype->ctype.modifiers & MOD_UNSIGNED)
 			expr->op = modify_for_unsigned(expr->op);
-		goto OK;
-	}
-
-	ctype = compatible_float_binop(&expr->left, &expr->right);
-	if (ctype)
-		goto OK;
-
-	ctype = compatible_restricted_binop(expr->op, &expr->left, &expr->right);
-	if (ctype) {
-		if (ctype->ctype.modifiers & MOD_UNSIGNED)
-			expr->op = modify_for_unsigned(expr->op);
-		goto OK;
 	}
-
-	bad_expr_type(expr);
-
 OK:
 	expr->ctype = &bool_ctype;
 	return &bool_ctype;
Signature · 1 line
1.4.2.GIT