build: fix MSVC compilation errors in startup tests #3262

Manually merged
github merged 1 commit from github-bot/gh-3260 into gh-pr/3260/base 2026-11-28 02:46:40 +00:00 AGit
Owner

@⁠KelboLive on GitHub · 2026-11-28 02:29 UTC · original
KelboLive:fix-msvc-test-compilation → main · +27 −19 · 9 files · 1 commits · merged 2026-11-28 02:42 UTC

Fixes three categories of MSVC compilation errors in startup test files:

**@⁠KelboLive** on GitHub · 2026-11-28 02:29 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3260) `KelboLive:fix-msvc-test-compilation` → `main` · +27 −19 · 9 files · 1 commits · merged 2026-11-28 02:42 UTC Fixes three categories of MSVC compilation errors in startup test files:
Change const void* const* vtbl to void* const* vtbl in COM interface structs across 5 GameInput test files (13 occurrences). MSVC rejects reinterpret_cast from const void* through vtable function pointers.

Add static_cast<UINT> for sizeof expressions in rectlist_draw_check.cpp and startup_indirect_draw_indexed.cpp to fix C++11 narrowing errors.

Store D3D12_TEXTURE_COPY_LOCATION temporaries in named locals before passing their addresses to CopyTextureRegion in startup_resource_retire_*.cpp, fixing address-of-temporary warnings that MSVC treats as errors.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 02:34:14 +00:00
github-bot changed title from fix: MSVC compilation errors in startup tests to build: fix MSVC compilation errors in startup tests 2026-11-28 02:40:31 +00:00
github-bot changed target branch from main to gh-pr/3260/base 2026-11-28 02:46:39 +00:00
github manually merged commit f693f30c68 into gh-pr/3260/base 2026-11-28 02:46:40 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-28 02:42 UTC · original · approved these changes

Reviewed f693f30c68 integrated on main fdb6faaa (tree 485040c35b). The diff only changes the fixtures: named texture-copy locations preserve the original values and lifetime, size casts are on bounded test buffers, and the vtable declarations retain read-only entries and the same ABI.

With MSVC 19.51, a strict /permissive- /Zs check reproduced C2102 at the original texture-copy calls and passed after the change. This compiler accepted the old and new representative GameInput and rectangle sources; I could not reproduce those two reported build errors locally.

cmake --build <build> --target rectlist_draw_check startup_stub_gameinput startup_gameinput_contracts_check startup_gameinput_history startup_gameinput_keys startup_gameinput_script startup_gameinput_script_syntax startup_indirect_draw_indexed startup_resource_retire_title startup_resource_retire_views
ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^(startup_gameinput_(keys|history|contracts_check|script_.*)|rectlist_draw_(warp|hardware)|startup_indirect_(draw_indexed|translated_indexed_rect)_(warp|hardware)|startup_resource_retire_(title|views)_.*)$"

Debug and Release /O2 each had 25 passes and 1 skip. The GameInput syntax test passed its parser checks and skipped playback because XInput pad 0 was connected. The retiring-view debug0/debug1 cases passed on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 on Windows 11 26200.9974. The required hosted Windows check passed.

**@⁠R0Y00** on GitHub · 2026-11-28 02:42 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3260#pullrequestreview-6095238274) · **approved these changes** Reviewed f693f30c681a integrated on main fdb6faaa (tree 485040c35bf93d54d4047a9af52a5892a5490673). The diff only changes the fixtures: named texture-copy locations preserve the original values and lifetime, size casts are on bounded test buffers, and the vtable declarations retain read-only entries and the same ABI. With MSVC 19.51, a strict /permissive- /Zs check reproduced C2102 at the original texture-copy calls and passed after the change. This compiler accepted the old and new representative GameInput and rectangle sources; I could not reproduce those two reported build errors locally. ``` cmake --build <build> --target rectlist_draw_check startup_stub_gameinput startup_gameinput_contracts_check startup_gameinput_history startup_gameinput_keys startup_gameinput_script startup_gameinput_script_syntax startup_indirect_draw_indexed startup_resource_retire_title startup_resource_retire_views ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^(startup_gameinput_(keys|history|contracts_check|script_.*)|rectlist_draw_(warp|hardware)|startup_indirect_(draw_indexed|translated_indexed_rect)_(warp|hardware)|startup_resource_retire_(title|views)_.*)$" ``` Debug and Release /O2 each had 25 passes and 1 skip. The GameInput syntax test passed its parser checks and skipped playback because XInput pad 0 was connected. The retiring-view debug0/debug1 cases passed on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 on Windows 11 26200.9974. The required hosted Windows check passed.
This discussion has been locked. Commenting is limited to contributors.
No description provided.