Fix some types
authorAndreas Zwinkau <zwinkau@kit.edu>
Mon, 6 Jun 2011 09:30:00 +0000 (11:30 +0200)
committerAndreas Zwinkau <zwinkau@kit.edu>
Mon, 6 Jun 2011 10:19:57 +0000 (12:19 +0200)
Fixes issue 64, because casting long to int does work on 64bit.

ir/ir/irverify.c
ir/lower/lower_switch.c

index 5b2353c..4868f07 100644 (file)
@@ -1875,7 +1875,7 @@ static int check_block_cfg(const ir_node *block, check_cfg_env_t *env)
                                if (pn == pn_Cond_false)
                                        ir_nodeset_insert(&env->false_projs, branch);
                        } else {
-                               int default_pn = get_Cond_default_proj(branch);
+                               long default_pn = get_Cond_default_proj(branch);
                                if (pn == default_pn)
                                        ir_nodeset_insert(&env->true_projs, branch);
                        }
index 6de9751..56adc79 100644 (file)
@@ -207,7 +207,7 @@ static void create_out_of_bounds_check(cond_env_t *env, ir_node *cond)
        ir_node       *block         = get_nodes_block(cond);
        ir_mode       *cmp_mode      = get_irn_mode(sel);
        ir_node      **default_preds = NEW_ARR_F(ir_node*, 0);
-       unsigned long  default_pn    = get_Cond_default_proj(cond);
+       long           default_pn    = get_Cond_default_proj(cond);
        long           delta         = 0;
        ir_node       *max_const;
        ir_node       *proj_true;
@@ -252,11 +252,11 @@ static void create_out_of_bounds_check(cond_env_t *env, ir_node *cond)
 
        /* adapt projs */
        foreach_out_irn(cond, i, proj) {
-               unsigned long pn     = get_Proj_proj(proj);
-               unsigned long new_pn = pn - delta;
+               long pn     = get_Proj_proj(proj);
+               long new_pn = pn - delta;
                if (pn == default_pn) {
                        /* we might have to choose a new default_pn */
-                       if (pn < (unsigned long) env->switch_max) {
+                       if (pn < env->switch_max) {
                                new_pn = env->switch_max + 1;
                                set_Cond_default_proj(cond, new_pn);
                        } else {