Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
? hlsl_sprintf_alloc(ctx, atan2_header_template,
type->name, type->name, type->name,
type->name, type->name)
: hlsl_sprintf_alloc(ctx, atan_header_template,
type->name, type->name,
type->name, type->name);
- if (!header)
return false;
- if (!(body = hlsl_sprintf_alloc(ctx, body_template,
type->name, type->name, type->name, type->name, type->name)))
return false;
- if (!(whole_fn = hlsl_sprintf_alloc(ctx, "%s%s",
header, body)))
return false;
This is not wrong either, but we have a better tool for that, which is `vkd3d_string_buffer_printf()` (and companions).
Also, notice that the `if` continuation line should be indented 8 spaces, not 4.