summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorMax Roncace <me@caseif.net>2026-03-18 01:38:05 -0400
committerGitHub <noreply@github.com>2026-03-17 22:38:05 -0700
commit6694c1b281a142972fce587bd20cd82ee65ab38f (patch)
tree2537d09d5ab3d270eaca5143a4f2f2f65f4ecb49 /include/d
parent9f340b604b5ac3d19d330b7bd6a2d7355c58bc27 (diff)
Fix a bunch of compiler warnings and document several more bugs (#3130)
Diffstat (limited to 'include/d')
-rw-r--r--include/d/actor/d_a_e_hz.h2
-rw-r--r--include/d/actor/d_a_npc2.h2
-rw-r--r--include/d/actor/d_a_npc_bouS.h2
-rw-r--r--include/d/actor/d_a_npc_gra.h2
-rw-r--r--include/d/actor/d_a_npc_grs.h2
-rw-r--r--include/d/actor/d_a_npc_gwolf.h2
-rw-r--r--include/d/actor/d_a_npc_kasi_hana.h3
-rw-r--r--include/d/actor/d_a_npc_kasi_kyu.h3
-rw-r--r--include/d/actor/d_a_npc_kasi_mich.h3
-rw-r--r--include/d/actor/d_a_npc_kn.h2
-rw-r--r--include/d/actor/d_a_npc_ks.h2
-rw-r--r--include/d/actor/d_a_npc_myna2.h2
-rw-r--r--include/d/actor/d_a_npc_ne.h2
-rw-r--r--include/d/actor/d_a_tag_push.h3
-rw-r--r--include/d/actor/d_a_tag_shop_item.h4
-rw-r--r--include/d/d_demo.h23
-rw-r--r--include/d/d_menu_window.h2
-rw-r--r--include/d/d_msg_scrn_howl.h3
18 files changed, 25 insertions, 39 deletions
diff --git a/include/d/actor/d_a_e_hz.h b/include/d/actor/d_a_e_hz.h
index 7e5902e016..539d808cf5 100644
--- a/include/d/actor/d_a_e_hz.h
+++ b/include/d/actor/d_a_e_hz.h
@@ -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
diff --git a/include/d/actor/d_a_npc2.h b/include/d/actor/d_a_npc2.h
index ea5548696a..d1d06d7764 100644
--- a/include/d/actor/d_a_npc2.h
+++ b/include/d/actor/d_a_npc2.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_bouS.h b/include/d/actor/d_a_npc_bouS.h
index bd3b1ff0b6..27eafb48fd 100644
--- a/include/d/actor/d_a_npc_bouS.h
+++ b/include/d/actor/d_a_npc_bouS.h
@@ -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);
diff --git a/include/d/actor/d_a_npc_gra.h b/include/d/actor/d_a_npc_gra.h
index 3209329a76..236755aba7 100644
--- a/include/d/actor/d_a_npc_gra.h
+++ b/include/d/actor/d_a_npc_gra.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_grs.h b/include/d/actor/d_a_npc_grs.h
index 202dd25267..d2a0c5359d 100644
--- a/include/d/actor/d_a_npc_grs.h
+++ b/include/d/actor/d_a_npc_grs.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_gwolf.h b/include/d/actor/d_a_npc_gwolf.h
index adcdb75adb..fcf5d804d0 100644
--- a/include/d/actor/d_a_npc_gwolf.h
+++ b/include/d/actor/d_a_npc_gwolf.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_kasi_hana.h b/include/d/actor/d_a_npc_kasi_hana.h
index 54b0cf914b..e355ed8c55 100644
--- a/include/d/actor/d_a_npc_kasi_hana.h
+++ b/include/d/actor/d_a_npc_kasi_hana.h
@@ -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;
}
diff --git a/include/d/actor/d_a_npc_kasi_kyu.h b/include/d/actor/d_a_npc_kasi_kyu.h
index 9ca549e46c..0387c563b7 100644
--- a/include/d/actor/d_a_npc_kasi_kyu.h
+++ b/include/d/actor/d_a_npc_kasi_kyu.h
@@ -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;
}
diff --git a/include/d/actor/d_a_npc_kasi_mich.h b/include/d/actor/d_a_npc_kasi_mich.h
index 9f38d3dd1c..e3782f1b27 100644
--- a/include/d/actor/d_a_npc_kasi_mich.h
+++ b/include/d/actor/d_a_npc_kasi_mich.h
@@ -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;
}
diff --git a/include/d/actor/d_a_npc_kn.h b/include/d/actor/d_a_npc_kn.h
index a14a89aefe..e97431baef 100644
--- a/include/d/actor/d_a_npc_kn.h
+++ b/include/d/actor/d_a_npc_kn.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_ks.h b/include/d/actor/d_a_npc_ks.h
index ba14540735..7ec5fd129d 100644
--- a/include/d/actor/d_a_npc_ks.h
+++ b/include/d/actor/d_a_npc_ks.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_myna2.h b/include/d/actor/d_a_npc_myna2.h
index bf97f43124..ac6af4d8f7 100644
--- a/include/d/actor/d_a_npc_myna2.h
+++ b/include/d/actor/d_a_npc_myna2.h
@@ -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;
diff --git a/include/d/actor/d_a_npc_ne.h b/include/d/actor/d_a_npc_ne.h
index 10474cc828..51f9f06e81 100644
--- a/include/d/actor/d_a_npc_ne.h
+++ b/include/d/actor/d_a_npc_ne.h
@@ -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;
diff --git a/include/d/actor/d_a_tag_push.h b/include/d/actor/d_a_tag_push.h
index 3a20b5ed77..a1f0b75b22 100644
--- a/include/d/actor/d_a_tag_push.h
+++ b/include/d/actor/d_a_tag_push.h
@@ -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;
}
diff --git a/include/d/actor/d_a_tag_shop_item.h b/include/d/actor/d_a_tag_shop_item.h
index 826f867ad8..1b04b6ef8e 100644
--- a/include/d/actor/d_a_tag_shop_item.h
+++ b/include/d/actor/d_a_tag_shop_item.h
@@ -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;
diff --git a/include/d/d_demo.h b/include/d/d_demo.h
index 45e99a85d9..ff0a2fe9de 100644
--- a/include/d/d_demo.h
+++ b/include/d/d_demo.h
@@ -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;
diff --git a/include/d/d_menu_window.h b/include/d/d_menu_window.h
index 35c6789127..65e415077d 100644
--- a/include/d/d_menu_window.h
+++ b/include/d/d_menu_window.h
@@ -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:
diff --git a/include/d/d_msg_scrn_howl.h b/include/d/d_msg_scrn_howl.h
index aa51249e17..bf28682d42 100644
--- a/include/d/d_msg_scrn_howl.h
+++ b/include/d/d_msg_scrn_howl.h
@@ -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 */