Fix a bunch of compiler warnings and document several more bugs (#3130)

This commit is contained in:
Max Roncace
2026-03-18 01:38:05 -04:00
committed by GitHub
parent 9f340b604b
commit 6694c1b281
109 changed files with 416 additions and 207 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ private:
/* 0x6B4 */ s16 field_0x6b4;
/* 0x6B6 */ s16 field_0x6b6;
/* 0x6B8 */ u8 field_0x6B8[0x6BC - 0x6B8];
/* 0x6BC */ char* mpName;
/* 0x6BC */ const char* mpName;
/* 0x6C0 */ s32 mAction;
/* 0x6C4 */ s32 mPrevAction;
/* 0x6C8 */ s32 mMode; // That's just a guess. Might need a better name for it's usage
+1 -1
View File
@@ -134,7 +134,7 @@ public:
/* 0x842 */ u16 field_0x842;
/* 0x844 */ u8 field_0x844;
/* 0x845 */ u8 field_0x845[0x848 - 0x845];
/* 0x848 */ s32 field_0x848;
/* 0x848 */ s32 mFlowID;
/* 0x84C */ dMsgFlow_c mMsgFlow;
/* 0x898 */ u8 field_0x898[0x89A - 0x898];
/* 0x89A */ s16 mEvtIdx;
+1 -1
View File
@@ -72,7 +72,7 @@ public:
void setExpression(int, f32);
bool talk(void*);
bool demo(void*);
inline fopAc_ac_c* searchInstructionTag();
inline fopAc_ac_c* searchInstructionTag();
bool instruction(void*);
bool checkIntroDemoStart();
int EvCut_BousIntroSumo1(int);
+1 -1
View File
@@ -160,7 +160,7 @@ private:
/* 0x14B0 */ int field_0x1460;
/* 0x1464 */ int field_0x1464;
/* 0x1468 */ int field_0x1468;
/* 0x146C */ int field_0x146C;
/* 0x146C */ int mFlowID;
/* 0x1470 */ s16 mLookMode;
/* 0x1472 */ u16 field_0x1472;
/* 0x1474 */ u8 mType;
+1 -1
View File
@@ -103,7 +103,7 @@ private:
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE0C */ int field_0xe0c;
/* 0xE0C */ int mFlowID;
/* 0xE10 */ s16 mLookMode;
/* 0xE12 */ u16 mActionState;
/* 0xE14 */ u8 mType;
+1 -1
View File
@@ -121,7 +121,7 @@ private:
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE08 */ int field_0xe08;
/* 0xE08 */ int mFlowID;
/* 0xE0C */ s16 mLookMode;
/* 0xE0E */ u16 mMode;
/* 0xE10 */ u8 mType;
+2 -1
View File
@@ -182,7 +182,8 @@ public:
s16 getMessageNo() { return s16(home.angle.x); }
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+2 -1
View File
@@ -98,7 +98,8 @@ public:
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+2 -1
View File
@@ -99,7 +99,8 @@ public:
s8 getType() {
s8 rv = fopAcM_GetParam(this) & 0xFF;
// !@bug Comparison of s8 with 0xFF will always evaluate to false
if (rv == 0xFF) {
rv = 0;
}
+1 -1
View File
@@ -77,7 +77,7 @@ public:
class daNpc_Kn_prtclMngr_c {
public:
/* 0x00 */ bool mpModel;
/* 0x00 */ bool field_0x00;
/* 0x04 */ cXyz mPos;
/* 0x10 */ csXyz mAngle;
/* 0x18 */ cXyz mScale;
+1 -1
View File
@@ -89,7 +89,7 @@ public:
/* 0x5B7 */ u8 field_0x5b7;
/* 0x5B8 */ int order;
/* 0x5BC */ int bitTRB;
/* 0x5C0 */ char* res_name;
/* 0x5C0 */ const char* res_name;
/* 0x5C4 */ f32 dis;
/* 0x5C8 */ s16 target_angle;
/* 0x5CC */ mDoExt_McaMorfSO* model;
+1 -1
View File
@@ -104,7 +104,7 @@ public:
/* 0xDF8 */ int field_0xdf8;
/* 0xDFC */ int field_0xdfc;
/* 0xE00 */ int field_0xe00;
/* 0xE04 */ int field_0xe04;
/* 0xE04 */ int mFlowID;
/* 0xE08 */ s16 mLookMode;
/* 0xE0A */ u16 mMode;
/* 0xE0C */ u8 mType;
+1 -1
View File
@@ -95,7 +95,7 @@ public:
/* 0x5D8 */ f32 mDistToTarget;
/* 0x5DC */ s16 mAngleToPlayer;
/* 0x5E0 */ f32 mDistScale;
/* 0x5E4 */ char* mResName;
/* 0x5E4 */ const char* mResName;
/* 0x5E8 */ mDoExt_McaMorf* mpMorf;
/* 0x5EC */ mDoExt_btkAnm* mpBtkAnm;
/* 0x5F0 */ mDoExt_btpAnm* mpBtpAnm;
+3
View File
@@ -24,6 +24,9 @@ public:
u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
u32 getFlowNodeNo() {
// !@bug home.angle.x is promoted to a 32-bit signed integer prior
// to being compared, so the compared value can never exceed
// SHORT_MAX and the condition always passes.
if (home.angle.x != 0xFFFF) {
return (u16)home.angle.x;
}
+4
View File
@@ -19,6 +19,10 @@ public:
u32 getProcessID() { return mProcessID; }
int getFlowNodeNum() {
return (u16)home.angle.x == 0xFFFF ? -1 : (u16)home.angle.x;
}
/* 0x56C */ u32 mProcessID;
/* 0x570 */ s16 mCreateTimer;
/* 0x572 */ u8 field_0x572;
+1 -22
View File
@@ -336,27 +336,6 @@ public:
virtual JPABaseEmitter* emitter_create(u32);
};
namespace {
class jstudio_tAdaptor_message : public JStudio::TAdaptor_message {
public:
typedef JStudio::TObject_message ObjectType;
jstudio_tAdaptor_message() {}
virtual ~jstudio_tAdaptor_message();
virtual void adaptor_do_MESSAGE(JStudio::data::TEOperationData, const void*, u32);
};
class jstudio_tCreateObject_message : public JStudio::TCreateObject {
public:
jstudio_tCreateObject_message() {}
virtual ~jstudio_tCreateObject_message();
virtual bool create(JStudio::TObject**, const JStudio::stb::data::TParse_TBlock_object&);
};
}; // namespace
int dDemo_setDemoData(fopAc_ac_c*, u8, mDoExt_McaMorf*, char const*, int, u16*, u32, s8);
class dDemo_c {
@@ -405,7 +384,7 @@ public:
static JStudio_JStage::TCreateObject* m_stage;
static JStudio_JAudio2::TCreateObject* m_audio;
static dDemo_particle_c* m_particle;
static jstudio_tCreateObject_message* m_message;
static JStudio::TCreateObject* m_message;
static JStudio::TFactory* m_factory;
static jmessage_tControl* m_mesgControl;
static dDemo_object_c* m_object;
+1 -1
View File
@@ -190,7 +190,7 @@ public:
bool isPauseWindow() { return mPauseWindow != false; }
void onShowFlag() { mShowFlag |= 1; }
void offShowFlag() { mShowFlag &= ~1; }
bool isShowFlag() { return mShowFlag & 1 != 0; }
bool isShowFlag() { return (mShowFlag & 1) != 0; }
bool isFadeNowCheck() { return mDoGph_gInf_c::getFader()->getStatus() == 1; }
private:
-3
View File
@@ -112,7 +112,4 @@ struct dMsgScrnHowl_c : public dMsgScrnBase_c {
/* 0x27A8 */ f32 field_0x27a8;
};
#define LINE_MAX 30
#define PLOT_BUFFER_MAX_e 0x300
#endif /* MSG_SCRN_D_MSG_SCRN_HOWL_H */
+9 -9
View File
@@ -425,11 +425,11 @@ inline void fopAcM_SetAngle(fopAc_ac_c* i_actor, s16 x, s16 y, s16 z) {
i_actor->current.angle.set(x, y, z);
}
inline void dComIfGs_onSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offSwitch(int i_no, int i_roomNo);
inline void dComIfGs_revSwitch(int i_no, int i_roomNo);
inline BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
inline void dComIfGs_offActor(int i_no, int i_roomNo);
void dComIfGs_onSwitch(int i_no, int i_roomNo);
void dComIfGs_offSwitch(int i_no, int i_roomNo);
void dComIfGs_revSwitch(int i_no, int i_roomNo);
BOOL dComIfGs_isSwitch(int i_no, int i_roomNo);
void dComIfGs_offActor(int i_no, int i_roomNo);
inline void fopAcM_onSwitch(const fopAc_ac_c* i_actor, int sw) {
return dComIfGs_onSwitch(sw, fopAcM_GetHomeRoomNo(i_actor));
@@ -451,12 +451,12 @@ inline fopAc_ac_c* fopAcM_SearchByName(s16 proc_id) {
return (fopAc_ac_c*)fopAcIt_Judge(fpcSch_JudgeForPName, &proc_id);
}
inline void dComIfGs_onItem(int bitNo, int roomNo);
void dComIfGs_onItem(int bitNo, int roomNo);
inline void fopAcM_onItem(const fopAc_ac_c* item, int bitNo) {
dComIfGs_onItem(bitNo, fopAcM_GetHomeRoomNo(item));
}
inline bool dComIfGs_isItem(int bitNo, int roomNo);
bool dComIfGs_isItem(int bitNo, int roomNo);
inline bool fopAcM_isItem(const fopAc_ac_c* item, int bitNo) {
return dComIfGs_isItem(bitNo, fopAcM_GetHomeRoomNo(item));
}
@@ -469,7 +469,7 @@ inline int fopAcM_GetSetId(const fopAc_ac_c* i_actor) {
return i_actor->setID;
}
inline void dComIfGs_onActor(int bitNo, int roomNo);
void dComIfGs_onActor(int bitNo, int roomNo);
inline void fopAcM_onActor(const fopAc_ac_c* i_actor) {
dComIfGs_onActor(fopAcM_GetSetId(i_actor), fopAcM_GetHomeRoomNo(i_actor));
@@ -704,7 +704,7 @@ inline void make_prm_warp_hole(u32* o_params, u8 prm1, u8 prm2, u8 prm3) {
*o_params = pprm2 | pprm3 | pprm1;
}
inline fopAc_ac_c* dComIfGp_getPlayer(int);
fopAc_ac_c* dComIfGp_getPlayer(int);
inline s16 fopAcM_searchPlayerAngleY(const fopAc_ac_c* actor) {
return fopAcM_searchActorAngleY(actor, dComIfGp_getPlayer(0));
+12 -1
View File
@@ -106,7 +106,7 @@ static const float INF = 2000000000.0f;
#define NO_INLINE
#endif
#endif
// Hack to trick the compiler into not inlining functions that use this macro.
#define FORCE_DONT_INLINE \
(void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; (void*)0; \
@@ -176,4 +176,15 @@ static const float INF = 2000000000.0f;
using std::isnan;
#endif
// Comparing a non-volatile reference type to NULL is tautological
// and triggers a warning on modern compilers, but in some cases is
// required to match the original assembly.
#if defined(__MWERKS__) || defined(DECOMPCTX)
#define IS_REF_NULL(r) (&(r) == NULL)
#define IS_REF_NONNULL(r) (&(r) != NULL)
#else
#define IS_REF_NULL(r) (0)
#define IS_REF_NONNULL(r) (1)
#endif
#endif