Skip to content

all: Enforce weak / global functions#269

Open
german77 wants to merge 2 commits into
open-ead:masterfrom
german77:aggresiveNoWeak
Open

all: Enforce weak / global functions#269
german77 wants to merge 2 commits into
open-ead:masterfrom
german77:aggresiveNoWeak

Conversation

@german77
Copy link
Copy Markdown
Contributor

@german77 german77 commented May 21, 2026

This is a continuation of #262. Fully eliminates all weak / global mismatches from sead. Unlike the previous PR I call it an aggressive approach since it will break some matches and duplicate code. The lost matches will be recovered once the object is used.


This change is Reviewable

Copy link
Copy Markdown
Contributor

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsterDruide1 reviewed 8 files and all commit messages, and made 3 comments.
Reviewable status: 8 of 10 files reviewed, 3 unresolved discussions (waiting on german77).


modules/src/devenv/seadFontMgr.cpp at r1 (raw file):
File is empty now => delete it (and remove from CMakeLists.txt)


modules/src/math/seadMathCalcCommon.cpp at r1 (raw file):
same here


modules/src/prim/seadStringBuilder.cpp at r1 (raw file):
This seems wrong, and ... to my knowledge, is wrong.
Checking <char>::copy and <char16_t>::copy within Labo, which has SEAD_ASSERTs enabled, we can see that for both instantiations, the str must not be null message is generated in line 42 - so it must be coming from the same function implementation.

Please revert these ones (StringBuilder and MathCalcCommon) which introduce duplicate code - hopefully we'll figure out something in time, otherwise we'll have to come up with a "blacklist" to ignore specific issues, but introducing that much duplicate code is just wrong.

Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@german77 made 1 comment.
Reviewable status: 8 of 10 files reviewed, 3 unresolved discussions (waiting on MonsterDruide1).


modules/src/prim/seadStringBuilder.cpp at r1 (raw file):

Previously, MonsterDruide1 wrote…

This seems wrong, and ... to my knowledge, is wrong.
Checking <char>::copy and <char16_t>::copy within Labo, which has SEAD_ASSERTs enabled, we can see that for both instantiations, the str must not be null message is generated in line 42 - so it must be coming from the same function implementation.

Please revert these ones (StringBuilder and MathCalcCommon) which introduce duplicate code - hopefully we'll figure out something in time, otherwise we'll have to come up with a "blacklist" to ignore specific issues, but introducing that much duplicate code is just wrong.

I kind of agree that this isn't the correct way to do it since it makes the code awful. Thanks for the assert suggestion. I will try to find another solution and if it takes too long I will fully rever these changes.

Copy link
Copy Markdown
Contributor Author

@german77 german77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@german77 made 3 comments.
Reviewable status: 7 of 12 files reviewed, 3 unresolved discussions (waiting on MonsterDruide1).


modules/src/devenv/seadFontMgr.cpp at r1 (raw file):

Previously, MonsterDruide1 wrote…

File is empty now => delete it (and remove from CMakeLists.txt)

Done.


modules/src/math/seadMathCalcCommon.cpp at r1 (raw file):

Previously, MonsterDruide1 wrote…

same here

Done. Sadly gcd now has a regswap


modules/src/prim/seadStringBuilder.cpp at r1 (raw file):

Previously, german77 (Narr the Reg) wrote…

I kind of agree that this isn't the correct way to do it since it makes the code awful. Thanks for the assert suggestion. I will try to find another solution and if it takes too long I will fully rever these changes.

Done. Now every function has an Impl_ equivalent. I made sure no unwanted symbols are generated in this conversion.

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.

2 participants