fix(card): match the OS thread entry parameter contract #1043
Reference in New Issue
Block a user
Delete Branch "agent/bittle/card-thread-review"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source correction
Give cardThreadMain its genuinely unused void* entry parameter in declaration and definition, and remove the function-pointer cast at OSCreateThread. The existing body and registration arguments are unchanged. The original SDK stores registration r5 in context gpr[3], then enters the callback through that restored context; cardThreadMain overwrites r3 before reading it.
This fixes the C++ function type, with no fuzzy percentage gain. A direct C++98 binding rejects the old declaration and accepts the corrected one; no runtime sanitizer claim is made for the SDK context launch.
Independent verification
Rebased and fully tested on
5dcbc4372f.Detailed evidence: tools/decomp-assist/card-thread-entry-contract-20261003.md. No linking flags or other regions changed.
Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.