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

document poffin.c and poffin case struct #339

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fakuzatsu
Copy link

As per description.

Only undocumented function in poffin.c now is sub_0202A9E4 which seems to be related in some way to the cooking minigame in which you make poffins.

Renames some headers appropriately and notably includes the poffin.h header directly into struct_defs/poffin_case.h to use the MAX_POFFINS macro as the array size.

src/poffin.c Outdated Show resolved Hide resolved

#include "poffin.h"

typedef struct PoffinCase {
Copy link
Collaborator

Choose a reason for hiding this comment

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

polish: In general, we try to zip these structures up into the owning module's header file. struct-only headers are reserved for special cases when needed for untangling circular dependencies or sharing definitions with build-tooling.

#ifndef POKEPLATINUM_STRUCT_0202A93C_H
#define POKEPLATINUM_STRUCT_0202A93C_H
#ifndef POKEPLATINUM_STRUCT_POFFIN_H
#define POKEPLATINUM_STRUCT_POFFIN_H

typedef struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

polish: As with the above comment (and also for the struct_decls/poffin_case_decl.h file, as well):

  1. Zip this definition into include/poffin.h
  2. Replace all the inclusions of struct_defs/poffin.h with poffin.h
  3. Delete this file (and struct_decls/poffin_case_decl.h).

@@ -26,7 +28,7 @@ BOOL sub_0202A914(Poffin *poffin)

void Poffin_clear(Poffin *poffin)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
void Poffin_clear(Poffin *poffin)
void Poffin_Clear(Poffin *poffin)

Similarly (github will not let me do this on the associated lines):

-Poffin *Poffin_malloc(int heapID)
+Poffin *Poffin_New(int heapID)
-void Poffin_copy(Poffin *src, Poffin *dest)
+void Poffin_Copy(Poffin *src, Poffin *dest)

break;
}
} // skips rest of execution, reached end of poffin case
Copy link
Collaborator

Choose a reason for hiding this comment

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

polish: Remove this comment (unnecessary).

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.

3 participants