Fixed a lot of size_t related warnings, most of them due to array implementation...
[libfirm] / ir / tr / tr_inheritance.c
index 525ef5e..028a484 100644 (file)
@@ -163,8 +163,8 @@ static set *tr_inh_trans_set = NULL;
  */
 static int tr_inh_trans_cmp(const void *e1, const void *e2, size_t size)
 {
-       const tr_inh_trans_tp *ef1 = e1;
-       const tr_inh_trans_tp *ef2 = e2;
+       const tr_inh_trans_tp *ef1 = (const tr_inh_trans_tp*)e1;
+       const tr_inh_trans_tp *ef2 = (const tr_inh_trans_tp*)e2;
        (void) size;
 
        return ef1->kind != ef2->kind;
@@ -186,11 +186,11 @@ static tr_inh_trans_tp *get_firm_kind_entry(const firm_kind *k)
 
        if (!tr_inh_trans_set) tr_inh_trans_set = new_set(tr_inh_trans_cmp, 128);
 
-       found = set_find(tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
+       found = (tr_inh_trans_tp*)set_find(tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
        if (!found) {
                a.directions[d_up]   = pset_new_ptr(16);
                a.directions[d_down] = pset_new_ptr(16);
-               found = set_insert(tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
+               found = (tr_inh_trans_tp*)set_insert(tr_inh_trans_set, &a, sizeof(a), tr_inh_trans_hash(&a));
        }
        return found;
 }
@@ -408,7 +408,8 @@ void free_inh_transitive_closure(void)
 {
        if (tr_inh_trans_set) {
                tr_inh_trans_tp *elt;
-               for (elt = set_first(tr_inh_trans_set); elt; elt = set_next(tr_inh_trans_set)) {
+               for (elt = (tr_inh_trans_tp*)set_first(tr_inh_trans_set); elt != NULL;
+                    elt = (tr_inh_trans_tp*)set_next(tr_inh_trans_set)) {
                        del_pset(elt->directions[d_up]);
                        del_pset(elt->directions[d_down]);
                }
@@ -423,13 +424,13 @@ void free_inh_transitive_closure(void)
 ir_type *get_class_trans_subtype_first(const ir_type *tp)
 {
        assert_valid_state();
-       return pset_first(get_type_map(tp, d_down));
+       return (ir_type*)pset_first(get_type_map(tp, d_down));
 }
 
 ir_type *get_class_trans_subtype_next(const ir_type *tp)
 {
        assert_valid_state();
-       return pset_next(get_type_map(tp, d_down));
+       return (ir_type*)pset_next(get_type_map(tp, d_down));
 }
 
 int is_class_trans_subtype(const ir_type *tp, const ir_type *subtp)
@@ -443,13 +444,13 @@ int is_class_trans_subtype(const ir_type *tp, const ir_type *subtp)
 ir_type *get_class_trans_supertype_first(const ir_type *tp)
 {
        assert_valid_state();
-       return pset_first(get_type_map(tp, d_up));
+       return (ir_type*)pset_first(get_type_map(tp, d_up));
 }
 
 ir_type *get_class_trans_supertype_next(const ir_type *tp)
 {
        assert_valid_state();
-       return pset_next(get_type_map(tp, d_up));
+       return (ir_type*)pset_next(get_type_map(tp, d_up));
 }
 
 /* - overwrittenby ------------------------------------------------------- */
@@ -457,13 +458,13 @@ ir_type *get_class_trans_supertype_next(const ir_type *tp)
 ir_entity *get_entity_trans_overwrittenby_first(const ir_entity *ent)
 {
        assert_valid_state();
-       return pset_first(get_entity_map(ent, d_down));
+       return (ir_entity*)pset_first(get_entity_map(ent, d_down));
 }
 
 ir_entity *get_entity_trans_overwrittenby_next(const ir_entity *ent)
 {
        assert_valid_state();
-       return pset_next(get_entity_map(ent, d_down));
+       return (ir_entity*)pset_next(get_entity_map(ent, d_down));
 }
 
 /* - overwrites ---------------------------------------------------------- */
@@ -473,13 +474,13 @@ ir_entity *get_entity_trans_overwrittenby_next(const ir_entity *ent)
 ir_entity *get_entity_trans_overwrites_first(const ir_entity *ent)
 {
        assert_valid_state();
-       return pset_first(get_entity_map(ent, d_up));
+       return (ir_entity*)pset_first(get_entity_map(ent, d_up));
 }
 
 ir_entity *get_entity_trans_overwrites_next(const ir_entity *ent)
 {
        assert_valid_state();
-       return pset_next(get_entity_map(ent, d_up));
+       return (ir_entity*)pset_next(get_entity_map(ent, d_up));
 }