From e9b6aa2b62432058f4549e817ea07b6caec87562 Mon Sep 17 00:00:00 2001 From: Damyan Pepper Date: Fri, 3 Apr 2026 11:10:27 -0700 Subject: [PATCH 1/2] Fix signed/unsigned mismatch in LinAlgTests.cpp Change loop variables from int32_t to size_t to match the NumElements parameter type (size_t), fixing C4018 warnings treated as errors in x86 builds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tools/clang/unittests/HLSLExec/LinAlgTests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index a6b0dc1977..96f4aa883b 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -226,7 +226,7 @@ static VariantCompType makeExpected(ComponentType CompType, size_t NumElements, switch (CompType) { case ComponentType::F32: { std::vector Floats(NumElements); - for (int32_t I = 0; I < NumElements; I++) + for (size_t I = 0; I < NumElements; I++) Floats[I] = StartingVal + static_cast(Increment ? I : 0); return Floats; } @@ -234,13 +234,13 @@ static VariantCompType makeExpected(ComponentType CompType, size_t NumElements, DXASSERT(StartingVal < static_cast(INT_MAX), "Value too large to cast to int32_t"); std::vector Ints(NumElements); - for (int32_t I = 0; I < NumElements; I++) - Ints[I] = static_cast(StartingVal) + (Increment ? I : 0); + for (size_t I = 0; I < NumElements; I++) + Ints[I] = static_cast(StartingVal) + static_cast(Increment ? I : 0); return Ints; } case ComponentType::F16: { std::vector Halfs(NumElements); - for (int32_t I = 0; I < NumElements; I++) { + for (size_t I = 0; I < NumElements; I++) { // Downcasting is safe here since HLSLHalf_t will clamp if F is too large. float F = StartingVal + static_cast(Increment ? I : 0); Halfs[I] = HLSLHalf_t(F); From 5128696d981cc899f357807588fa2fe1bf71af4a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 3 Apr 2026 19:10:37 +0000 Subject: [PATCH 2/2] chore: autopublish 2026-04-03T19:10:36Z --- tools/clang/unittests/HLSLExec/LinAlgTests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp index 96f4aa883b..3ab1ac1df8 100644 --- a/tools/clang/unittests/HLSLExec/LinAlgTests.cpp +++ b/tools/clang/unittests/HLSLExec/LinAlgTests.cpp @@ -235,7 +235,8 @@ static VariantCompType makeExpected(ComponentType CompType, size_t NumElements, "Value too large to cast to int32_t"); std::vector Ints(NumElements); for (size_t I = 0; I < NumElements; I++) - Ints[I] = static_cast(StartingVal) + static_cast(Increment ? I : 0); + Ints[I] = static_cast(StartingVal) + + static_cast(Increment ? I : 0); return Ints; } case ComponentType::F16: {