fix(chansvm): make converter callbacks consistently const-correct #1307

Merged
coah80 merged 1 commits from agent/fix/chansvm-converter-const into main 2026-10-09 03:46:40 +00:00
coah80 commented 2026-10-09 03:45:48 +00:00 (Migrated from github.com)

Summary

The new const-source ConvertToFloatFromStr implementation was cast to an incompatible VmConvertFunc type and invoked through that type. Make the callback typedef and all converter source parameters consistently const, propagate read-only headers through array-join helpers, and remove the cast. No executable expressions or compiler flags change.

Verification

Base 20cf9f9f25b13b8cd6910e07cc5eb71558845d4e; independently reviewed and parent verification rerun.

  • Entire compiled CHANSVm.o is byte-identical to a fresh baseline, preserving all existing nonmatches.
  • 15 affected/boundary functions match retail bytes and 86 canonical code relocation targets.
  • All target data and 614 data relocations exact; 125-string pool identical.
  • All 1,028 report units and global measures unchanged.
  • Full 43U build and explicit build/43U/ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d.
  • 22 workflow guard tests pass, no skips.
  • CHANSVm remains 229/233 exact and NonMatching; this makes no whole-unit or repository completion claim.

Evidence: tools/decomp-assist/CHANSVm-converter-const-20261009.md. Original binaries/disassembly stay local.

Note

Make chansvm converter callbacks take const source objects

Changes the VmConvertFunc callback typedef and all converters in CHANSVm.c to accept a pointer-to-const object header for the source parameter. Converts still allocate and write a new result object; the source is read-only.

  • Propagates the const type through array-join helpers (VmArrayJoinCommon, VmArrayJoinEstimateStrSize, VmArrayJoinSub, VmArraySeekTop) in CHANSVm.c
  • Removes an explicit function-pointer cast in VmTypeConvertFuncTbl because the float-from-string converter signature now matches the typedef
  • Adds a verification report in CHANSVm-converter-const-20261009.md with binary-comparison and build results

Macroscope summarized 9cc77ea.

## Summary The new const-source ConvertToFloatFromStr implementation was cast to an incompatible VmConvertFunc type and invoked through that type. Make the callback typedef and all converter source parameters consistently const, propagate read-only headers through array-join helpers, and remove the cast. No executable expressions or compiler flags change. ## Verification Base 20cf9f9f25b13b8cd6910e07cc5eb71558845d4e; independently reviewed and parent verification rerun. - Entire compiled CHANSVm.o is byte-identical to a fresh baseline, preserving all existing nonmatches. - 15 affected/boundary functions match retail bytes and 86 canonical code relocation targets. - All target data and 614 data relocations exact; 125-string pool identical. - All 1,028 report units and global measures unchanged. - Full 43U build and explicit build/43U/ok pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. - 22 workflow guard tests pass, no skips. - CHANSVm remains 229/233 exact and NonMatching; this makes no whole-unit or repository completion claim. Evidence: tools/decomp-assist/CHANSVm-converter-const-20261009.md. Original binaries/disassembly stay local. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Make chansvm converter callbacks take const source objects > Changes the `VmConvertFunc` callback typedef and all converters in [CHANSVm.c](https://github.com/coah80/wii-ipl/pull/1307/files#diff-fcd94241dcc82f12e50e6a224211f94b32d8c83c08ab0880c20261cea99b4f75) to accept a pointer-to-const object header for the source parameter. Converts still allocate and write a new result object; the source is read-only. > > - Propagates the const type through array-join helpers (`VmArrayJoinCommon`, `VmArrayJoinEstimateStrSize`, `VmArrayJoinSub`, `VmArraySeekTop`) in [CHANSVm.c](https://github.com/coah80/wii-ipl/pull/1307/files#diff-fcd94241dcc82f12e50e6a224211f94b32d8c83c08ab0880c20261cea99b4f75) > - Removes an explicit function-pointer cast in `VmTypeConvertFuncTbl` because the float-from-string converter signature now matches the typedef > - Adds a verification report in [CHANSVm-converter-const-20261009.md](https://github.com/coah80/wii-ipl/pull/1307/files#diff-0792699f70ff18b1ecae7ac1b7550843043093deda6225fe9393e7dca2addcdc) with binary-comparison and build results > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 9cc77ea.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-09 03:46:37 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.