From f10829206a4e0fe56924448ecfe1669cde207c96 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 2 Sep 2003 16:53:45 +0000 Subject: [PATCH] use a cast expression rather than and bind expression to do the unsigned comparison for switches. clears the notice (bind seems to be correct in general) and is more correct conceptually anyway. --- tools/qfcc/source/switch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/qfcc/source/switch.c b/tools/qfcc/source/switch.c index f4db402b2..f02a60935 100644 --- a/tools/qfcc/source/switch.c +++ b/tools/qfcc/source/switch.c @@ -290,7 +290,6 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val, build_switch (sw, tree->right, op, sw_val, temp, default_label); } } else { - expr_t *utemp = new_temp_def_expr (&type_uinteger); int low = tree->low->e.integer_val; int high = tree->high->e.integer_val; def_t *def; @@ -309,8 +308,7 @@ build_switch (expr_t *sw, case_node_t *tree, int op, expr_t *sw_val, branch = new_binary_expr (IFB, temp, low_label); append_expr (sw, branch); } - append_expr (sw, new_bind_expr (temp, utemp)); - test = binary_expr (GT, utemp, range); + test = binary_expr (GT, cast_expr (&type_uinteger, temp), range); branch = new_binary_expr ('i', test, high_label); append_expr (sw, branch); branch = new_binary_expr ('g', table, temp);