X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fmklib.c;h=8ef8fe7669f7d153006f51dc753fb5d638113d50;hb=91f2889c15fa9cd7290b840beae49218131b5636;hp=27412449b13bf207a8e4f9289058cf57f9853e47;hpb=f9b5acf2c746ef6d9751b8f46185e617b6017611;p=swftools.git diff --git a/lib/as3/mklib.c b/lib/as3/mklib.c index 2741244..8ef8fe7 100644 --- a/lib/as3/mklib.c +++ b/lib/as3/mklib.c @@ -125,18 +125,18 @@ void write_member_info(FILE*fi, char*parent, char*id2, const char*name, int flag retvalue = 0; } //fallthrough case TRAIT_FUNCTION: - type = "MEMBER_METHOD"; + type = "INFOTYPE_METHOD"; break; case TRAIT_CONST: case TRAIT_GETTER: case TRAIT_SETTER: case TRAIT_SLOT: - type = "MEMBER_SLOT"; + type = "INFOTYPE_SLOT"; break; default: fprintf(stderr, "Unknown trait type %d\n", trait->kind); } - fprintf(fi, "static memberinfo_t %s = {%s, 0x%02x, \"%s\"", id2, type, flags, name); + fprintf(fi, "static memberinfo_t %s = {%s, 0x%02x, \"%s\"", type, flags, id2, name); if(!retvalue) fprintf(fi, ", 0"); else @@ -147,22 +147,13 @@ void write_member_info(FILE*fi, char*parent, char*id2, const char*name, int flag else fprintf(fi, ", &%s", parent); // parent - fprintf(fi, "};\n"); + fprintf(fi, ", 0,0,0};\n"); } int access2flags(multiname_t*m) { int access = m->ns->access; int flags=0; - if(access == ACCESS_PACKAGE) flags|=FLAG_PUBLIC; - if(access == ACCESS_PRIVATE) flags|=FLAG_PRIVATE; - if(access == ACCESS_PROTECTED) flags|=FLAG_PROTECTED; - if(access == ACCESS_PACKAGEINTERNAL) flags|=FLAG_PACKAGEINTERNAL; - if(access == ACCESS_NAMESPACE) { - if(!strcmp(m->ns->name, "http://adobe.com/AS3/2006/builtin")) { - flags|=FLAG_NAMESPACE_ADOBE; - } - } return flags; } @@ -224,11 +215,11 @@ void load_libraries(char*filename, int pass, FILE*fi) fprintf(fi, "static classinfo_t %s;\n", id); } else if(pass==1) { fprintf(fi, "static classinfo_t %s = {0x%02x, 0x%02x, \"%s\", \"%s\"", id, access, flags, package, name); - fprintf(fi, ", 0"); //slot + fprintf(fi, ", (void*)0"); //slot if(superid) fprintf(fi, ", &%s, interfaces:{", superid); else - fprintf(fi, ", 0, {"); + fprintf(fi, ", (void*)0, interfaces:{"); if(cls->interfaces) { multiname_list_t*i=cls->interfaces; while(i) { @@ -237,7 +228,7 @@ void load_libraries(char*filename, int pass, FILE*fi) i = i->next; } } - fprintf(fi, "0}};\n"); + fprintf(fi, "(void*)0}};\n"); } else if(pass==2) { trait_list_t*l=cls->traits; fprintf(fi, " dict_put(d, &%s, &%s);\n", id, id); @@ -324,13 +315,13 @@ void load_libraries(char*filename, int pass, FILE*fi) int flags = FLAG_STATIC|access2flags(trait->name); NEW(memberinfo_t,m); char np = 0; - int clsflags = FLAG_STATIC | FLAG_METHOD; + int clsflags = FLAG_STATIC; if(pass==0) { fprintf(fi, "static memberinfo_t %s;\n", id2); fprintf(fi, "static classinfo_t %s_class;\n", id2); } else if(pass==1) { write_member_info(fi, 0, id2, name, flags, trait); - fprintf(fi, "static classinfo_t %s_class = {0x%02x, 0x%02x, \"%s\", \"%s\", &%s, 0, members:{0}};\n", + fprintf(fi, "static classinfo_t %s_class = {0x%02x, 0x%02x, \"%s\", \"%s\", &%s, (void*)0, members:{(void*)0}};\n", id2, trait->name->ns->access, clsflags, package, name, @@ -374,7 +365,7 @@ int main() fprintf(fi, "dict_t* builtin_getclasses()\n"); fprintf(fi, "{\n"); - fprintf(fi, " dict_t*d = dict_new2(&classinfo_type);\n"); + fprintf(fi, " dict_t*d = dict_new2(&slotinfo_type);\n"); load_libraries("builtin.abc", 2, fi); load_libraries("playerglobal.abc", 2, fi); load_libraries("builtin.abc", 3, fi);