Skip to content

Commit

Permalink
Label UNUSED and static in gflib and libpmagb
Browse files Browse the repository at this point in the history
  • Loading branch information
citrusbolt committed Feb 25, 2024
1 parent 779cfce commit 7f96863
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion payload/include/gflib/bg.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern bool8 gBgTilemapBufferTransferScheduled[];
void ResetGpuBuffers(void);
void DoGpuUpdateAndTilemapTransfers(void);
void CopyToBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, const u16 * src);
void CopyFromBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u16 * dest);
void UNUSED CopyFromBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u16 * dest);
void SetBgTilemapBufferPaletteRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u32 paletteNum);
void SetBgTilemapBufferTileAt(u32 bgNum, u32 x, u32 y, u16 tileNum);
void FillBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u16 tileNum);
Expand Down
14 changes: 7 additions & 7 deletions payload/include/gflib/sound.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ bool32 EnableSoundVSync(bool32 enable);
void InitSound(void);
void PauseSoundVSync(void);
void PlaySE(u16 song);
void StopSE(u16 song);
void StopAllSound(void);
bool8 sub_020093AC(void);
void FadeOutSE(u16 song, u16 _speed);
void SetSEVolume(u16 song, u16 volume);
void SetSETempo(u16 song, u16 tempo);
void SetSEPitch(u16 song, s16 pitch);
void UNUSED StopSE(u16 song);
void UNUSED StopAllSound(void);
bool8 UNUSED ReturnTrue(void);
void UNUSED FadeOutSE(u16 song, u16 _speed);
void UNUSED SetSEVolume(u16 song, u16 volume);
void UNUSED SetSETempo(u16 song, u16 tempo);
void UNUSED SetSEPitch(u16 song, s16 pitch);
void SoundVSyncOff(void);
void SoundVSyncOn(void);

Expand Down
2 changes: 1 addition & 1 deletion payload/include/gflib/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void SetTextColor(struct Window * window, u8 fg, u8 shadow);
void TextWindowNextLine(struct Window * window);
void TextWindowSetXY(struct Window * window, u32 x, u32 y);
void TextWindowShiftXY(struct Window * window, s32 dx, s32 dy);
void TextWindowPrintSimpleString(struct Window * window, const u8 * glyphs);
void UNUSED TextWindowPrintSimpleString(struct Window * window, const u8 * glyphs);
void TextWindowFillTileBufferForText(struct Window * window);

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion payload/include/libpmagb/berry.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PMAGB_BERRY_H
#define PMAGB_BERRY_H

u32 GetEnigmaBerryChecksum(struct EnigmaBerry * enigmaBerry);
u32 UNUSED GetEnigmaBerryChecksum(struct EnigmaBerry * enigmaBerry);
bool32 IsEnigmaBerryValid(void);
const struct Berry *GetBerryInfo(u8 berry);
const u8 *ItemId_GetName(u16 itemId);
Expand Down
2 changes: 1 addition & 1 deletion payload/src/gflib/bg.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void CopyToBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 heig
}
}

void CopyFromBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u16 * dest)
void UNUSED CopyFromBgTilemapBufferRect(u32 bgNum, u32 left, u32 top, s32 width, u32 height, u16 * dest)
{
s32 x;
u16 * ptr = (void *)(gBGTilemapBuffers + (bgNum << 12) + (top << 6) + (left << 1));
Expand Down
12 changes: 6 additions & 6 deletions payload/src/gflib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ IntrFunc gIntrTable[14u];
u32 gVBlankCounter;
IntrFunc gVBlankCallback;

void InitIntr(void);
void VBlankIntr(void);
void IntrDummy(void);
static void InitIntr(void);
static void VBlankIntr(void);
static void IntrDummy(void);

#define SR_KEYS (A_BUTTON | B_BUTTON | SELECT_BUTTON | START_BUTTON)

Expand Down Expand Up @@ -49,7 +49,7 @@ void DelayFrames(u32 frames)
}
}

