We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
typedef
struct
See issue #212 point 5 for recursive/self-referential/"references each other" structs.
typedef struct BattleCursor { void *unk0[5]; SysTask *task; } BattleCursor;
Opaque struct declaration (only okay if the corresponding file isn't decompiled yet)
typedef struct GameStats GameStats;
Missing corresponding typedef.
struct BattleCursor { void *unk0[5]; SysTask *task; };
Same as above but for opaque struct declaration.
struct GameStats;
Corresponding typedef is separate from struct definition.
struct BattleCursor { void *unk0[5]; SysTask *task; }; typedef struct BattleCursor BattleCursor;
struct must be defined as well as the typedef.
typedef struct { void *unk0[5]; SysTask *task; } BattleCursor;
const HiddenItemData *table = sHiddenItemParam;
const struct HiddenItemData *table = sHiddenItemParam;
typedef struct HeapParam { u32 size; // maximum size of the heap OSArenaId arena; // where to allocate the heap from } HeapParam;
typedef struct HeapParam { u32 size; // maximum size of the heap OSArenaId arena; // where to allocate the heap from } HeapParam_t; // _t suffix
typedef struct WildEncounter { int state; int effect; int bgm; int *winFlag; BattleSetup *setup; } WildEncounter;
// using ALL_CAPS instead of PascalCase typedef struct WILD_ENCOUNTER { int state; int effect; int bgm; int *winFlag; BATTLE_SETUP *setup; } WILD_ENCOUNTER;
The text was updated successfully, but these errors were encountered:
This issue has had no activity for 60 days and will be marked stale. If there is no further activity, it will be closed in 30 days.
Sorry, something went wrong.
No branches or pull requests
There are still some style directions relating to structs which have no consensus. Those can be found at issue #212
1. All structs must have a corresponding typedef. The
typedef
must be defined with thestruct
.See issue #212 point 5 for recursive/self-referential/"references each other" structs.
Opaque struct declaration (only okay if the corresponding file isn't decompiled yet)
Missing corresponding
typedef
.Same as above but for opaque struct declaration.
Corresponding
typedef
is separate from struct definition.struct
must be defined as well as thetypedef
.2. Refer to the typedef in code, not the struct
3. Struct names must match the typedef struct name
4. Struct names and typedef struct names must be PascalCase
The text was updated successfully, but these errors were encountered: