fix(cdb): unify helper signatures while preserving exact output #1173

Merged
coah80 merged 1 commits from agent/bittle/cdb-unify-arity into main 2026-10-05 02:44:23 +00:00
coah80 commented 2026-10-05 02:42:08 +00:00 (Migrated from github.com)

Summary

Remove the CDB_DATABASE_IMPLEMENTATION split introduced in #1167 and give seven external helpers consistent declarations and definitions. Day helpers take 3 ints, Month 2, Year 1, and directory conversion 5 strings. Removed trailing parameters were never read; MonthEnd now declares its fully assigned day locally. Names, linkage and return types remain unchanged.

The previous caller-only short prototypes conflicted with longer definitions in CDBConv.c. Exact PowerPC output does not make incompatible C function types valid. This correction fixes that without changing compiled behavior.

Evidence and independent verification

  • All 13 original helper calls are in CDBDatabase; 12 additional references are MonthEnd internal switch entries
  • No original entry-address data references or export module found; global symbols remain global. Unknown external fixed-address consumers cannot be categorically excluded
  • CDBConv 39/39 and CDBDatabase 33/33 exact functions; instructions and normalized relocations match
  • All allocated sections in both objects byte-identical to baseline, independently checked by parent after forced recompilation
  • All 1,027 unit metrics and global measures unchanged
  • Pools 5/5 and 7/7; literal audit 72 functions / 31 arguments with zero candidates/errors; MonthEnd switch 12/12
  • Full default43U and explicitok pass, original/built DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Only two existing FORCEACTIVE helper names shift with source line numbers; no emitted body change
  • Tested tree a73498cb73 equals published tree; based on f8957ca95b

Full audit: tools/decomp-assist/cdb-unify-arity.attempts.md. No NWC24 or unrelated behavior changes. This is a source-correctness repair, not a new percentage gain. No merge performed.

Note

Unify CDB helper signatures by dropping unused parameters

Simplifies the CDB date helpers and CDBConvDirStrToCDBDate to take only the parameters they actually use.

  • Removes unused time, day, month, location, and Wii ID arguments from the CDBMakeCDBDate* helpers in CDBConv.c and updates the declarations in CDBDate.h and CDBConv.h.
  • Removes the conditional long-argument declarations, so all consumers see the same signatures; CDBDatabase.c no longer defines the implementation-only macro.
  • Date output values are unchanged — helpers still use the same fixed minimum/maximum time constants, and month/year boundary logic (including the leap-year adjustment) is preserved.
  • Behavioral Change: calling any CDBMakeCDBDate* helper or CDBConvDirStrToCDBDate with the old argument lists will no longer compile; in-tree callers are updated.

Macroscope summarized 353d31a.

## Summary Remove the CDB_DATABASE_IMPLEMENTATION split introduced in #1167 and give seven external helpers consistent declarations and definitions. Day helpers take 3 ints, Month 2, Year 1, and directory conversion 5 strings. Removed trailing parameters were never read; MonthEnd now declares its fully assigned day locally. Names, linkage and return types remain unchanged. The previous caller-only short prototypes conflicted with longer definitions in CDBConv.c. Exact PowerPC output does not make incompatible C function types valid. This correction fixes that without changing compiled behavior. ## Evidence and independent verification - All 13 original helper calls are in CDBDatabase; 12 additional references are MonthEnd internal switch entries - No original entry-address data references or export module found; global symbols remain global. Unknown external fixed-address consumers cannot be categorically excluded - CDBConv 39/39 and CDBDatabase 33/33 exact functions; instructions and normalized relocations match - All allocated sections in both objects byte-identical to baseline, independently checked by parent after forced recompilation - All 1,027 unit metrics and global measures unchanged - Pools 5/5 and 7/7; literal audit 72 functions / 31 arguments with zero candidates/errors; MonthEnd switch 12/12 - Full default43U and explicitok pass, original/built DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Only two existing FORCEACTIVE helper names shift with source line numbers; no emitted body change - Tested tree a73498cb7352613b79194b31e17e669653db796d equals published tree; based on f8957ca95be0ca4b35a281fa9a5d59f7f1787a41 Full audit: tools/decomp-assist/cdb-unify-arity.attempts.md. No NWC24 or unrelated behavior changes. This is a source-correctness repair, not a new percentage gain. No merge performed. <!-- 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] > ### Unify CDB helper signatures by dropping unused parameters > Simplifies the CDB date helpers and `CDBConvDirStrToCDBDate` to take only the parameters they actually use. > - Removes unused time, day, month, location, and Wii ID arguments from the `CDBMakeCDBDate*` helpers in [CDBConv.c](https://github.com/coah80/wii-ipl/pull/1173/files#diff-d5c0f217bd24fb1040ea15160d3f98173934579bfaffb9dd3d5cddb33de60fd2) and updates the declarations in [CDBDate.h](https://github.com/coah80/wii-ipl/pull/1173/files#diff-ceb9ef58aff4a60133277cbacde84397cfbc268bb7d621617a79acaeffa48c64) and [CDBConv.h](https://github.com/coah80/wii-ipl/pull/1173/files#diff-f0c3e94811e23256a91d6c571f32fe3ae3dfd23a118e8c7d00a187e8d1991738). > - Removes the conditional long-argument declarations, so all consumers see the same signatures; [CDBDatabase.c](https://github.com/coah80/wii-ipl/pull/1173/files#diff-8bc86fdd4745305779d907e80a042c492894e4cbca78d03136797ab0a166f84e) no longer defines the implementation-only macro. > - Date output values are unchanged — helpers still use the same fixed minimum/maximum time constants, and month/year boundary logic (including the leap-year adjustment) is preserved. > - Behavioral Change: calling any `CDBMakeCDBDate*` helper or `CDBConvDirStrToCDBDate` with the old argument lists will no longer compile; in-tree callers are updated. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 353d31a.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-05 02:44:21 +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.