void InitIntr(void)
static void InitIntr(void)
{
u32 i;

Expand Down Expand Up @@ -80,7 +80,7 @@ void SetVBlankCallback(IntrFunc cb)
REG_IME = imeBak;
}

void VBlankIntr(void)
static void VBlankIntr(void)
{
if (EnableSoundVSync(0))
m4aSoundVSync();
Expand All @@ -97,7 +97,7 @@ void VBlankIntr(void)
m4aSoundMain();
}

void IntrDummy(void)
static void IntrDummy(void)
{

}
14 changes: 7 additions & 7 deletions payload/src/gflib/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,25 @@ void PlaySE(u16 song)
m4aMPlayImmInit(mPlayInfo);
}

void StopSE(u16 song)
void UNUSED StopSE(u16 song)
{
struct MusicPlayerInfo * mPlayInfo;

mPlayInfo = gMPlayTable[gSongTable[song].ms].info;
m4aMPlayStop(mPlayInfo);
}

void StopAllSound(void)
void UNUSED StopAllSound(void)
{
m4aMPlayAllStop();
}

bool8 sub_020093AC(void)
bool8 UNUSED ReturnTrue(void)
{
return TRUE;
}

void FadeOutSE(u16 song, u16 _speed)
void UNUSED FadeOutSE(u16 song, u16 _speed)
{
struct MusicPlayerInfo * mPlayInfo;
u16 speed = _speed >> 4;
Expand All @@ -64,23 +64,23 @@ void FadeOutSE(u16 song, u16 _speed)
m4aMPlayFadeOut(mPlayInfo, speed);
}

void SetSEVolume(u16 song, u16 volume)
void UNUSED SetSEVolume(u16 song, u16 volume)
{
struct MusicPlayerInfo * mPlayInfo;

mPlayInfo = gMPlayTable[gSongTable[song].ms].info;
m4aMPlayVolumeControl(mPlayInfo, 0xFF, volume);
}

void SetSETempo(u16 song, u16 tempo)
void UNUSED SetSETempo(u16 song, u16 tempo)
{
struct MusicPlayerInfo * mPlayInfo;

mPlayInfo = gMPlayTable[gSongTable[song].ms].info;
m4aMPlayTempoControl(mPlayInfo, tempo);
}

