mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +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,
|
emit_structure (const char *name, int su, struct_def_t *defs, type_t *type,
|
||||||
void *data, storage_class_t storage)
|
void *data, storage_class_t storage)
|
||||||
{
|
{
|
||||||
type_t new;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
int saw_null = 0;
|
int saw_null = 0;
|
||||||
int saw_func = 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;
|
def_t field_def;
|
||||||
|
|
||||||
name = save_string (name);
|
name = save_string (name);
|
||||||
if (!type) {
|
if (!type)
|
||||||
memset (&new, 0, sizeof (new));
|
type = make_structure (0, su, defs, 0)->type;
|
||||||
type = &new;
|
|
||||||
type = make_structure (0, su, defs, type)->type;
|
|
||||||
}
|
|
||||||
if (!is_struct (type) || (su == 's' && type->ty != ty_struct)
|
if (!is_struct (type) || (su == 's' && type->ty != ty_struct)
|
||||||
|| (su == 'u' && type->ty != ty_union))
|
|| (su == 'u' && type->ty != ty_union))
|
||||||
internal_error (0, "structure %s type mismatch", name);
|
internal_error (0, "structure %s type mismatch", name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue