From 38d3a154130e60670ab6a501b9cb0347154d0191 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 5 Jun 2002 19:31:43 +0000 Subject: [PATCH] d'oh, forgot to compile test :P --- tools/qfcc/source/emit.c | 2 +- tools/qfcc/source/expr.c | 6 +++--- tools/qfcc/source/function.c | 2 +- tools/qfcc/source/immediate.c | 2 +- tools/qfcc/source/pr_def.c | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index dcdaff05a..c0c5cb854 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -205,7 +205,7 @@ emit_assign_expr (int oper, expr_t *e) def_a = emit_sub_expr (e1, 0); if (def_a->constant) { if (options.code.cow) { - int size = type_size (def_a->type->type); + int size = type_size (def_a->type); int ofs = PR_NewLocation (def_a->type); memcpy (pr.globals + ofs, pr.globals + def_a->ofs, size); diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 85cdcc0ef..1997cb7c4 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -1990,14 +1990,14 @@ init_elements (def_t *def, expr_t *eles) } else if (e->type >= ex_string) { if (get_type (e) != def->type->aux_type) { error (e, "type mismatch in initializer"); - g += type_size (def->type->aux_type->type); + g += type_size (def->type->aux_type); } else { if (e->type == ex_string) { *(int*)g = ReuseString (e->e.string_val); } else { - memcpy (g, &e->e, type_size (extract_type (e)) * 4); + memcpy (g, &e->e, type_size (get_type (e)) * 4); } - g += type_size (extract_type (e)); + g += type_size (get_type (e)); } } else { error (e, "non-constant initializer"); diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c index 56bf20aab..9b3aeac44 100644 --- a/tools/qfcc/source/function.c +++ b/tools/qfcc/source/function.c @@ -229,7 +229,7 @@ finish_function (function_t *f) if ((count = df->numparms) < 0) count = -count - 1; for (i = 0; i < count; i++) - df->parm_size[i] = type_size (f->def->type->parm_types[i]->type); + df->parm_size[i] = type_size (f->def->type->parm_types[i]); if (f->aux) { def_t *def; diff --git a/tools/qfcc/source/immediate.c b/tools/qfcc/source/immediate.c index 2e31194b8..1b9f1297d 100644 --- a/tools/qfcc/source/immediate.c +++ b/tools/qfcc/source/immediate.c @@ -284,7 +284,7 @@ ReuseConstant (expr_t *expr, def_t *def) if (e.type == ex_string) e.e.integer_val = ReuseString (rep->str); - memcpy (pr.globals + cn->ofs, &e.e, 4 * type_size (type->type)); + memcpy (pr.globals + cn->ofs, &e.e, 4 * type_size (type)); Hash_Add (tab, cn); diff --git a/tools/qfcc/source/pr_def.c b/tools/qfcc/source/pr_def.c index de99c1d01..f8f7ea6f6 100644 --- a/tools/qfcc/source/pr_def.c +++ b/tools/qfcc/source/pr_def.c @@ -267,7 +267,7 @@ PR_NewLocation (type_t *type) void PR_FreeLocation (def_t *def) { - int size = type_size (def->type->type); + int size = type_size (def->type); locref_t *loc; if (!free_free_locs) { @@ -288,7 +288,7 @@ PR_FreeLocation (def_t *def) def_t * PR_GetTempDef (type_t *type, def_t *scope) { - int size = type_size (type->type); + int size = type_size (type); def_t *def; if (free_temps[size]) { @@ -298,7 +298,7 @@ PR_GetTempDef (type_t *type, def_t *scope) } else { def = PR_NewDef (type, 0, scope); def->ofs = *scope->alloc; - *scope->alloc += type_size (size); + *scope->alloc += size; } def->freed = def->removed = def->users = 0; def->next = temp_scope.next; @@ -322,7 +322,7 @@ PR_FreeTempDefs (void) printf ("%s:%d: warning: %s %3d %3d %d\n", pr.strings + d->file, d->line, pr_type_name[d->type->type], d->ofs, d->users, d->managed); - size = type_size (d->type->type); + size = type_size (d->type); if (d->expr) d->expr->e.temp.def = 0;