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

Struct Returns #1574

Merged
merged 5 commits into from
Nov 19, 2023
Merged

Struct Returns #1574

merged 5 commits into from
Nov 19, 2023

Conversation

engineer124
Copy link
Contributor

One of the rare instances where changing the number of arguments retains the same codegen. There's a pattern where a struct-returning functions takes an out-pointer as first arg and also return that pointer. Both seem to match but it seems likely that it was the first given the redundancy of having both an arg and a return give a pointer for a destination. See zeldaret/mm#1466 and the conversation here https://discord.com/channels/688807550715560050/688851997352263820/1170905743566835836

This also revealed some more unused variables, which has UNUSED added to them

include/ultra64/xstdio.h Outdated Show resolved Hide resolved
src/code/z_actor.c Outdated Show resolved Hide resolved
@@ -464,10 +458,10 @@ Vec3s* Camera_GetBgCamFuncData(Camera* camera) {
*/
s32 Camera_GetBgCamIndex(Camera* camera, s32* bgId, CollisionPoly* poly) {
s32 bgCamIndex;
PosRot playerPosRot;
UNUSED PosRot playerPosRot;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't use unused in oot so far #1321

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's worth noting that the are already 3 uses of UNUSED in z_camera.c, and that a lot of warnings are added without the UNUSED. But I'll leave it to that PR to sort out, so I've removed them

@fig02
Copy link
Collaborator

fig02 commented Nov 11, 2023

pr looks good to me after a couple pending comments are addressed

@fig02 fig02 merged commit aef0335 into zeldaret:main Nov 19, 2023
1 check passed
cadmic added a commit to cadmic/oot-setups that referenced this pull request Nov 20, 2023
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.

6 participants