From 4606929b31b192d7e03584112e7ad17cdb85c7dc Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Tue, 28 Jun 2022 13:06:24 +0200 Subject: [PATCH] LogUtils as macro --- soh/include/macros.h | 17 ++++++++ soh/src/boot/z_locale.c | 2 +- soh/src/code/PreRender.c | 40 +++++++++---------- soh/src/code/game.c | 4 +- soh/src/code/gamealloc.c | 4 +- soh/src/code/irqmgr.c | 14 +++---- soh/src/code/mtxuty-cvt.c | 8 ++-- soh/src/code/padmgr.c | 2 +- soh/src/code/sched.c | 4 +- soh/src/code/speed_meter.c | 2 +- soh/src/code/sys_cfb.c | 2 +- soh/src/code/z_bgcheck.c | 4 +- soh/src/code/z_kaleido_manager.c | 4 +- soh/src/code/z_map_mark.c | 2 +- soh/src/code/z_room.c | 4 +- soh/src/code/z_view.c | 28 ++++++------- .../z_en_horse_game_check.c | 2 +- .../ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c | 2 +- 18 files changed, 81 insertions(+), 64 deletions(-) diff --git a/soh/include/macros.h b/soh/include/macros.h index 69bae1d799e..9c20e963050 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -111,6 +111,23 @@ #define LOG_FLOAT(exp, value) ((void)0) #endif +// LogUtils as macro +#ifndef NDEBUG +#define LOG_POINTER(val, max, ptr, name) LogUtils_LogPointer(val, max, ptr, name, __FILE__, __LINE__) +#define LOG_CHECK_BOUNDARY(name, value, unk) LogUtils_CheckBoundary(name, value, unk, __FILE__, __LINE__) +#define LOG_CHECK_NULL_POINTER(exp, ptr) LogUtils_CheckNullPointer(exp, ptr,__FILE__, __LINE__) +#define LOG_CHECK_VALID_POINTER(exp, ptr) LogUtils_CheckValidPointer(exp, ptr,__FILE__, __LINE__) +#define LOG_THREAD_ID() LogUtils_LogThreadId(__FILE__, __LINE__) +#define LOG_HUNGUP_THREAD() LogUtils_HungupThread(__FILE__, __LINE__) +#else +#define LOG_POINTER(val, max, ptr, name) ((void)0) +#define LOG_CHECKBOUNDARY(name, value, unk) ((void)0) +#define LOG_CHECK_NULL_POINTER(exp, ptr) ((void)0) +#define LOG_CHECK_VALID_POINTER(exp, ptr) ((void)0) +#define LOG_THREAD_ID() ((void)0) +#define LOG_HUNGUP_THREAD() ((void)0) +#endif + #define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \ do { \ (curState)->init = newInit; \ diff --git a/soh/src/boot/z_locale.c b/soh/src/boot/z_locale.c index 0fc68958e6a..8ee57ba83ea 100644 --- a/soh/src/boot/z_locale.c +++ b/soh/src/boot/z_locale.c @@ -21,7 +21,7 @@ void Locale_Init(void) { default: osSyncPrintf(VT_COL(RED, WHITE)); osSyncPrintf("z_locale_init: 日本用かアメリカ用か判別できません\n"); - LogUtils_HungupThread("../z_locale.c", 118); + LOG_HUNGUP_THREAD(); osSyncPrintf(VT_RST); break; } diff --git a/soh/src/code/PreRender.c b/soh/src/code/PreRender.c index bed9878bc41..0458601f103 100644 --- a/soh/src/code/PreRender.c +++ b/soh/src/code/PreRender.c @@ -41,10 +41,10 @@ void func_800C0F28(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) { s32 x2; s32 dx; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("glistpp", gfxp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("glistpp", gfxp); gfx = *gfxp; - LogUtils_CheckNullPointer("glistp", gfx, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("glistp", gfx); gDPPipeSync(gfx++); gDPSetOtherMode(gfx++, @@ -89,10 +89,10 @@ void func_800C1258(PreRender* this, Gfx** gfxp) { s32 y2; s32 dy; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("glistpp", gfxp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("glistpp", gfxp); gfx = *gfxp; - LogUtils_CheckNullPointer("glistp", gfx, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("glistp", gfx); gDPPipeSync(gfx++); gDPSetOtherMode(gfx++, @@ -139,10 +139,10 @@ void func_800C170C(PreRender* this, Gfx** gfxp, void* fbuf, void* fbufSave, u32 s32 x2; s32 dx; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("glistpp", gfxp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("glistpp", gfxp); gfx = *gfxp; - LogUtils_CheckNullPointer("glistp", gfx, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("glistp", gfx); gDPPipeSync(gfx++); gDPSetOtherMode(gfx++, @@ -195,10 +195,10 @@ void func_800C1B24(PreRender* this, Gfx** gfxp, void* fbuf, void* cvgSave) { s32 x2; s32 dx; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("glistpp", gfxp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("glistpp", gfxp); gfx = *gfxp; - LogUtils_CheckNullPointer("glistp", gfx, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("glistp", gfx); gDPPipeSync(gfx++); gDPSetOtherMode(gfx++, @@ -239,8 +239,8 @@ void func_800C1B24(PreRender* this, Gfx** gfxp, void* fbuf, void* cvgSave) { } void func_800C1E9C(PreRender* this, Gfx** gfxp) { - LogUtils_CheckNullPointer("this->zbuf_save", this->zbufSave, __FILE__, __LINE__); - LogUtils_CheckNullPointer("this->zbuf", this->zbuf, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this->zbuf_save", this->zbufSave); + LOG_CHECK_NULL_POINTER("this->zbuf", this->zbuf); if ((this->zbufSave != NULL) && (this->zbuf != NULL)) { func_800C0F28(this, gfxp, this->zbuf, this->zbufSave); @@ -248,8 +248,8 @@ void func_800C1E9C(PreRender* this, Gfx** gfxp) { } void func_800C1F20(PreRender* this, Gfx** gfxp) { - LogUtils_CheckNullPointer("this->fbuf_save", this->fbufSave, __FILE__, __LINE__); - LogUtils_CheckNullPointer("this->fbuf", this->fbuf, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this->fbuf_save", this->fbufSave); + LOG_CHECK_NULL_POINTER("this->fbuf", this->fbuf); if ((this->fbufSave != NULL) && (this->fbuf != NULL)) { func_800C1AE8(this, gfxp, this->fbuf, this->fbufSave); @@ -275,7 +275,7 @@ void func_800C1FA4(PreRender* this, Gfx** gfxp) { void func_800C20B4(PreRender* this, Gfx** gfxp) { func_800C1FA4(this, gfxp); - LogUtils_CheckNullPointer("this->cvg_save", this->cvgSave, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this->cvg_save", this->cvgSave); if (this->cvgSave != NULL) { func_800C1B24(this, gfxp, this->fbuf, this->cvgSave); } @@ -293,10 +293,10 @@ void func_800C213C(PreRender* this, Gfx** gfxp) { s32 rtile = 1; if (this->cvgSave != NULL) { - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("glistpp", gfxp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("glistpp", gfxp); gfx = *gfxp; - LogUtils_CheckNullPointer("glistp", gfx, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("glistp", gfx); gDPPipeSync(gfx++); gDPSetEnvColor(gfx++, 255, 255, 255, 32); diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 6f0df77dd5f..3167764e966 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -512,7 +512,7 @@ void GameState_Init(GameState* gameState, GameStateFunc init, GraphicsContext* g osSyncPrintf("init 処理時間 %d us\n", OS_CYCLES_TO_USEC(endTime - startTime)); startTime = endTime; - LogUtils_CheckNullPointer("this->cleanup", gameState->destroy, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this->cleanup", gameState->destroy); func_800ACE70(&D_801664F0); func_800AD920(&D_80166500); VisMono_Init(&sMonoColors); @@ -537,7 +537,7 @@ void GameState_Destroy(GameState* gameState) { func_800C3C20(); func_800F3054(); osRecvMesg(&gameState->gfxCtx->queue, NULL, OS_MESG_BLOCK); - LogUtils_CheckNullPointer("this->cleanup", gameState->destroy, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this->cleanup", gameState->destroy); if (gameState->destroy != NULL) { gameState->destroy(gameState); } diff --git a/soh/src/code/gamealloc.c b/soh/src/code/gamealloc.c index 11de5cd655c..ae44ee52195 100644 --- a/soh/src/code/gamealloc.c +++ b/soh/src/code/gamealloc.c @@ -49,8 +49,8 @@ void GameAlloc_Free(GameAlloc* this, void* data) { if (data != NULL) { ptr = &((GameAllocEntry*)data)[-1]; - LogUtils_CheckNullPointer("ptr->prev", ptr->prev, __FILE__, __LINE__); - LogUtils_CheckNullPointer("ptr->next", ptr->next, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("ptr->prev", ptr->prev); + LOG_CHECK_NULL_POINTER("ptr->next", ptr->next); ptr->prev->next = ptr->next; ptr->next->prev = ptr->prev; this->head = this->base.prev; diff --git a/soh/src/code/irqmgr.c b/soh/src/code/irqmgr.c index 936ef8960b4..41b432e91f7 100644 --- a/soh/src/code/irqmgr.c +++ b/soh/src/code/irqmgr.c @@ -19,9 +19,9 @@ u32 sIrqMgrRetraceCount = 0; void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) { OSIntMask prevInt; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("c", c, __FILE__, __LINE__); - LogUtils_CheckNullPointer("msgQ", msgQ, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("c", c); + LOG_CHECK_NULL_POINTER("msgQ", msgQ); prevInt = osSetIntMask(1); @@ -45,8 +45,8 @@ void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) { IrqMgrClient* lastIter = NULL; OSIntMask prevInt; - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("c", c, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("c", c); prevInt = osSetIntMask(1); @@ -214,8 +214,8 @@ void IrqMgr_ThreadEntry(void* arg0) { } void IrqMgr_Init(IrqMgr* this, void* stack, OSPri pri, u8 retraceCount) { - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); - LogUtils_CheckNullPointer("stack", stack, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); + LOG_CHECK_NULL_POINTER("stack", stack); this->clients = NULL; this->retraceMsg.type = OS_SC_RETRACE_MSG; diff --git a/soh/src/code/mtxuty-cvt.c b/soh/src/code/mtxuty-cvt.c index 639882b1d01..3414ce5f069 100644 --- a/soh/src/code/mtxuty-cvt.c +++ b/soh/src/code/mtxuty-cvt.c @@ -4,8 +4,8 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) { s32 i; s32 j; - LogUtils_CheckNullPointer("m1", m1, __FILE__, __LINE__); - LogUtils_CheckNullPointer("m2", m2, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("m1", m1); + LOG_CHECK_NULL_POINTER("m2", m2); for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { @@ -18,7 +18,7 @@ void MtxConv_F2L(Mtx* m1, MtxF* m2) { } void MtxConv_L2F(MtxF* m1, Mtx* m2) { - LogUtils_CheckNullPointer("m1", m1, __FILE__, __LINE__); - LogUtils_CheckNullPointer("m2", m2, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("m1", m1); + LOG_CHECK_NULL_POINTER("m2", m2); guMtxL2F(m1, m2); } diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index b8f00e20ee4..d89207e6fee 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -398,7 +398,7 @@ void PadMgr_ThreadEntry(PadMgr* padMgr) { } osRecvMesg(&padMgr->interruptMsgQ, (OSMesg*)&mesg, OS_MESG_BLOCK); - //LogUtils_CheckNullPointer("msg", mesg); + //LOG_CHECK_NULL_POINTER("msg", mesg); PadMgr_HandleRetraceMsg(padMgr); break; diff --git a/soh/src/code/sched.c b/soh/src/code/sched.c index d5a0e0878c5..0970b4fd968 100644 --- a/soh/src/code/sched.c +++ b/soh/src/code/sched.c @@ -18,7 +18,7 @@ OSTime sRDPStartTime; void Sched_SwapFrameBuffer(CfbInfo* cfbInfo) { u16 width; - LogUtils_CheckValidPointer("cfbinfo->swapbuffer", cfbInfo->swapBuffer, __FILE__, __LINE__); + LOG_CHECK_VALID_POINTER("cfbinfo->swapbuffer", cfbInfo->swapBuffer); if (cfbInfo->swapBuffer != NULL) { osViSwapBuffer(cfbInfo->swapBuffer); cfbInfo->updateRate2 = cfbInfo->updateRate; @@ -221,7 +221,7 @@ void func_800C8BC4(SchedContext* sc, OSScTask* task) { if (sc->pendingSwapBuf1 == NULL) { sc->pendingSwapBuf1 = task->framebuffer; - LogUtils_CheckValidPointer("sc->pending_swapbuffer1", sc->pendingSwapBuf1, __FILE__, __LINE__); + LOG_CHECK_VALID_POINTER("sc->pending_swapbuffer1", sc->pendingSwapBuf1); if ((sc->curBuf == NULL) || (sc->curBuf->updateRate2 < 1)) { func_800C84E4(sc, task->framebuffer); diff --git a/soh/src/code/speed_meter.c b/soh/src/code/speed_meter.c index 9bb9ad39daf..f645c7bb5b9 100644 --- a/soh/src/code/speed_meter.c +++ b/soh/src/code/speed_meter.c @@ -29,7 +29,7 @@ SpeedMeterTimeEntry sSpeedMeterTimeEntryArray[] = { gDPPipeSync(gfx); void SpeedMeter_InitImpl(SpeedMeter* this, u32 arg1, u32 y) { - LogUtils_CheckNullPointer("this", this, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("this", this); this->unk_18 = arg1; this->y = y; } diff --git a/soh/src/code/sys_cfb.c b/soh/src/code/sys_cfb.c index 9412c303551..39106c49bd4 100644 --- a/soh/src/code/sys_cfb.c +++ b/soh/src/code/sys_cfb.c @@ -25,7 +25,7 @@ void SysCfb_Init(s32 n64dd) { osSyncPrintf("RAM4M mode\n"); sSysCfbEnd = 0x80400000; } else { - LogUtils_HungupThread("../sys_cfb.c", 354); + LOG_HUNGUP_THREAD(); } */ diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index 0d00f259867..453663fc209 100644 --- a/soh/src/code/z_bgcheck.c +++ b/soh/src/code/z_bgcheck.c @@ -1569,7 +1569,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis &globalCtx->state.tha, colCtx->subdivAmount.x * sizeof(StaticLookup) * colCtx->subdivAmount.y * colCtx->subdivAmount.z, ~1); if (colCtx->lookupTbl == NULL) { - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); } colCtx->minBounds.x = colCtx->colHeader->minBounds.x; colCtx->minBounds.y = colCtx->colHeader->minBounds.y; @@ -1598,7 +1598,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, GlobalContext* globalCtx, Collis tblMax = customNodeListMax; } else { if (colCtx->memSize < memSize) { - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); } tblMax = (colCtx->memSize - memSize) / sizeof(SSNode); } diff --git a/soh/src/code/z_kaleido_manager.c b/soh/src/code/z_kaleido_manager.c index e6de580c5a1..ded4def1ede 100644 --- a/soh/src/code/z_kaleido_manager.c +++ b/soh/src/code/z_kaleido_manager.c @@ -22,7 +22,7 @@ KaleidoMgrOverlay* gKaleidoMgrCurOvl = NULL; u8 gBossMarkState = 0; void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl) { - //LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, __FILE__, __LINE__); + //LOG_CHECK_NULL_POINTER("KaleidoArea_allocp", sKaleidoAreaPtr); ovl->loadedRamAddr = sKaleidoAreaPtr; Overlay_Load(ovl->vromStart, ovl->vromEnd, ovl->vramStart, ovl->vramEnd, ovl->loadedRamAddr); @@ -63,7 +63,7 @@ void KaleidoManager_Init(GlobalContext* globalCtx) { osSyncPrintf(VT_RST); sKaleidoAreaPtr = GameState_Alloc(&globalCtx->state, largestSize, __FILE__, __LINE__); - LogUtils_CheckNullPointer("KaleidoArea_allocp", sKaleidoAreaPtr, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("KaleidoArea_allocp", sKaleidoAreaPtr); osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("KaleidoArea %08x - %08x\n", sKaleidoAreaPtr, (uintptr_t)sKaleidoAreaPtr + largestSize); diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c index 3425118b863..d524f32e4a6 100644 --- a/soh/src/code/z_map_mark.c +++ b/soh/src/code/z_map_mark.c @@ -59,7 +59,7 @@ void MapMark_Init(GlobalContext* globalCtx) { u32 overlaySize = (uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart; overlay->loadedRamAddr = GameState_Alloc(&globalCtx->state, overlaySize, __FILE__, __LINE__); - LogUtils_CheckNullPointer("dlftbl->allocp", overlay->loadedRamAddr, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("dlftbl->allocp", overlay->loadedRamAddr); Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr); diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 45b4b8fb804..79c8e1468a1 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -421,7 +421,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) { // "z_room.c: Data consistent with camera id does not exist camid=%d" osSyncPrintf(VT_COL(RED, WHITE) "z_room.c:カメラIDに一致するデータが存在しません camid=%d\n" VT_RST, camId); - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); return NULL; } @@ -496,7 +496,7 @@ void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) { } else if (polygon1->format == 2) { func_80096B6C(globalCtx, room, flags); } else { - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); } } diff --git a/soh/src/code/z_view.c b/soh/src/code/z_view.c index 920124815a5..7b9672dac83 100644 --- a/soh/src/code/z_view.c +++ b/soh/src/code/z_view.c @@ -296,7 +296,7 @@ s32 func_800AAA9C(View* view) { OPEN_DISPS(gfxCtx); vp = Graph_Alloc(gfxCtx, sizeof(Vp)); - LogUtils_CheckNullPointer("vp", vp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("vp", vp); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -307,7 +307,7 @@ s32 func_800AAA9C(View* view) { gSPViewport(POLY_KAL_DISP++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; width = view->viewport.rightX - view->viewport.leftX; @@ -315,7 +315,7 @@ s32 func_800AAA9C(View* view) { aspect = (f32)width / (f32)height; viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("viewing", viewing, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("viewing", viewing); view->viewingPtr = viewing; if (view->eye.x == view->lookAt.x && view->eye.y == view->lookAt.y && view->eye.z == view->lookAt.z) { @@ -473,7 +473,7 @@ s32 func_800AB0A8(View* view) { OPEN_DISPS(gfxCtx); vp = Graph_Alloc(gfxCtx, sizeof(Vp)); - LogUtils_CheckNullPointer("vp", vp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("vp", vp); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -485,7 +485,7 @@ s32 func_800AB0A8(View* view) { gSPViewport(OVERLAY_DISP++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; guOrtho(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, @@ -512,7 +512,7 @@ s32 func_800AB2C4(View* view) { OPEN_DISPS(gfxCtx); vp = Graph_Alloc(gfxCtx, sizeof(Vp)); - LogUtils_CheckNullPointer("vp", vp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("vp", vp); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -522,7 +522,7 @@ s32 func_800AB2C4(View* view) { gSPViewport(OVERLAY_DISP++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; guOrtho(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, @@ -550,7 +550,7 @@ s32 func_800AB560(View* view) { OPEN_DISPS(gfxCtx); vp = Graph_Alloc(gfxCtx, sizeof(Vp)); - LogUtils_CheckNullPointer("vp", vp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("vp", vp); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -560,7 +560,7 @@ s32 func_800AB560(View* view) { gSPViewport(OVERLAY_DISP++, vp); projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; width = view->viewport.rightX - view->viewport.leftX; @@ -575,7 +575,7 @@ s32 func_800AB560(View* view) { gSPMatrix(OVERLAY_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("viewing", viewing, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("viewing", viewing); view->viewingPtr = viewing; if (view->eye.x == view->lookAt.x && view->eye.y == view->lookAt.y && view->eye.z == view->lookAt.z) { @@ -622,7 +622,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { if (arg1 & 2) { vp = Graph_Alloc(gfxCtx, sizeof(Vp)); - LogUtils_CheckNullPointer("vp", vp, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("vp", vp); View_ViewportToVp(vp, &view->viewport); view->vp = *vp; @@ -635,7 +635,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { if (arg1 & 8) { projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; guOrtho(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f, @@ -646,7 +646,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); } else if (arg1 & 6) { projection = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("projection", projection, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("projection", projection); view->projectionPtr = projection; width = view->viewport.rightX - view->viewport.leftX; @@ -663,7 +663,7 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) { if (arg1 & 1) { viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("viewing", viewing, __FILE__, __LINE__); + LOG_CHECK_NULL_POINTER("viewing", viewing); view->viewingPtr = viewing; func_800ABE74(view->eye.x, view->eye.y, view->eye.z); diff --git a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c index d8b84d2ae40..4d1ab707e8f 100644 --- a/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c +++ b/soh/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c @@ -92,7 +92,7 @@ s32 EnHorseGameCheck_InitIngoRace(EnHorseGameCheckBase* base, GlobalContext* glo Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -250.0f, 1.0f, -1650.0f, 0, 0x4000, 0, 0x8003); if (this->ingoHorse == NULL) { - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); } this->startTimer = 0; this->finishTimer = 0; diff --git a/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index f88bf6b804c..439e71d9fd1 100644 --- a/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/soh/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -54,7 +54,7 @@ u32 EffectSsKakera_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, voi } else { osSyncPrintf("shape_modelがNULL\n"); - LogUtils_HungupThread(__FILE__, __LINE__); + LOG_HUNGUP_THREAD(); } this->draw = EffectSsKakera_Draw;