Module Name: src
Committed By: rillig
Date: Sun Jan 5 06:58:47 UTC 2025
Modified Files:
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: clean up integer constraints
Since ic_con already handles conversions (and casts), there is no need to
unwrap the conversions (but not the casts) explicitly.
To generate a diff of this commit:
cvs rdiff -u -r1.669 -r1.670 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/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.669 src/usr.bin/xlint/lint1/tree.c:1.670
--- src/usr.bin/xlint/lint1/tree.c:1.669 Thu Jan 2 20:02:59 2025
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 5 06:58:47 2025
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.669 2025/01/02 20:02:59 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.670 2025/01/05 06:58:47 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.669 2025/01/02 20:02:59 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.670 2025/01/05 06:58:47 rillig Exp $");
#endif
#include <float.h>
@@ -494,26 +494,26 @@ ic_expr(const tnode_t *tn)
switch (tn->tn_op) {
case MULT:
- lc = ic_expr(before_conversion(tn->u.ops.left));
- rc = ic_expr(before_conversion(tn->u.ops.right));
+ lc = ic_expr(tn->u.ops.left);
+ rc = ic_expr(tn->u.ops.right);
return ic_mult(tn->tn_type, lc, rc);
case DIV:
- lc = ic_expr(before_conversion(tn->u.ops.left));
- rc = ic_expr(before_conversion(tn->u.ops.right));
+ lc = ic_expr(tn->u.ops.left);
+ rc = ic_expr(tn->u.ops.right);
return ic_div(tn->tn_type, lc, rc);
case MOD:
- lc = ic_expr(before_conversion(tn->u.ops.left));
- rc = ic_expr(before_conversion(tn->u.ops.right));
+ lc = ic_expr(tn->u.ops.left);
+ rc = ic_expr(tn->u.ops.right);
return ic_mod(tn->tn_type, lc, rc);
case PLUS:
- lc = ic_expr(before_conversion(tn->u.ops.left));
- rc = ic_expr(before_conversion(tn->u.ops.right));
+ lc = ic_expr(tn->u.ops.left);
+ rc = ic_expr(tn->u.ops.right);
return ic_plus(tn->tn_type, lc, rc);
case MINUS:
if (tn->u.ops.left->tn_type->t_tspec == PTR)
return ic_any(tn->tn_type);
- lc = ic_expr(before_conversion(tn->u.ops.left));
- rc = ic_expr(before_conversion(tn->u.ops.right));
+ lc = ic_expr(tn->u.ops.left);
+ rc = ic_expr(tn->u.ops.right);
return ic_minus(tn->tn_type, lc, rc);
case SHL:
lc = ic_expr(tn->u.ops.left);