From: Stefan Dösinger stefan@codeweavers.com
MSVC is too stupid to see it is unused when n_variants=0.
---
Note that there is a similar "error" in io_normaliser_add_index_range(). I have a work in progress implementation of vkd3d_unreachable and friends for MSVC that will take care of this. Sadly, it is on my other laptop that I left behind in Tanzania. --- libs/vkd3d-shader/hlsl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 5bca84ba..bddb622d 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -3119,8 +3119,8 @@ static void declare_predefined_types(struct hlsl_ctx *ctx)
for (bt = 0; bt <= HLSL_TYPE_LAST_SCALAR; ++bt) { - unsigned int n_variants = 0; - const char *const *variants; + const char* const* variants; + unsigned int n_variants;
switch (bt) { @@ -3140,6 +3140,8 @@ static void declare_predefined_types(struct hlsl_ctx *ctx) break;
default: + n_variants = 0; + variants = NULL; break; }