diff --git a/libs/video/renderer/vulkan/vkgen/vkstruct.r b/libs/video/renderer/vulkan/vkgen/vkstruct.r index 3c111b94a..85309f011 100644 --- a/libs/video/renderer/vulkan/vkgen/vkstruct.r +++ b/libs/video/renderer/vulkan/vkgen/vkstruct.r @@ -157,46 +157,47 @@ [field_def writeParseData]; } if (!readonly) { - fprintf (output_file, "static plfield_t %s_fields[] = {\n", [self outname]); - fprintf (output_file, - "\t{\"@inherit\", 0, QFString, parse_inherit, &%s_fields},\n", - [self outname]); - if (have_pNext) { + fprintf (output_file, "static plfield_t %s_fields[] = {\n", + [self outname]); fprintf (output_file, - "\t{\"@next\", field_offset (%s, pNext), " - "QFArray, parse_next, 0},", [self outname]); - } - for (int i = [field_defs count]; i-- > 0; ) { - FieldDef *field_def = [field_defs objectAtIndex:i]; - [field_def writeField]; - } - fprintf (output_file, "\t{ }\n"); - fprintf (output_file, "};\n"); - - fprintf (output_file, "static int %s (const plfield_t *field," - " const plitem_t *item, void *data, plitem_t *messages," - " void *context)\n", - [self parseFunc]); - fprintf (output_file, "{\n"); - if (have_sType) { - fprintf (output_file, "\t((%s *) data)->sType", [self outname]); - fprintf (output_file, " = %s;\n", [self sTypeName]); - } - fprintf (output_file, - "\tif (PL_Type (item) == QFString\n" - "\t\t&& !(item = parse_reference (item, \"%s\", messages, context))) {\n" - "\t\treturn 0;\n" - "\t}\n" - "\treturn PL_ParseStruct (%s_fields, item, data, messages," - " context);\n", - [self outname], [self outname]); - fprintf (output_file, "}\n"); + "\t{\"@inherit\", 0, QFString, parse_inherit, &%s_fields},\n", + [self outname]); if (have_pNext) { - fprintf (output_file, "static parserref_t %s_parser = ", - [self outname]); - fprintf (output_file, "{\"%s\", %s, sizeof(%s)};\n", - [self outname], [self parseFunc], [self outname]); + fprintf (output_file, + "\t{\"@next\", field_offset (%s, pNext), " + "QFArray, parse_next, 0},", [self outname]); } + for (int i = [field_defs count]; i-- > 0; ) { + FieldDef *field_def = [field_defs objectAtIndex:i]; + [field_def writeField]; + } + fprintf (output_file, "\t{ }\n"); + fprintf (output_file, "};\n"); + + fprintf (output_file, "static int %s (const plfield_t *field," + " const plitem_t *item, void *data, plitem_t *messages," + " void *context)\n", + [self parseFunc]); + fprintf (output_file, "{\n"); + if (have_sType) { + fprintf (output_file, "\t((%s *) data)->sType", [self outname]); + fprintf (output_file, " = %s;\n", [self sTypeName]); + } + fprintf (output_file, + "\tif (PL_Type (item) == QFString\n" + "\t\t&& !(item = parse_reference (item, \"%s\", messages, context))) {\n" + "\t\treturn 0;\n" + "\t}\n" + "\treturn PL_ParseStruct (%s_fields, item, data, messages," + " context);\n", + [self outname], [self outname]); + fprintf (output_file, "}\n"); + if (have_pNext) { + fprintf (output_file, "static parserref_t %s_parser = ", + [self outname]); + fprintf (output_file, "{\"%s\", %s, sizeof(%s)};\n", + [self outname], [self parseFunc], [self outname]); + } } fprintf (output_file, "static exprsym_t %s_symbols[] = {\n", [self outname]);