Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete irrlichttypes_bloated.h #15752

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

wrrrzr
Copy link
Contributor

@wrrrzr wrrrzr commented Feb 3, 2025

This PR is Ready for Review.

@lhofhansl
Copy link
Contributor

Compiles fine and looks good.

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

@appgurueu appgurueu added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements >= Two approvals ✅ ✅ and removed One approval ✅ ◻️ labels Feb 3, 2025
Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Sorry, I think I have to go back on that after running Include What You Use as suggested by Desour. My review is not comprehensive. I've attached the full output: iwyu.txt. Look at all the files this PR touches, and check whether IWYU suggests that you add some headers, and check whether it is right (because it can still make mistakes).

In general (I think Desour also suggested this in the past), you should probably use IWYU as a decent starting point when working on such PRs.

src/client/clientmap.h Show resolved Hide resolved
src/client/clientobject.h Show resolved Hide resolved
src/client/clouds.h Show resolved Hide resolved
@appgurueu appgurueu added One approval ✅ ◻️ Action / change needed Code still needs changes (PR) / more information requested (Issues) and removed >= Two approvals ✅ ✅ labels Feb 3, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Feb 3, 2025

👎 IMO there's no value in "optimizing" these five header includes. Vectors, AABB and SColor are reasonably common.
Also the using namespace irr; ought to stay centralized instead of duplicating it in some files.

@lhofhansl
Copy link
Contributor

Fair enough @appgurueu and @sfan5

@sfan5 sfan5 assigned sfan5 and unassigned sfan5 Feb 4, 2025
@Zughy Zughy removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Feb 4, 2025
@wrrrzr
Copy link
Contributor Author

wrrrzr commented Feb 4, 2025

👎 IMO there's no value in "optimizing" these five header includes. Vectors, AABB and SColor are reasonably common. Also the using namespace irr; ought to stay centralized instead of duplicating it in some files.

Where should "using namespace irr;" be then?

@Desour
Copy link
Member

Desour commented Feb 4, 2025

Sorry, I think I have to go back on that after running Include What You Use as suggested by Desour. My review is not comprehensive. I've attached the full output: iwyu.txt. Look at all the files this PR touches, and check whether IWYU suggests that you add some headers, and check whether it is right (because it can still make mistakes).

In general (I think Desour also suggested this in the past), you should probably use IWYU as a decent starting point when working on such PRs.

Sorry if there has been confusion, but I did not suggest to base such PRs on IWYU output.
Relying to some extent on recursive includes is not that big of an issue imo, as long as the recursive includes are not in a library header (and unspecified). It can cause breakages if you remove an include in one of our headers, but it's trivial to fix it then, so 🤷.
And IWYU suggests to add too much if the appropriate IWYU pragmas are missing (e.g. export of vector3d.h in irr_v3d.h).

👎 IMO there's no value in "optimizing" these five header includes. Vectors, AABB and SColor are reasonably common. Also the using namespace irr; ought to stay centralized instead of duplicating it in some files.

v2d and v3d are probably very common, but aabb and color?

We already have many using namespace irr; declarations.

Where should "using namespace irr;" be then?

It's in irrlichttypes.h.

Anyway, if we end up keeping this kind of prelude header, warnings need to be suppressed. https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md

@sfan5
Copy link
Collaborator

sfan5 commented Feb 4, 2025

v2d and v3d are probably very common, but aabb and color?

% rg -l 'v[23][su](16|32)' src -g '*.h' | wc -l
108
% rg -l SColor src -g '*.h' | wc -l
54
% rg -l aabb3f src -g '*.h' | wc -l
25

I guess aabb3f could be removed.

We already have many using namespace irr; declarations.

Indeed, and we shouldn't have them. I bet most are redundant anyway.
Currently we have a bunch of custom defines in irrlichttypes.h and to make them consistently available no Luanti code should be including irrTypes.h directly.

@grorp grorp added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Action / change needed Code still needs changes (PR) / more information requested (Issues) Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants