finally get around to renaming type_name to pr_type_name

This commit is contained in:
Bill Currie 2001-12-12 17:15:09 +00:00
parent cc34e5954f
commit f9149a0d6c
6 changed files with 14 additions and 13 deletions

View file

@ -45,7 +45,7 @@ typedef enum {
} etype_t;
extern int pr_type_size[ev_type_count];
extern const char *type_name[ev_type_count];
extern const char *pr_type_name[ev_type_count];
#define OFS_NULL 0
#define OFS_RETURN 1

View file

@ -73,7 +73,7 @@ int pr_type_size[ev_type_count] = {
1, // variable
};
const char *type_name[ev_type_count] = {
const char *pr_type_name[ev_type_count] = {
"void",
"string",
"float",
@ -1398,6 +1398,7 @@ PR_AccessField (progs_t *pr, const char *name, etype_t type,
PR_Error (pr, "undefined field %s accessed at %s:%d", name, file, line);
if (def->type != type)
PR_Error (pr, "bad type access to %s as %s (should be %s) at %s:%d",
name, type_name[type], type_name[def->type], file, line);
name, pr_type_name[type], pr_type_name[def->type],
file, line);
return def->ofs;
}

View file

@ -275,7 +275,7 @@ type_mismatch (expr_t *e1, expr_t *e2, int op)
t2 = extract_type (e2);
return error (e1, "type mismatch: %s %s %s",
type_name[t1], get_op_string (op), type_name[t2]);
pr_type_name[t1], get_op_string (op), pr_type_name[t2]);
}
void
@ -510,7 +510,7 @@ print_expr (expr_t *e)
} else {
printf ("<>");
}
printf (":%s:%d)@", type_name[e->e.temp.type->type],
printf (":%s:%d)@", pr_type_name[e->e.temp.type->type],
e->e.temp.users);
break;
case ex_nil:
@ -535,7 +535,7 @@ print_expr (expr_t *e)
printf (" %g'", e->e.quaternion_val[3]);
break;
case ex_pointer:
printf ("(%s)[%d]", type_name[e->e.pointer.type->type],
printf ("(%s)[%d]", pr_type_name[e->e.pointer.type->type],
e->e.pointer.val);
break;
case ex_entity:
@ -1714,7 +1714,7 @@ assign_expr (expr_t *e1, expr_t *e2)
type = t1;
//print_expr (e1); printf(" %d\n", e1->line);
//print_expr (e2); printf("\n");
//printf ("%s %s\n", type_name[t1->type], type_name[t2->type]);
//printf ("%s %s\n", pr_type_name[t1->type], pr_type_name[t2->type]);
if (is_indirect (e1) && is_indirect (e2)) {
expr_t *temp = new_temp_def_expr (t1);

View file

@ -300,7 +300,7 @@ PR_FreeTempDefs (void)
if (d->users < 0)
printf ("%s:%d: warning: %s %3d %3d\n", strings + d->file,
d->line, type_name[d->type->type], d->ofs, d->users);
d->line, pr_type_name[d->type->type], d->ofs, d->users);
size = pr_type_size[d->type->type];
if (d->expr)
d->expr->e.temp.def = 0;
@ -328,7 +328,7 @@ PR_ResetTempDefs (void)
for (d = temp_scope.next; d; d = d->next)
printf ("%s:%d: warning: %s %3d %3d\n", strings + d->file, d->line,
type_name[d->type->type], d->ofs, d->users);
pr_type_name[d->type->type], d->ofs, d->users);
temp_scope.next = 0;
}

View file

@ -82,8 +82,8 @@ fix_missing_globals (progs_t *pr, def_t *globals)
fprintf (stderr,
"global def %s at %d has mismatched type (%s, %s)\n",
def->name, def->offset,
type_name[def->type & ~DEF_SAVEGLOBAL],
type_name[d->type & ~DEF_SAVEGLOBAL]);
pr_type_name[def->type & ~DEF_SAVEGLOBAL],
pr_type_name[d->type & ~DEF_SAVEGLOBAL]);
exit (1);
}
if (strcmp (def->name, PR_GetString (pr, d->s_name)) == 0)

View file

@ -122,14 +122,14 @@ main ()
for (i = 0; i < progs.progs->numglobaldefs; i++) {
ddef_t *def = &progs.pr_globaldefs[i];
printf ("%s %d %d %s\n", type_name[def->type & ~DEF_SAVEGLOBAL], (def->type & DEF_SAVEGLOBAL) != 0, def->ofs, PR_GetString (&progs, def->s_name));
printf ("%s %d %d %s\n", pr_type_name[def->type & ~DEF_SAVEGLOBAL], (def->type & DEF_SAVEGLOBAL) != 0, def->ofs, PR_GetString (&progs, def->s_name));
}
printf ("\n");
#if 0
for (i = 0; i < progs.progs->numfielddefs; i++) {
ddef_t *def = &progs.pr_fielddefs[i];
printf ("%s %d %d %s\n", type_name[def->type & ~DEF_SAVEGLOBAL], (def->type & DEF_SAVEGLOBAL) != 0, def->ofs, PR_GetString (&progs, def->s_name));
printf ("%s %d %d %s\n", pr_type_name[def->type & ~DEF_SAVEGLOBAL], (def->type & DEF_SAVEGLOBAL) != 0, def->ofs, PR_GetString (&progs, def->s_name));
}
printf ("\n");
#endif