Skip to content

Fix SDL event capacity narrowing in Windows Dolphin builds - #76

Closed
jmonster wants to merge 1 commit into
feature/windows-native-controllersfrom
fix/dolphin-windows-sdl-capacity
Closed

jmonster wants to merge 1 commit into
feature/windows-native-controllersfrom
fix/dolphin-windows-sdl-capacity

Conversation

@jmonster

Copy link
Copy Markdown
Owner

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_t capacity 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.py compiles 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant