From: kramm Date: Mon, 24 Nov 2008 16:12:24 +0000 (+0000) Subject: refactoring: renamed 'pool' variables to 'file' X-Git-Tag: release-0-9-0~769 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=1042606c080e543c2c03e0c16cc593c6f156f539 refactoring: renamed 'pool' variables to 'file' --- diff --git a/lib/as3/abc.c b/lib/as3/abc.c index 70e67ac..b37dea8 100644 --- a/lib/as3/abc.c +++ b/lib/as3/abc.c @@ -136,12 +136,12 @@ abc_file_t*abc_file_new() #define CLASS_INTERFACE 4 #define CLASS_PROTECTED_NS 8 -abc_class_t* abc_class_new(abc_file_t*pool, multiname_t*classname, multiname_t*superclass) { +abc_class_t* abc_class_new(abc_file_t*file, multiname_t*classname, multiname_t*superclass) { NEW(abc_class_t,c); - array_append(pool->classes, NO_KEY, c); + array_append(file->classes, NO_KEY, c); - c->pool = pool; + c->file = file; c->classname = classname; c->superclass = superclass; c->flags = 0; @@ -177,18 +177,18 @@ void abc_class_add_interface(abc_class_t*c, multiname_t*interface) list_append(c->interfaces, interface); } -abc_method_body_t* add_method(abc_file_t*pool, abc_class_t*cls, char*returntype, int num_params, va_list va) +abc_method_body_t* add_method(abc_file_t*file, abc_class_t*cls, char*returntype, int num_params, va_list va) { /* construct code (method body) object */ NEW(abc_method_body_t,c); - array_append(pool->method_bodies, NO_KEY, c); - c->pool = pool; + array_append(file->method_bodies, NO_KEY, c); + c->file = file; c->traits = list_new(); c->code = 0; /* construct method object */ NEW(abc_method_t,m); - array_append(pool->methods, NO_KEY, m); + array_append(file->methods, NO_KEY, m); if(returntype && strcmp(returntype, "void")) { m->return_type = multiname_fromstring(returntype); @@ -212,7 +212,7 @@ abc_method_body_t* abc_class_constructor(abc_class_t*cls, char*returntype, int n { va_list va; va_start(va, num_params); - abc_method_body_t* c = add_method(cls->pool, cls, returntype, num_params, va); + abc_method_body_t* c = add_method(cls->file, cls, returntype, num_params, va); va_end(va); cls->constructor = c->method; return c; @@ -222,7 +222,7 @@ abc_method_body_t* abc_class_staticconstructor(abc_class_t*cls, char*returntype, { va_list va; va_start(va, num_params); - abc_method_body_t* c = add_method(cls->pool, cls, returntype, num_params, va); + abc_method_body_t* c = add_method(cls->file, cls, returntype, num_params, va); va_end(va); cls->static_constructor = c->method; return c; @@ -255,10 +255,10 @@ trait_t*trait_new_method(multiname_t*name, abc_method_t*m) abc_method_body_t* abc_class_method(abc_class_t*cls, char*returntype, char*name, int num_params, ...) { - abc_file_t*pool = cls->pool; + abc_file_t*file = cls->file; va_list va; va_start(va, num_params); - abc_method_body_t* c = add_method(cls->pool, cls, returntype, num_params, va); + abc_method_body_t* c = add_method(cls->file, cls, returntype, num_params, va); va_end(va); list_append(cls->traits, trait_new_method(multiname_fromstring(name), c->method)); return c; @@ -266,14 +266,14 @@ abc_method_body_t* abc_class_method(abc_class_t*cls, char*returntype, char*name, void abc_AddSlot(abc_class_t*cls, char*name, int slot, char*multiname) { - abc_file_t*pool = cls->pool; + abc_file_t*file = cls->file; multiname_t*m = multiname_fromstring(multiname); list_append(cls->traits, trait_new(TRAIT_SLOT, m, slot, 0, 0, 0)); } void abc_method_body_addClassTrait(abc_method_body_t*code, char*multiname, int slotid, abc_class_t*cls) { - abc_file_t*pool = code->pool; + abc_file_t*file = code->file; multiname_t*m = multiname_fromstring(multiname); trait_t*trait = trait_new(TRAIT_CLASS, m, slotid, 0, 0, 0); trait->cls = cls; @@ -284,23 +284,23 @@ void abc_method_body_addClassTrait(abc_method_body_t*code, char*multiname, int s and traits of the init script are *not* the same thing */ void abc_initscript_addClassTrait(abc_script_t*script, char*multiname, int slotid, abc_class_t*cls) { - abc_file_t*pool = script->pool; + abc_file_t*file = script->file; multiname_t*m = multiname_fromstring(multiname); trait_t*trait = trait_new(TRAIT_CLASS, m, slotid, 0, 0, 0); trait->cls = cls; list_append(script->traits, trait); } -abc_script_t* abc_initscript(abc_file_t*pool, char*returntype, int num_params, ...) +abc_script_t* abc_initscript(abc_file_t*file, char*returntype, int num_params, ...) { va_list va; va_start(va, num_params); - abc_method_body_t* c = add_method(pool, 0, returntype, num_params, va); + abc_method_body_t* c = add_method(file, 0, returntype, num_params, va); abc_script_t* s = malloc(sizeof(abc_script_t)); s->method = c->method; s->traits = list_new(); - s->pool = pool; - array_append(pool->scripts, NO_KEY, s); + s->file = file; + array_append(file->scripts, NO_KEY, s); va_end(va); return s; } diff --git a/lib/as3/abc.h b/lib/as3/abc.h index cfa48b0..f74a459 100644 --- a/lib/as3/abc.h +++ b/lib/as3/abc.h @@ -92,7 +92,7 @@ struct _trait { }; struct _abc_class { - abc_file_t*pool; + abc_file_t*file; multiname_t*classname; multiname_t*superclass; @@ -111,8 +111,8 @@ struct _abc_class { int index; //filled in during writing }; -abc_class_t* abc_class_new(abc_file_t*pool, multiname_t*classname, multiname_t*superclass); -abc_class_t* abc_class_new2(abc_file_t*pool, char*classname, char*superclass); +abc_class_t* abc_class_new(abc_file_t*file, multiname_t*classname, multiname_t*superclass); +abc_class_t* abc_class_new2(abc_file_t*file, char*classname, char*superclass); void abc_class_sealed(abc_class_t*c); void abc_class_final(abc_class_t*c); void abc_class_interface(abc_class_t*c); @@ -132,7 +132,7 @@ struct _exception { }; struct _abc_method_body { - abc_file_t*pool; + abc_file_t*file; //abc_class_t*cls; abc_method_t*method; code_t*code; @@ -151,13 +151,12 @@ struct _abc_method_body { typedef struct _abc_script { abc_method_t*method; - abc_file_t*pool; + abc_file_t*file; trait_list_t*traits; } abc_script_t; abc_method_t* abc_nullmethod(abc_file_t*file); - -abc_script_t* abc_initscript(abc_file_t*pool, char*returntype, int num_params, ...); +abc_script_t* abc_initscript(abc_file_t*file, char*returntype, int num_params, ...); #define __