From e8a90602193f74ffad58188d1a05f75c1eeeb3f3 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 4 Feb 2004 00:30:42 +0000 Subject: [PATCH] oops, messed up things like float = int --- tools/qfcc/source/constfold.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/qfcc/source/constfold.c b/tools/qfcc/source/constfold.c index f435d4e91..e56a8bca2 100644 --- a/tools/qfcc/source/constfold.c +++ b/tools/qfcc/source/constfold.c @@ -173,6 +173,8 @@ do_op_float (int op, expr_t *e, expr_t *e1, expr_t *e2) if ((type = get_type (e1)) != &type_float) { //FIXME optimize casting a constant e->e.expr.e2 = e2 = cast_expr (type, e2); + } else if ((conv = convert_to_float (e2)) != e2) { + e->e.expr.e2 = e2 = conv; } } else { if ((conv = convert_to_float (e1)) != e1) { @@ -661,6 +663,8 @@ do_op_uinteger (int op, expr_t *e, expr_t *e1, expr_t *e2) if (op == '=') { if ((type = get_type (e1)) != &type_uinteger) { e->e.expr.e2 = e2 = cast_expr (type, e2); + } else if ((conv = convert_to_uinteger (e2)) != e2) { + e->e.expr.e2 = e2 = conv; } } else { if (get_type (e1) != &type_uinteger) {