Skip to content

Commit

Permalink
More warning/error cleanup, mostly includes
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Oct 18, 2024
1 parent 7b1e5d2 commit 2028515
Show file tree
Hide file tree
Showing 38 changed files with 79 additions and 92 deletions.
5 changes: 3 additions & 2 deletions include/JAZelAudio/JAIZelBasic.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef JAZELAUDIO_JAIZELBASIC_H
#define JAZELAUDIO_JAIZELBASIC_H

#include "JAZelAudio/JAZelAudio_SE.h"
#include "JAZelAudio/JAZelAudio_BGM.h"
#include "JAZelAudio/JAZelAudio_SE.h" // IWYU pragma: export
#include "JAZelAudio/JAZelAudio_BGM.h" // IWYU pragma: export

#include "JSystem/JAudio/JAIBasic.h"
#include "JSystem/JMath/random.h"
#include "dolphin/mtx/mtx.h"
Expand Down
1 change: 0 additions & 1 deletion include/JSystem/JKernel/JKRThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSTime.h"
#include "dolphin/types.h"

struct JKRThreadName_ {
Expand Down
8 changes: 4 additions & 4 deletions include/JSystem/JUtility/JUTCacheFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ class JUTCacheFont : public JUTResFont {
/* 0x70 */ u32 mTotalWidSize;
/* 0x74 */ u32 mTotalGlySize;
/* 0x78 */ u32 mTotalMapSize;
/* 0x7C */ void* field_0x7c;
/* 0x80 */ void* field_0x80;
/* 0x84 */ void* field_0x84;
/* 0x7C */ u8* field_0x7c;
/* 0x80 */ u8* field_0x80;
/* 0x84 */ u8* field_0x84;
/* 0x88 */ u32 mMaxSheetSize;
/* 0x8C */ EPagingType mPagingType;
/* 0x90 */ void* mCacheBuffer;
/* 0x90 */ u8* mCacheBuffer;
/* 0x94 */ int field_0x94;
/* 0x98 */ u32 mCachePage;
/* 0x9C */ TGlyphCacheInfo* field_0x9c;
Expand Down
2 changes: 1 addition & 1 deletion include/JSystem/JUtility/JUTXfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class JUTXfb {
static JUTXfb* sManager;

private:
/* 0x00 */ void* mBuffer[3];
/* 0x00 */ u8* mBuffer[3];
/* 0x0C */ bool mXfbAllocated[3];
/* 0x10 */ s32 mBufferNum;
/* 0x14 */ s16 mDrawingXfbIndex;
Expand Down
3 changes: 1 addition & 2 deletions include/d/actor/d_a_arrow.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef D_A_ARROW_H
#define D_A_ARROW_H

#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_actor.h"
#include "d/d_cc_d.h"
#include "d/d_bg_s_lin_chk.h"
#include "d/d_bg_s_gnd_chk.h"
#include "d/d_particle.h"
#include "dolphin/types.h"

class J3DAnmTextureSRTKey;
class J3DMaterial;
Expand Down
3 changes: 2 additions & 1 deletion include/d/actor/d_a_auction.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

#include "f_op/f_op_actor.h"
#include "SSystem/SComponent/c_phase.h"
#include "d/d_com_inf_game.h"
#include "d/d_npc.h"
#include "d/d_particle.h"
#include "d/d_timer.h"
#include "m_Do/m_Do_hostIO.h"

class daAuction_c : public fopNpc_npc_c {
Expand Down
5 changes: 3 additions & 2 deletions include/d/actor/d_a_lbridge.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#ifndef D_A_LBRIDGE_H
#define D_A_LBRIDGE_H

#include "d/d_com_inf_game.h"
#include "f_op/f_op_actor.h"
#include "f_op/f_op_actor_mng.h"
#include "d/d_particle.h"
#include "d/d_bg_w.h"

class daLbridge_c : public fopAc_ac_c {
public:
Expand Down
4 changes: 2 additions & 2 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef D_COM_D_COM_INF_GAME_H
#define D_COM_D_COM_INF_GAME_H

#include "JSystem/JUtility/TColor.h"
#include "d/d_attention.h"
#include "d/d_bg_s.h"
#include "d/d_cc_s.h"
Expand All @@ -17,9 +16,10 @@
#include "d/d_vibration.h"
#include "d/d_demo.h"
#include "d/d_timer.h"
#include "d/res/res_always.h"
#include "SSystem/SComponent/c_data_tbl.h"

#include "d/res/res_always.h" // IWYU pragma: export

class JKRArchive;
class JKRAramBlock;
class JKRExpHeap;
Expand Down
2 changes: 1 addition & 1 deletion include/d/d_kankyo_rain.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ void dKyr_get_vectle_calc(cXyz*, cXyz*, cXyz*);
BOOL dKyr_poison_live_check();
BOOL dKyr_moon_arrival_check();

#endif /* D_KANKYO_D_KANKYO_RAIN_H */
#endif /* D_KANKYO_D_KANKYO_RAIN_H */
28 changes: 15 additions & 13 deletions include/dolphin/gx/GX.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#ifndef GX_H_
#define GX_H_

#include "dolphin/gx/GXAttr.h"
#include "dolphin/gx/GXBump.h"
#include "dolphin/gx/GXDisplayList.h"
#include "dolphin/gx/GXFifo.h"
#include "dolphin/gx/GXFrameBuf.h"
#include "dolphin/gx/GXGeometry.h"
#include "dolphin/gx/GXLight.h"
#include "dolphin/gx/GXMisc.h"
#include "dolphin/gx/GXPerf.h"
#include "dolphin/gx/GXPixel.h"
#include "dolphin/gx/GXTev.h"
#include "dolphin/gx/GXTexture.h"
#include "dolphin/gx/GXTransform.h"
#include "dolphin/gx/GXAttr.h" // IWYU pragma: export
#include "dolphin/gx/GXBump.h" // IWYU pragma: export
#include "dolphin/gx/GXDisplayList.h" // IWYU pragma: export
#include "dolphin/gx/GXFifo.h" // IWYU pragma: export
#include "dolphin/gx/GXFrameBuf.h" // IWYU pragma: export
#include "dolphin/gx/GXGeometry.h" // IWYU pragma: export
#include "dolphin/gx/GXLight.h" // IWYU pragma: export
#include "dolphin/gx/GXMisc.h" // IWYU pragma: export
#include "dolphin/gx/GXPerf.h" // IWYU pragma: export
#include "dolphin/gx/GXPixel.h" // IWYU pragma: export
#include "dolphin/gx/GXTev.h" // IWYU pragma: export
#include "dolphin/gx/GXTexture.h" // IWYU pragma: export
#include "dolphin/gx/GXTransform.h" // IWYU pragma: export
#include "dolphin/gx/GXStruct.h" // IWYU pragma: export

#include "dolphin/os/OSUtil.h"

#ifdef __cplusplus
Expand Down
1 change: 0 additions & 1 deletion include/dolphin/gx/GXStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define GXSTRUCT_H

#include "global.h"
#include "dolphin/gx/GXEnum.h"
#include "dolphin/vi/vi.h"

typedef struct _GXColor {
Expand Down
42 changes: 21 additions & 21 deletions include/dolphin/os/OS.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
#include "stdarg.h"
#include "dolphin/dvd/dvd.h"

#include "dolphin/os/OSAlarm.h"
#include "dolphin/os/OSAlloc.h"
#include "dolphin/os/OSArena.h"
#include "dolphin/os/OSAudioSystem.h"
#include "dolphin/os/OSCache.h"
#include "dolphin/os/OSContext.h"
#include "dolphin/os/OSError.h"
#include "dolphin/os/OSFont.h"
#include "dolphin/os/OSInterrupt.h"
#include "dolphin/os/OSLink.h"
#include "dolphin/os/OSMemory.h"
#include "dolphin/os/OSMessage.h"
#include "dolphin/os/OSMutex.h"
#include "dolphin/os/OSReboot.h"
#include "dolphin/os/OSReset.h"
#include "dolphin/os/OSResetSW.h"
#include "dolphin/os/OSRtc.h"
#include "dolphin/os/OSSync.h"
#include "dolphin/os/OSThread.h"
#include "dolphin/os/OSTime.h"
#include "dolphin/os/OSUtil.h"
#include "dolphin/os/OSAlarm.h" // IWYU pragma: export
#include "dolphin/os/OSAlloc.h" // IWYU pragma: export
#include "dolphin/os/OSArena.h" // IWYU pragma: export
#include "dolphin/os/OSAudioSystem.h" // IWYU pragma: export
#include "dolphin/os/OSCache.h" // IWYU pragma: export
#include "dolphin/os/OSContext.h" // IWYU pragma: export
#include "dolphin/os/OSError.h" // IWYU pragma: export
#include "dolphin/os/OSFont.h" // IWYU pragma: export
#include "dolphin/os/OSInterrupt.h" // IWYU pragma: export
#include "dolphin/os/OSLink.h" // IWYU pragma: export
#include "dolphin/os/OSMemory.h" // IWYU pragma: export
#include "dolphin/os/OSMessage.h" // IWYU pragma: export
#include "dolphin/os/OSMutex.h" // IWYU pragma: export
#include "dolphin/os/OSReboot.h" // IWYU pragma: export
#include "dolphin/os/OSReset.h" // IWYU pragma: export
#include "dolphin/os/OSResetSW.h" // IWYU pragma: export
#include "dolphin/os/OSRtc.h" // IWYU pragma: export
#include "dolphin/os/OSSync.h" // IWYU pragma: export
#include "dolphin/os/OSThread.h" // IWYU pragma: export
#include "dolphin/os/OSTime.h" // IWYU pragma: export
#include "dolphin/os/OSUtil.h" // IWYU pragma: export

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion include/f_op/f_op_actor_mng.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef F_OP_ACTOR_MNG_H_
#define F_OP_ACTOR_MNG_H_

#include "new.h" // IWYU pragma: keep // Used by the fopAcM_SetupActor macro.
#include "new.h" // IWYU pragma: export // Used by the fopAcM_SetupActor macro.
#include "f_op/f_op_actor.h"
#include "f_op/f_op_actor_iter.h"
#include "f_pc/f_pc_manager.h"
Expand Down
2 changes: 1 addition & 1 deletion include/m_Do/m_Do_machine_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ void dispDateInfo();
void dispConsoleToTerminal();
void exception_addition(JUTConsole* pConsole);

#endif /* M_DO_M_DO_MACHINE_EXCEPTION_H */
#endif /* M_DO_M_DO_MACHINE_EXCEPTION_H */
1 change: 0 additions & 1 deletion src/JAZelAudio/JAIZelCharVoiceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
//

#include "JAZelAudio/JAIZelBasic.h"
#include "dolphin/types.h"
1 change: 0 additions & 1 deletion src/JSystem/JKernel/JKRAram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "JSystem/JKernel/JKRDecomp.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTException.h"
#include "string.h"
#include "dolphin/ar/ar.h"
#include "dolphin/ar/arq.h"
Expand Down
1 change: 0 additions & 1 deletion src/JSystem/JMessage/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//

#include "JSystem/JMessage/data.h"
#include "dolphin/types.h"

namespace JMessage {
namespace data {
Expand Down
16 changes: 8 additions & 8 deletions src/JSystem/JUtility/JUTCacheFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ bool JUTCacheFont::allocArea(void* cacheBuffer, u32 param_1, JKRHeap* heap) {

if (cacheBuffer != NULL) {
JUT_ASSERT(351, ( (u32)cacheBuffer & 0x1f ) == 0);
mCacheBuffer = cacheBuffer;
mCacheBuffer = static_cast<u8*>(cacheBuffer);
field_0xb0 = 0;
} else {
mCacheBuffer = new (heap, 0x20) u8[v1];
Expand Down Expand Up @@ -253,7 +253,7 @@ bool JUTCacheFont::allocArray(JKRHeap* heap) {
mpGlyphBlocks = (ResFONT::GLY1**)blocks;
blocks = blocks + mGlyphBlockNum;
for (int i = 0; i < mGlyphBlockNum; i++) {
mpGlyphBlocks[i] = (ResFONT::GLY1*)((u8*)mCacheBuffer + (field_0x94 * i));
mpGlyphBlocks[i] = (ResFONT::GLY1*)(mCacheBuffer + (field_0x94 * i));
}
}
if (mMapBlockNum) {
Expand All @@ -267,7 +267,7 @@ void JUTCacheFont::setBlock() {
int widthNum = 0;
int gylphNum = 0;
int mapNum = 0;
u8* pWidth = (u8*)field_0x7c;
u8* pWidth = field_0x7c;
ResFONT::GLY1* piVar5 = (ResFONT::GLY1*)field_0x80;
ResFONT::MAP1* pMap = (ResFONT::MAP1*)field_0x84;
u32 aramAddress = field_0xac->getAddress();
Expand All @@ -276,23 +276,22 @@ void JUTCacheFont::setBlock() {

for (int i = 0; i < mResFont->numBlocks; i++) {
switch (*pData) {
case 'INF1':
case 'INF1': {
memcpy(mInfoBlock, pData, 0x20);
u32 u = mInfoBlock->fontType;
JUT_ASSERT(447, u < suAboutEncoding_);
mIsLeadByte = &JUTResFont::saoAboutEncoding_[u];
break;
}
case 'WID1':
memcpy(pWidth, pData, pData[1]);
mpWidthBlocks[widthNum] = (ResFONT::WID1*)pWidth;
pWidth += pData[1];
widthNum++;
break;
case 'GLY1':
case 'GLY1': {
memcpy(piVar5, pData, 0x20);
JKRAramBlock* iVar1 =
JKRMainRamToAram((u8*)pData + 0x20, aramAddress, pData[1] - 0x20,
EXPAND_SWITCH_UNKNOWN0, 0, NULL, 0xffffffff);
JKRAramBlock* iVar1 = JKRMainRamToAram((u8*)pData + 0x20, aramAddress, pData[1] - 0x20, EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1);
if (iVar1 == NULL) {
OSPanic(__FILE__, 476, "Cannot alloc ARAM area.");
}
Expand All @@ -305,6 +304,7 @@ void JUTCacheFont::setBlock() {
piVar5++;
aramAddress = pData[1] + aramAddress - 0x20;
break;
}
case 'MAP1':
memcpy(pMap, pData, pData[1]);
mpMapBlocks[mapNum] = pMap;
Expand Down
2 changes: 1 addition & 1 deletion src/JSystem/JUtility/JUTException.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 sectio
break;
if ((length < 28))
continue;
if ((buffer[28] == '4')) {
if (buffer[28] == '4') {
u32 addr = ((buffer[18] - '0') << 28) | strtol(buffer + 19, NULL, 16);
int size = strtol(buffer + 11, NULL, 16);
if ((addr <= address && address < addr + size)) {
Expand Down
1 change: 0 additions & 1 deletion src/JSystem/JUtility/JUTFader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "JSystem/JUtility/JUTFader.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "dolphin/types.h"

/* 802C8544-802C85F0 .text __ct__8JUTFaderFiiiiQ28JUtility6TColor */
JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor) : mColor(pColor), mBox(x, y, x + width, y + height) {
Expand Down
2 changes: 1 addition & 1 deletion src/JSystem/JUtility/JUTGba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ JUTGba* JUTGba::create() {
for (int i = 0; i < 4; i++) {
JUTGbaParam* param = &sManager->mParams[i];
OSReport(":::GBA: Create Thread %d\n", i);
OSCreateThread(&sManager->mThreads[i], &gbaThreadMain, param, sManager->mStacks + i + 1, 0x1000, 8, 0);
OSCreateThread(&sManager->mThreads[i], (void*)&gbaThreadMain, param, sManager->mStacks + i + 1, 0x1000, 8, 0);
OSResumeThread(&sManager->mThreads[i]);
}

Expand Down
8 changes: 4 additions & 4 deletions src/JSystem/JUtility/JUTProcBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void JUTProcBar::clear() {
/* 802C8AD8-802C8C6C .text bar_subroutine__10JUTProcBarFiiiiiiiQ28JUtility6TColorQ28JUtility6TColor */
void JUTProcBar::bar_subroutine(int param_0, int param_1, int param_2, int param_3, int param_4, int param_5, int param_6, JUtility::TColor param_7, JUtility::TColor param_8) {
int var1 = param_6 * param_3 / param_4;
J2DFillBox(param_0, param_1, param_5 * param_3 / param_4, param_2, param_7);
J2DFillBox(param_0, param_1, (int)(param_5 * param_3 / param_4), param_2, param_7);
if (var1 < 0) {
return;
}
Expand Down Expand Up @@ -249,9 +249,9 @@ void heapBar(JKRHeap* param_0, int param_1, int param_2, int param_3, int param_
int stack52 = param_1 + addrToXPos(param_0->getStartAddr(), param_4);
int var1 = param_1 + addrToXPos(param_0->getEndAddr(), param_4);
int stack36 = byteToXLen(param_0->getTotalFreeSize(), param_4);
J2DFillBox(stack52, param_2 - param_5 * 2 + param_5 / 2, var1 - stack52, param_5 / 2,
J2DFillBox(stack52, (int)(param_2 - param_5 * 2 + param_5 / 2), var1 - stack52, (int)(param_5 / 2),
JUtility::TColor(255, 0, 200, 255));
J2DFillBox(stack52, param_2 - param_5 * 2 + param_5 / 2, stack36, param_5 / 2,
J2DFillBox(stack52, (int)(param_2 - param_5 * 2 + param_5 / 2), stack36, (int)(param_5 / 2),
JUtility::TColor(255, 180, 250, 255));
}

Expand Down Expand Up @@ -281,7 +281,7 @@ void JUTProcBar::drawHeapBar() {

// draws a light blue line that shows how much memory is free in the root heap(blends to light pink, not sure how this works)
int size = byteToXLen(JKRHeap::getRootHeap()->getTotalFreeSize(), width);
J2DFillBox(start, posY - (height * 2), size, height / 2, JUtility::TColor(0, 250, 250, 255));
J2DFillBox(start, posY - (height * 2), size, (int)(height / 2), JUtility::TColor(0, 250, 250, 255));
if (field_0x128 == 0)
{
// draws a line of either the watch heap(if available), otherwise draw the current heap
Expand Down
3 changes: 2 additions & 1 deletion src/JSystem/JUtility/JUTResFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,13 @@ void JUTResFont::setBlock() {
const JUTDataBlockHeader* header = (JUTDataBlockHeader*)mResFont->data;
for (u32 i = 0; i < mResFont->numBlocks; i++, header = header->getNext()) {
switch (header->mType) {
case 'INF1':
case 'INF1': {
mInfoBlock = (ResFONT::INF1*)header;
u32 u = mInfoBlock->fontType;
JUT_ASSERT(0xF3, u < suAboutEncoding_)
mIsLeadByte = (IsLeadByte_func*)&saoAboutEncoding_[u];
break;
}
case 'WID1':
mpWidthBlocks[widthNum] = (ResFONT::WID1*)header;
widthNum++;
Expand Down
6 changes: 3 additions & 3 deletions src/JSystem/JUtility/JUTXfb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber
int size = ((u32)width + 0xf & 0xfff0) * (u32)height * 2;

void* buf = ::operator new[](size, pHeap, 0x20);
mBuffer[0] = buf;
mBuffer[0] = static_cast<u8*>(buf);
mXfbAllocated[0] = true;

if (xfbNum >= 2) {
buf = ::operator new[](size, pHeap, 0x20);
mBuffer[1] = buf;
mBuffer[1] = static_cast<u8*>(buf);
mXfbAllocated[1] = true;
} else {
mBuffer[1] = NULL;
Expand All @@ -100,7 +100,7 @@ void JUTXfb::initiate(u16 width, u16 height, JKRHeap* pHeap, JUTXfb::EXfbNumber

if (xfbNum >= 3) {
buf = ::operator new[](size, pHeap, 0x20);
mBuffer[2] = buf;
mBuffer[2] = static_cast<u8*>(buf);
mXfbAllocated[2] = true;
} else {
mBuffer[2] = NULL;
Expand Down
Loading

0 comments on commit 2028515

Please sign in to comment.