void SetSEPitch(u16 song, s16 pitch)
void UNUSED SetSEPitch(u16 song, s16 pitch)
{
struct MusicPlayerInfo * mPlayInfo;

Expand Down
4 changes: 2 additions & 2 deletions payload/src/gflib/sprite.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct OamBuffer

static struct OamBuffer sOamBuffer;

void InsertSprite(struct Sprite * sprite1, struct Sprite * sprite2)
static void InsertSprite(struct Sprite * sprite1, struct Sprite * sprite2)
{
sprite2->next = sprite1->next;
sprite2->prev = sprite1 - sSprites;
Expand All @@ -38,7 +38,7 @@ struct Sprite * AddSprite(s32 x, s32 y, const struct Subsprites * subsprites)
return newSprite;
}

void BufferSpriteOAM(struct Sprite * sprite)
static void BufferSpriteOAM(struct Sprite * sprite)
{
u32 numSprites;
struct OamData * oam;
Expand Down
2 changes: 1 addition & 1 deletion payload/src/gflib/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void TextWindowShiftXY(struct Window * window, s32 dx, s32 dy)
window->currentY += dy;
}

void TextWindowPrintSimpleString(struct Window * window, const u8 * glyphs)
void UNUSED TextWindowPrintSimpleString(struct Window * window, const u8 * glyphs)
{
while (*glyphs != 0)
{
Expand Down
6 changes: 3 additions & 3 deletions payload/src/libpmagb/agb_rom.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ u16 * gVarsPtr;
u8 * gGiftRibbonsPtr;
struct EnigmaBerry * gEnigmaBerryPtr;

u16 SaveRandom(void);
static u16 SaveRandom(void);

void * gLastSaveBlockPtr;
u8 gSaveBlockLoadRegions[0xE000];
Expand Down Expand Up @@ -137,14 +137,14 @@ void SaveBlocksInit(void)
gPcItemsPtr = gSaveBlock1Ptr + gAgbPmRomParams->pcItemsOffset;
}

u16 SaveRandom(void)
static u16 SaveRandom(void)
{
gSaveRngValue = gSaveRngValue * 2061 + 7;

return gSaveRngValue;
}

void * UpdateSaveBlockPtr_(u32 size)
void * UNUSED UpdateSaveBlockPtr_(u32 size)
{
return UpdateSaveBlockPtr(size);
}
2 changes: 1 addition & 1 deletion payload/src/libpmagb/berry.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct Item
u8 secondaryId;
};

u32 GetEnigmaBerryChecksum(struct EnigmaBerry * enigmaBerry)
u32 UNUSED GetEnigmaBerryChecksum(struct EnigmaBerry * enigmaBerry)
{
u32 i, checksum;
u8 * dest;
Expand Down
16 changes: 8 additions & 8 deletions payload/src/libpmagb/save.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct {
static u8 sWipeTries;
static u32 gSaveValidStatus;

bool8 WipeFailedSectors(void);
static bool8 WipeFailedSectors(void);

struct SaveBlockChunk sSaveBlockChunks[] = {
SAVEBLOCK_CHUNK_FALSE_SIZE(gSaveBlock2Ptr, 0, 0x0004),
Expand Down Expand Up @@ -433,7 +433,7 @@ static inline u32 TryWriteSector(u8 sectorNum, void * data)
}
}

u32 HandleWriteSector(u16 sectorId, const struct SaveBlockChunk * chunks)
static u32 HandleWriteSector(u16 sectorId, const struct SaveBlockChunk * chunks)
{
u16 i;
u16 sector;
Expand Down Expand Up @@ -505,7 +505,7 @@ u32 WriteSaveBlockChunks(void)
return WriteSaveSectorOrSlot(0xFFFF, sSaveBlockChunks);
}

u8 HandleReplaceSector(u16 sectorId, const struct SaveBlockChunk * chunks)
static u8 HandleReplaceSector(u16 sectorId, const struct SaveBlockChunk * chunks)
{
u16 i;
u16 sector;
Expand Down Expand Up @@ -575,7 +575,7 @@ u8 HandleReplaceSector(u16 sectorId, const struct SaveBlockChunk * chunks)
}
}

u8 WriteSectorSignatureByte(u16 sectorId, const struct SaveBlockChunk * chunks)
static u8 WriteSectorSignatureByte(u16 sectorId, const struct SaveBlockChunk * chunks)
{
u16 sector = sectorId + gLastWrittenSector - 1;

Expand All @@ -597,7 +597,7 @@ u8 WriteSectorSignatureByte(u16 sectorId, const struct SaveBlockChunk * chunks)
}
}

u8 WriteSectorSignatureByteInverse(u16 sectorId, const struct SaveBlockChunk * chunks)
static u8 WriteSectorSignatureByteInverse(u16 sectorId, const struct SaveBlockChunk * chunks)
{
u16 sector = sectorId + gLastWrittenSector - 1;

Expand Down Expand Up @@ -689,7 +689,7 @@ inline u32 HandleReplaceSectorAndVerify(u16 chunk, const struct SaveBlockChunk *
return status;
}

bool32 FullSaveAndLoopOverFailedSectors(void)
static bool32 FullSaveAndLoopOverFailedSectors(void)
{
u8 status;

Expand Down Expand Up @@ -1072,7 +1072,7 @@ static inline bool8 WipeSector_Sub(void)
return FALSE;
}

bool8 WipeSector(u16 sectorNum)
static bool8 WipeSector(u16 sectorNum)
{
u16 i;
bool8 ret;
Expand All @@ -1098,7 +1098,7 @@ bool8 WipeSector(u16 sectorNum)
return ret;
}

bool8 WipeFailedSectors(void)
static bool8 WipeFailedSectors(void)
{
u32 bits;
u16 i;
Expand Down

0 comments on commit 7f96863

Please sign in to comment.