mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Put another bandaid on the type creation system.
It seems that building types is very fragile: all too easy to fix things in one place and break something somewhere else. I guess the type system will need a comlete rewrite at some stage.
This commit is contained in:
parent
e3325b199e
commit
c139099294
1 changed files with 2 additions and 6 deletions
|
@ -215,7 +215,6 @@ def_t *
|
|||
emit_structure (const char *name, int su, struct_def_t *defs, type_t *type,
|
||||
void *data, storage_class_t storage)
|
||||
{
|
||||
type_t new;
|
||||
int i, j;
|
||||
int saw_null = 0;
|
||||
int saw_func = 0;
|
||||
|
@ -225,11 +224,8 @@ emit_structure (const char *name, int su, struct_def_t *defs, type_t *type,
|
|||
def_t field_def;
|
||||
|
||||
name = save_string (name);
|
||||
if (!type) {
|
||||
memset (&new, 0, sizeof (new));
|
||||
type = &new;
|
||||
type = make_structure (0, su, defs, type)->type;
|
||||
}
|
||||
if (!type)
|
||||
type = make_structure (0, su, defs, 0)->type;
|
||||
if (!is_struct (type) || (su == 's' && type->ty != ty_struct)
|
||||
|| (su == 'u' && type->ty != ty_union))
|
||||
internal_error (0, "structure %s type mismatch", name);
|
||||
|
|
Loading…
Reference in a new issue