From cb631739b0d89e12cd6ec9ab58aa6f5f89079862 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Mon, 5 Aug 2024 13:49:58 +0200 Subject: [PATCH] chore(ci): Run workflow with clang on windows (#68) * chore(ci): Run workflow with clang on windows * fix compilation issue --- .github/workflows/validate.yml | 5 ++++- src/render/rt64_render_target.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f3a87c0..824e973 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -67,5 +67,8 @@ jobs: set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors - cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build + # remove LLVM from PATH so it doesn't overshadow the one provided by VS + $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';' + + cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $cpuCores diff --git a/src/render/rt64_render_target.cpp b/src/render/rt64_render_target.cpp index e62bb48..a23da72 100644 --- a/src/render/rt64_render_target.cpp +++ b/src/render/rt64_render_target.cpp @@ -424,7 +424,7 @@ namespace RT64 { scaledWidth = uint32_t(expandedColorWidthClamped); scaledHeight = uint32_t(colorHeightClamped); - const long expandedPixels = std::labs(scaledWidth - nativeColorWidthClamped) / 2; + const long expandedPixels = std::labs(long(scaledWidth) - nativeColorWidthClamped) / 2; const long nativeAlignment = std::max(lround(resolutionScale.y), 1L); misalignmentX = (nativeAlignment - (expandedPixels % nativeAlignment)) % nativeAlignment; }