mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-10 22:31:52 -04:00
Improve compiler compatibility (#743)
* fix returns * use standard C headers * struct/class mismatch * explicit this in template * switch variable scope * C standard compliance * & l-value
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "JSystem/JUtility/JUTResource.h"
|
||||
#include "JSystem/J2DGraph/J2DPrint.h"
|
||||
#include "dolphin/gx/GXTransform.h"
|
||||
#include "__va_arg.h"
|
||||
#include "stdarg.h"
|
||||
|
||||
/* 802D51D8-802D5268 .text __ct__10J2DTextBoxFPCcPCc */
|
||||
J2DTextBox::J2DTextBox(const char* font, const char* str) : mpFont(NULL), mStringPtr(NULL) {
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JAudio/dspproc.h"
|
||||
#include "JSystem/JAudio/JASDSPInterface.h"
|
||||
#include "JSystem/JAudio/dsptask.h"
|
||||
|
||||
u16 DSP_CreateMap2(u32 param_1);
|
||||
|
||||
/* 8028E600-8028E648 .text DSPReleaseHalt2__FUl */
|
||||
void DSPReleaseHalt2(u32 msg) {
|
||||
u32 msgs[2];
|
||||
@@ -26,7 +27,7 @@ void DSPReleaseHalt() {
|
||||
static volatile BOOL flag;
|
||||
|
||||
/* 8028E6A0-8028E6AC .text setup_callback__FUs */
|
||||
void setup_callback(u16) {
|
||||
void setup_callback(u16 param_1) {
|
||||
flag = 0;
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ void DsetupTable(u32 param_1, u32 param_2, u32 param_3, u32 param_4, u32 param_5
|
||||
table[4] = param_5;
|
||||
flag = 1;
|
||||
DSPSendCommands2(table,5,setup_callback);
|
||||
while (true) {
|
||||
while (TRUE) {
|
||||
if (flag == 0) {
|
||||
return;
|
||||
}
|
||||
@@ -66,7 +67,7 @@ void DsyncFrame(u32 param_1, u32 param_2, u32 param_3) {
|
||||
static volatile BOOL d_waitflag;
|
||||
|
||||
/* 8028E7E0-8028E7EC .text dummy_callback__FUs */
|
||||
void dummy_callback(u16) {
|
||||
void dummy_callback(u16 param_1) {
|
||||
d_waitflag = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "global.h"
|
||||
|
||||
/* 8028E860-8028E898 .text DspHandShake__FPv */
|
||||
void DspHandShake(void*) {
|
||||
void DspHandShake(void* param_1) {
|
||||
while (DSPCheckMailFromDSP() == 0) {}
|
||||
DSPReadMailFromDSP();
|
||||
DSPCheckMailFromDSP();
|
||||
|
||||
@@ -54,7 +54,7 @@ void TProcessor::pushCurrent(const char* v) {
|
||||
}
|
||||
|
||||
/* 8029EEA4-8029EEC8 .text popCurrent__Q28JMessage10TProcessorFv */
|
||||
const char* TProcessor::popCurrent() {
|
||||
void TProcessor::popCurrent() {
|
||||
setCurrent_(mStack.top());
|
||||
mStack.pop();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "math.h"
|
||||
#include "arith.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
namespace JStudio {
|
||||
|
||||
|
||||
@@ -91,10 +91,10 @@ BOOL daPy_lk_c::checkNextActionBoomerangReady() {
|
||||
/* 8014984C-801498D8 .text checkNextActionBoomerangFly__9daPy_lk_cFv */
|
||||
BOOL daPy_lk_c::checkNextActionBoomerangFly() {
|
||||
if (checkBoomerangReadyAnime()) {
|
||||
checkNextActionBoomerangReady();
|
||||
return checkNextActionBoomerangReady();
|
||||
} else {
|
||||
if (itemTrigger() && mEquipItem == getReadyItem()) {
|
||||
setActAnimeUpper(
|
||||
return setActAnimeUpper(
|
||||
LKANM_BCK_BOOMWAIT,
|
||||
UPPER_MOVE2_e,
|
||||
daPy_HIO_boom_c0::m.field_0x18,
|
||||
@@ -112,9 +112,9 @@ BOOL daPy_lk_c::checkNextBoomerangMode() {
|
||||
seStartOnlyReverb(JA_SE_LK_ITEM_TAKEOUT);
|
||||
}
|
||||
if (mpAttention->Lockon()) {
|
||||
procBoomerangMove_init();
|
||||
return procBoomerangMove_init();
|
||||
} else {
|
||||
procBoomerangSubject_init();
|
||||
return procBoomerangSubject_init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ void daPy_lk_c::setBottleModel(u16 param_0) {
|
||||
fopAc_ac_c* daPy_lk_c::makeFairy(cXyz* param_0, u32 param_1) {
|
||||
onResetFlg0(daPyRFlg0_FAIRY_USE);
|
||||
resetCurse();
|
||||
fopAcM_fastCreate(PROC_NPC_FA1, param_1, param_0, fopAcM_GetRoomNo(this), &shape_angle);
|
||||
return (fopAc_ac_c*)fopAcM_fastCreate(PROC_NPC_FA1, param_1, param_0, fopAcM_GetRoomNo(this), &shape_angle);
|
||||
}
|
||||
|
||||
/* 801521A0-80152300 .text procBottleDrink_init__9daPy_lk_cFUs */
|
||||
|
||||
@@ -187,9 +187,9 @@ BOOL daPy_lk_c::checkNextHookshotMode() {
|
||||
seStartOnlyReverb(JA_SE_LK_ITEM_TAKEOUT);
|
||||
}
|
||||
if (mpAttention->Lockon()) {
|
||||
procHookshotMove_init();
|
||||
return procHookshotMove_init();
|
||||
} else {
|
||||
procHookshotSubject_init();
|
||||
return procHookshotSubject_init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ f32 daPy_lk_c::checkRopeRoofHit(s16 param_0) {
|
||||
|
||||
local_c.set(current.pos.x - 15.0f * cM_ssin(param_0), current.pos.y, current.pos.z - 15.0f * cM_scos(param_0));
|
||||
mRoofChk.SetPos(local_c);
|
||||
dComIfG_Bgsp()->RoofChk(&mRoofChk);
|
||||
return dComIfG_Bgsp()->RoofChk(&mRoofChk);
|
||||
}
|
||||
|
||||
/* 80142E98-80142FC8 .text changeRopeSwingProc__9daPy_lk_cFv */
|
||||
@@ -317,9 +317,9 @@ BOOL daPy_lk_c::checkNextRopeMode() {
|
||||
seStartOnlyReverb(JA_SE_LK_ITEM_TAKEOUT);
|
||||
}
|
||||
if (mpAttention->Lockon()) {
|
||||
procRopeMove_init();
|
||||
return procRopeMove_init();
|
||||
} else {
|
||||
procRopeSubject_init();
|
||||
return procRopeSubject_init();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2276,7 +2276,7 @@ void dCamera_c::checkGroundInfo() {
|
||||
|
||||
/* 8016A0F0-8016A110 .text followCamera2__9dCamera_cFl */
|
||||
bool dCamera_c::followCamera2(s32 param_0) {
|
||||
followCamera(param_0);
|
||||
return followCamera(param_0);
|
||||
}
|
||||
|
||||
/* 8016A110-8016C4F8 .text followCamera__9dCamera_cFl */
|
||||
|
||||
+4
-2
@@ -624,7 +624,7 @@ bool dMesg_tSequenceProcessor::do_tag(u32 param_1, const void* param_2, u32 para
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x10000:
|
||||
case 0x10000: {
|
||||
u16 r24 = param_1 & 0xFFFF;
|
||||
s8 tmp = dComIfGp_getReverb(dComIfGp_roomControl_getStayNo());
|
||||
if (r24 == 8) {
|
||||
@@ -634,6 +634,7 @@ bool dMesg_tSequenceProcessor::do_tag(u32 param_1, const void* param_2, u32 para
|
||||
}
|
||||
r29 = true;
|
||||
break;
|
||||
}
|
||||
case 0x20000:
|
||||
dComIfGp_setMesgCameraTagInfo(u16(param_1));
|
||||
r29 = true;
|
||||
@@ -1552,7 +1553,8 @@ void dMesg_screenDataItem_c::createScreen() {
|
||||
J2DPane* pane = field_0x1b4.pane;
|
||||
f32 y = (field_0x1b4.mSize.y * 0.5f + pane->mScreenBounds.i.y - 240.0f) - 10.0f;
|
||||
f32 x = (field_0x1b4.mSize.x * 0.5f + pane->mScreenBounds.i.x - 320.0f) + 10.0f;
|
||||
field_0x3e4 = dComIfGp_particle_set2Dfore(0x2e1, &cXyz(x, y, 0.0f));
|
||||
cXyz pos(x, y, 0.0f);
|
||||
field_0x3e4 = dComIfGp_particle_set2Dfore(0x2e1, &pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class J2DTextBox;
|
||||
class fopMsgM_pane_class;
|
||||
struct fopMsgM_pane_class;
|
||||
|
||||
J2DPicture* button_icon[8];
|
||||
J2DPicture* button_kage[8];
|
||||
|
||||
@@ -144,8 +144,7 @@ static struct {
|
||||
/* 0x3B */ {PRESIDENT_STATUE, "beast_12.bti"},
|
||||
};
|
||||
|
||||
class mesg_header;
|
||||
class fopMsgM_pane_alpha_class;
|
||||
struct fopMsgM_pane_alpha_class;
|
||||
|
||||
|
||||
/* 8002ABB4-8002AC1C .text drawSelf__9MyPictureFff */
|
||||
@@ -647,6 +646,7 @@ char* fopMsgM_messageGet(char* dst, u32 msgNo) {
|
||||
}
|
||||
|
||||
dst[numRead] = '\0';
|
||||
return dst;
|
||||
}
|
||||
|
||||
/* 8002BE04-8002C02C .text fopMsgM_passwordGet__FPcUl */
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <printf.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static u8 sTmpBuf[0x2000] ALIGN_DECL(32);
|
||||
static u8 sTmpBuf2[0x2000] ALIGN_DECL(32);
|
||||
|
||||
Reference in New Issue
Block a user