X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fabc.c;h=3b1db1d6946634ef23c24a51a1f85602c23aa0cf;hb=3fb75ef418267cb0f7370d365b3a37b8013fbee9;hp=a4f174d955ea3817a517aa6314c1f5423a5b6055;hpb=cdc086dfc22111a34d2f40308e8f066b89fc2398;p=swftools.git diff --git a/lib/as3/abc.c b/lib/as3/abc.c index a4f174d..3b1db1d 100644 --- a/lib/as3/abc.c +++ b/lib/as3/abc.c @@ -227,6 +227,7 @@ trait_t*trait_new(int type, multiname_t*name, int data1, int data2, constant_t*v trait->value = v; return trait; } + trait_t*trait_new_member(trait_list_t**traits, multiname_t*type, multiname_t*name,constant_t*v) { int kind = TRAIT_SLOT; @@ -236,8 +237,9 @@ trait_t*trait_new_member(trait_list_t**traits, multiname_t*type, multiname_t*nam trait->attributes = kind&0xf0; trait->name = name; trait->type_name = type; - - trait->slot_id = list_length_(traits)+1; + + trait->slot_id = list_length(*traits)+1; + trait_list_t*l = *traits; list_append_(traits, trait); return trait; } @@ -254,7 +256,7 @@ trait_t*trait_new_method(trait_list_t**traits, multiname_t*name, abc_method_t*m) /* start assigning traits at position #1. Weird things happen when assigning slot 0- slot 0 and 1 seem to be identical */ - trait->slot_id = list_length_(traits)+1; + trait->slot_id = list_length(*traits)+1; list_append_(traits, trait); return trait; } @@ -287,7 +289,7 @@ trait_t* abc_class_staticslot(abc_class_t*cls, multiname_t*name, multiname_t*typ abc_file_t*file = cls->file; multiname_t*m_name = multiname_clone(name); multiname_t*m_type = multiname_clone(type); - trait_t*t = trait_new_member(&cls->traits, m_type, m_name, 0); + trait_t*t = trait_new_member(&cls->static_traits, m_type, m_name, 0); return t; }