d'oh, forgot to compile test :P

This commit is contained in:
Bill Currie 2002-06-05 19:31:43 +00:00
parent cb395c5469
commit 38d3a15413
5 changed files with 10 additions and 10 deletions

View file

@ -205,7 +205,7 @@ emit_assign_expr (int oper, expr_t *e)
def_a = emit_sub_expr (e1, 0); def_a = emit_sub_expr (e1, 0);
if (def_a->constant) { if (def_a->constant) {
if (options.code.cow) { 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); int ofs = PR_NewLocation (def_a->type);
memcpy (pr.globals + ofs, pr.globals + def_a->ofs, size); memcpy (pr.globals + ofs, pr.globals + def_a->ofs, size);

View file

@ -1990,14 +1990,14 @@ init_elements (def_t *def, expr_t *eles)
} else if (e->type >= ex_string) { } else if (e->type >= ex_string) {
if (get_type (e) != def->type->aux_type) { if (get_type (e) != def->type->aux_type) {
error (e, "type mismatch in initializer"); error (e, "type mismatch in initializer");
g += type_size (def->type->aux_type->type); g += type_size (def->type->aux_type);
} else { } else {
if (e->type == ex_string) { if (e->type == ex_string) {
*(int*)g = ReuseString (e->e.string_val); *(int*)g = ReuseString (e->e.string_val);
} else { } 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 { } else {
error (e, "non-constant initializer"); error (e, "non-constant initializer");

View file

@ -229,7 +229,7 @@ finish_function (function_t *f)
if ((count = df->numparms) < 0) if ((count = df->numparms) < 0)
count = -count - 1; count = -count - 1;
for (i = 0; i < count; i++) 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) { if (f->aux) {
def_t *def; def_t *def;

View file

@ -284,7 +284,7 @@ ReuseConstant (expr_t *expr, def_t *def)
if (e.type == ex_string) if (e.type == ex_string)
e.e.integer_val = ReuseString (rep->str); 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); Hash_Add (tab, cn);

View file

@ -267,7 +267,7 @@ PR_NewLocation (type_t *type)
void void
PR_FreeLocation (def_t *def) PR_FreeLocation (def_t *def)
{ {
int size = type_size (def->type->type); int size = type_size (def->type);
locref_t *loc; locref_t *loc;
if (!free_free_locs) { if (!free_free_locs) {
@ -288,7 +288,7 @@ PR_FreeLocation (def_t *def)
def_t * def_t *
PR_GetTempDef (type_t *type, def_t *scope) PR_GetTempDef (type_t *type, def_t *scope)
{ {
int size = type_size (type->type); int size = type_size (type);
def_t *def; def_t *def;
if (free_temps[size]) { if (free_temps[size]) {
@ -298,7 +298,7 @@ PR_GetTempDef (type_t *type, def_t *scope)
} else { } else {
def = PR_NewDef (type, 0, scope); def = PR_NewDef (type, 0, scope);
def->ofs = *scope->alloc; def->ofs = *scope->alloc;
*scope->alloc += type_size (size); *scope->alloc += size;
} }
def->freed = def->removed = def->users = 0; def->freed = def->removed = def->users = 0;
def->next = temp_scope.next; 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, 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->line, pr_type_name[d->type->type], d->ofs, d->users,
d->managed); d->managed);
size = type_size (d->type->type); size = type_size (d->type);
if (d->expr) if (d->expr)
d->expr->e.temp.def = 0; d->expr->e.temp.def = 0;