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);
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);

View File

@ -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");

View File

@ -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;

View File

@ -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);

View File

@ -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;