Conversation
Fix MSVC C4267/C2220 in Dolphin's /W4 /WX build. Define the capacity once with non-narrowing uint32_t list initialization and use it for both the stack array extent and s2k_read. No warning suppression, buffer-size change, or controller behavior change. A compile-only exact-width overload regression against the real adapter fails before and passes after this change with both Clang and GCC. Dolphin PR #5 carries that regression and the full native application checks.
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to jmonster/dolphin#5. Native MSVC /W4 /WX rejects
s2k_read(..., events.size(), ...)with C4267 because array::size() is size_t and the C ABI capacity is uint32_t.Define one
constexpr uint32_tcapacity with non-narrowing list initialization and use it for both the array extent and the C call. Buffer capacity stays 256; no warning suppression or input/rumble/lifecycle behavior changes.This branch starts directly from Dolphin's prior SDK pin
3a4490678b721e41b4de6c7a2037da73a9ba5609, so Dolphin can pin just this fix without pulling unrelated SDK changes. The branch targets the existing Windows feature branch for review; it does not merge that branch.Dolphin's new
Tools/test_switch2kit_capacity.pycompiles the actual adapter with an exact-width test-only deleted overload. It fails before and passes after this fix under both Clang and GCC on x64, and runs in Dolphin wiring CI. Full native Windows application CI remains required. No physical controller qualification is claimed.