From e5ff5a223bcf4cc14aa1f451d33a7381e95ac084 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 16 Feb 2025 12:31:42 +0900 Subject: [PATCH] [qfcc] Fix copying of structs for block types I forgot to set the symbol type of the members and the number of symbols in the struct. Fixes the excessive initializers when writing to a block struct. Also ensure the type name has "tag " in it. --- tools/qfcc/source/glsl-declaration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/glsl-declaration.c b/tools/qfcc/source/glsl-declaration.c index cdd1cfca7..ecdf33de7 100644 --- a/tools/qfcc/source/glsl-declaration.c +++ b/tools/qfcc/source/glsl-declaration.c @@ -122,7 +122,7 @@ glsl_block_type (const type_t *type, const char *pre_tag) auto tag = save_string (va (0, "%s.%s", pre_tag, name)); type_t new = { .type = ev_invalid, - .name = tag, + .name = save_string (va (0, "tag %s", tag)), .meta = ty_struct, }; auto nt = find_type (&new); @@ -135,10 +135,12 @@ glsl_block_type (const type_t *type, const char *pre_tag) for (auto s = type->symtab->symbols; s; s = s->next) { auto ftype = glsl_block_type (s->type, tag); auto sym = new_symbol_type (s->name, ftype); + sym->sy_type = sy_offset; sym->offset = -1; sym->id = s->id; symtab_addsymbol (nt->symtab, sym); } + nt->symtab->count = type->symtab->count; return nt; } return type;