X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Ftr_inheritance.c;h=2982d2e125b00f7ca3cf09b90b1bf428d95a519f;hb=421e6e10c6cc98ade95167db91059f335497add8;hp=b79bc3cc7cf32ff29db5531e9617740a6f7460a5;hpb=8bbcd23601576ee4ad57755af0e6e280050a6405;p=libfirm diff --git a/ir/tr/tr_inheritance.c b/ir/tr/tr_inheritance.c index b79bc3cc7..2982d2e12 100644 --- a/ir/tr/tr_inheritance.c +++ b/ir/tr/tr_inheritance.c @@ -46,7 +46,7 @@ static void copy_entities_from_superclass(type *clss, void *env) int overwritten; type *super, *inhenttype; entity *inhent, *thisent; - mangle_inherited_name_func *mfunc = (mangle_inherited_name_func *)env; + mangle_inherited_name_func *mfunc = *(mangle_inherited_name_func **)env; for(i = 0; i < get_class_n_supertypes(clss); i++) { super = get_class_supertype(clss, i); @@ -91,7 +91,7 @@ static void copy_entities_from_superclass(type *clss, void *env) void resolve_inheritance(mangle_inherited_name_func *mfunc) { if (!mfunc) mfunc = default_mangle_inherited_name; - class_walk_super2sub(copy_entities_from_superclass, NULL, (void *)mfunc); + class_walk_super2sub(copy_entities_from_superclass, NULL, (void *)&mfunc); } @@ -351,12 +351,15 @@ void compute_inh_transitive_closure(void) { type *tp = get_irp_type(i); if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */ int j, n_subtypes = get_class_n_subtypes(tp); - int has_unmarked_subtype = false; + int has_unmarked_subtype = 0; assert(get_type_visited(tp) < get_master_type_visited()-1); - for (j = 0; j < n_subtypes && !has_unmarked_subtype; ++j) { + for (j = 0; j < n_subtypes; ++j) { type *stp = get_class_subtype(tp, j); - if (type_not_visited(stp)) has_unmarked_subtype = true; + if (type_not_visited(stp)) { + has_unmarked_subtype = 1; + break; + } } /* This is a good starting point. */ @@ -372,12 +375,15 @@ void compute_inh_transitive_closure(void) { type *tp = get_irp_type(i); if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */ int j, n_supertypes = get_class_n_supertypes(tp); - int has_unmarked_supertype = false; + int has_unmarked_supertype = 0; assert(get_type_visited(tp) < get_master_type_visited()-1); - for (j = 0; j < n_supertypes && !has_unmarked_supertype; ++j) { + for (j = 0; j < n_supertypes; ++j) { type *stp = get_class_supertype(tp, j); - if (type_not_visited(stp)) has_unmarked_supertype = true; + if (type_not_visited(stp)) { + has_unmarked_supertype = 1; + break; + } } /* This is a good starting point. */