From c10a551c8484dd495b05dcc8f109e9b553e6b81b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 24 Feb 2011 13:07:36 +0900 Subject: [PATCH] Rename new_defspace() and defspace_new_loc(). --- tools/qfcc/include/defspace.h | 4 ++-- tools/qfcc/source/def.c | 2 +- tools/qfcc/source/defspace.c | 6 +++--- tools/qfcc/source/function.c | 2 +- tools/qfcc/source/immediate.c | 2 +- tools/qfcc/source/linker.c | 8 ++++---- tools/qfcc/source/obj_type.c | 2 +- tools/qfcc/source/qfcc.c | 18 +++++++++--------- tools/qfcc/source/stub.c | 1 - 9 files changed, 22 insertions(+), 23 deletions(-) diff --git a/tools/qfcc/include/defspace.h b/tools/qfcc/include/defspace.h index aeff17bf4..89e1f186b 100644 --- a/tools/qfcc/include/defspace.h +++ b/tools/qfcc/include/defspace.h @@ -47,8 +47,8 @@ typedef struct defspace_s { int qfo_space; } defspace_t; -defspace_t *new_defspace (void); -int defspace_new_loc (defspace_t *space, int size); +defspace_t *defspace_new (void); +int defspace_alloc_loc (defspace_t *space, int size); void defspace_free_loc (defspace_t *space, int ofs, int size); int defspace_add_data (defspace_t *space, pr_type_t *data, int size); diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 30e1aeb79..f388dc33e 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -130,7 +130,7 @@ new_def (const char *name, type_t *type, defspace_t *space, error (0, "%s has incomplete type", name); size = 1; } - def->offset = defspace_new_loc (space, size); + def->offset = defspace_alloc_loc (space, size); } return def; diff --git a/tools/qfcc/source/defspace.c b/tools/qfcc/source/defspace.c index d282b24b2..ab7289243 100644 --- a/tools/qfcc/source/defspace.c +++ b/tools/qfcc/source/defspace.c @@ -78,7 +78,7 @@ grow_space (defspace_t *space) } defspace_t * -new_defspace (void) +defspace_new (void) { defspace_t *space; @@ -89,7 +89,7 @@ new_defspace (void) } int -defspace_new_loc (defspace_t *space, int size) +defspace_alloc_loc (defspace_t *space, int size) { int ofs; locref_t *loc; @@ -180,7 +180,7 @@ defspace_add_data (defspace_t *space, pr_type_t *data, int size) { int loc; - loc = defspace_new_loc (space, size); + loc = defspace_alloc_loc (space, size); if (data) memcpy (space->data + loc, data, size * sizeof (pr_type_t)); return loc; diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index e0bde9b94..3023f39d9 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -450,7 +450,7 @@ build_scope (symbol_t *fsym, symtab_t *parent) symtab = new_symtab (parent, stab_local); fsym->s.func->symtab = symtab; - symtab->space = new_defspace (); + symtab->space = defspace_new (); current_symtab = symtab; if (fsym->type->t.func.num_params < 0) { diff --git a/tools/qfcc/source/immediate.c b/tools/qfcc/source/immediate.c index e9105f149..df56f6d6e 100644 --- a/tools/qfcc/source/immediate.c +++ b/tools/qfcc/source/immediate.c @@ -253,7 +253,7 @@ emit_value (ex_value_t *value, def_t *def) } } else { cn = new_def (".imm", type, pr.near_data, st_static); - cn->offset = defspace_new_loc (pr.near_data, type_size (type)); + cn->offset = defspace_alloc_loc (pr.near_data, type_size (type)); } cn->initialized = cn->constant = 1; cn->nosave = 1; diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index a8bec97e2..56b5637e5 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -267,10 +267,10 @@ linker_begin (void) // the actual space data work_strings = strpool_new (); work_code = codespace_new (); - work_near_data = new_defspace(); - work_far_data = new_defspace(); - work_entity_data = new_defspace(); - work_type_data = new_defspace(); + work_near_data = defspace_new (); + work_far_data = defspace_new (); + work_entity_data = defspace_new (); + work_type_data = defspace_new (); } static void diff --git a/tools/qfcc/source/obj_type.c b/tools/qfcc/source/obj_type.c index 0414c61bf..1b7cbdf38 100644 --- a/tools/qfcc/source/obj_type.c +++ b/tools/qfcc/source/obj_type.c @@ -86,7 +86,7 @@ qfo_new_encoding (type_t *type, int size) size /= sizeof (pr_type_t); def = new_def (type->encoding, 0, pr.type_data, st_static); - def->offset = defspace_new_loc (pr.type_data, size); + def->offset = defspace_alloc_loc (pr.type_data, size); enc = D_POINTER (qfot_type_t, def); enc->ty = type->ty; diff --git a/tools/qfcc/source/qfcc.c b/tools/qfcc/source/qfcc.c index c059ff37c..2d066c4ce 100644 --- a/tools/qfcc/source/qfcc.c +++ b/tools/qfcc/source/qfcc.c @@ -136,22 +136,22 @@ InitData (void) pr.strings = strpool_new (); pr.num_functions = 1; - pr.data = new_defspace (); + pr.data = defspace_new (); - pr.far_data = new_defspace (); + pr.far_data = defspace_new (); - pr.near_data = new_defspace (); + pr.near_data = defspace_new (); pr.near_data->data = calloc (65536, sizeof (pr_type_t)); pr.near_data->max_size = 65536; pr.near_data->grow = 0; - pr.type_data = new_defspace (); - defspace_new_loc (pr.type_data, 4); // reserve space for a null descriptor + pr.type_data = defspace_new (); + defspace_alloc_loc (pr.type_data, 4);// reserve space for a null descriptor pr.symtab = new_symtab (0, stab_global); pr.symtab->space = pr.near_data; - pr.entity_data = new_defspace (); + pr.entity_data = defspace_new (); numglobaldefs = 1; numfielddefs = 1; @@ -434,8 +434,8 @@ finish_compilation (void) } df->parm_start = pr.near_data->size; } else { - df->parm_start = defspace_new_loc (pr.near_data, - f->symtab->space->size); + df->parm_start = defspace_alloc_loc (pr.near_data, + f->symtab->space->size); num_localdefs += f->symtab->space->size; } for (def = f->symtab->space->defs; def; def = def->next) { @@ -445,7 +445,7 @@ finish_compilation (void) } } if (options.code.local_merging) - defspace_new_loc (pr.near_data, num_localdefs); + defspace_alloc_loc (pr.near_data, num_localdefs); if (options.code.progsversion != PROG_ID_VERSION) { //FIXME better init code diff --git a/tools/qfcc/source/stub.c b/tools/qfcc/source/stub.c index a2baf2d25..0c8fcf146 100644 --- a/tools/qfcc/source/stub.c +++ b/tools/qfcc/source/stub.c @@ -21,7 +21,6 @@ options_t options; int num_linenos; pr_lineno_t *linenos; pr_info_t pr; -defspace_t *new_defspace (void) {return 0;} string_t ReuseString (const char *str) {return 0;} void encode_type (struct dstring_s *str, type_t *type) {} codespace_t *codespace_new (void) {return 0;}