-
Notifications
You must be signed in to change notification settings - Fork 87
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
Minimize casts to pointers #964
Conversation
fca6320
to
c4674e6
Compare
CI failure is being fixed in #965. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! :)
Could you rebase on main instead of merging main? I'd like to avoid merge commits in feature branches.
Also, it would be great if you could have the CI run all of these commits. I usually do that by force pushing the first commit of the feature branch and then pushing commit by commit. Something like git push origin HEAD~10:cast-elimination --force
should work (--force
can be omitted on all but the first push).
I can also recomment git-interactive-rebase-tool
, but any editor of your choice works just as well for rebases.
To print addresses of objects, use address pointer formatter directly instead of casting to other types to print.
92d5675
to
3d838c6
Compare
As a side note, you don't have to wait for CI to finish before pushing the next commit. :) |
Awesome. You also don't need to be up to date with main and rebase on every change, but having a green CI everywhere would be great. :) |
I completely misread this message the first time and thought that you said I have to wait :) Thanks for the tip! |
I did cancel the CI runs starting from the first unsuccessful one, so this does not block the CI. I think, you should be able to do that too if rights are configured correctly: https://github.com/hermit-os/kernel/actions |
Using these functions makes the intent clearer and increases readability
b43a017
to
64ea080
Compare
Using this function makes it clear that the casted object is an exposed address, rather than a reference or another pointer.
c73ebf2
to
614c41c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! 👌
Thanks a lot! :)
Minimize casts to pointers by using:
ptr_from_ref
#793),