Various debug conditional compilation cleanup (#2915)

* Global: Define DEBUG as 0 if not already defined

* Clean up DEBUG-guarded code
This commit is contained in:
Max Roncace
2025-12-06 13:34:47 -08:00
committed by GitHub
parent 9f1a648851
commit a30e617e5a
316 changed files with 1133 additions and 1267 deletions
+1 -1
View File
@@ -119,7 +119,7 @@ namespace JASDsp {
extern FxBuf* FX_BUF;
extern f32 sDSPVolume;
#ifdef DEBUG
#if DEBUG
extern s32 dspMutex;
#endif
};
+1 -1
View File
@@ -33,7 +33,7 @@ private:
int mLine;
};
#ifdef DEBUG
#if DEBUG
#define JGADGET_ASSERTWARN(line, COND) \
((COND)) || (JGadget_outMessage(JGadget_outMessage::warning, __FILE__, line) << #COND, false);
+2 -2
View File
@@ -35,14 +35,14 @@ struct JORServer;
class JOREventListener {
public:
#ifdef DEBUG
#if DEBUG
virtual void listenPropertyEvent(const JORPropertyEvent*) = 0;
#endif
};
class JORReflexible : public JOREventListener {
public:
#ifdef DEBUG
#if DEBUG
JORReflexible();
static JORServer* getJORServer();
+1 -1
View File
@@ -266,7 +266,7 @@ inline JKRHeap* JKRGetRootHeap2() {
}
#endif
#ifdef DEBUG
#if DEBUG
inline void JKRSetDebugFillNotuse(u8 status) { data_804508B1 = status; }
inline void JKRSetDebugFillNew(u8 status) { data_804508B2 = status; }
inline void JKRSetDebugFillDelete(u8 status) { data_804508B3 = status; }
+12 -11
View File
@@ -313,7 +313,7 @@ public:
>
{
TIterator_data_(const TFunctionValue_list_parameter& rParent, const f32* value) {
#ifdef DEBUG
#if DEBUG
pOwn_ = &rParent;
#endif
pf_ = value;
@@ -323,7 +323,7 @@ public:
void set(const f32* value) { pf_ = value; }
friend bool operator==(const TIterator_data_& r1, const TIterator_data_& r2) {
#ifdef DEBUG
#if DEBUG
if (!(r1.pOwn_==r2.pOwn_)) {
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
msg << "r1.pOwn_==r2.pOwn_";
@@ -333,9 +333,10 @@ public:
}
f32 operator*() {
#ifdef DEBUG
// this guard is required - removing it breaks float regalloc in std::upper_bound
#if DEBUG
JUT_ASSERT(947, pf_!=NULL);
#endif
#endif
return *pf_;
}
@@ -357,7 +358,7 @@ public:
}
friend s32 operator-(const TIterator_data_& r1, const TIterator_data_& r2) {
#ifdef DEBUG
#if DEBUG
if (!(r1.pOwn_==r2.pOwn_)) {
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
msg << "r1.pOwn_==r2.pOwn_";
@@ -366,7 +367,7 @@ public:
return (r1.pf_ - r2.pf_) / suData_size;
}
#ifdef DEBUG
#if DEBUG
/* 0x00 */ const TFunctionValue_list_parameter* pOwn_;
/* 0x04 */ const f32* pf_;
#else
@@ -421,7 +422,7 @@ public:
>
{
TIterator_data_(const TFunctionValue_hermite& rParent, const f32* value) {
#ifdef DEBUG
#if DEBUG
pOwn_ = &rParent;
#endif
pf_ = value;
@@ -435,7 +436,7 @@ public:
}
friend bool operator==(const TIterator_data_& r1, const TIterator_data_& r2) {
#ifdef DEBUG
#if DEBUG
if (!(r1.pOwn_==r2.pOwn_)) {
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
msg << "r1.pOwn_==r2.pOwn_";
@@ -445,7 +446,7 @@ public:
}
f32 operator*() {
#ifdef DEBUG
#if DEBUG
JUT_ASSERT(1098, pf_!=NULL);
#endif
return *pf_;
@@ -469,7 +470,7 @@ public:
}
friend s32 operator-(const TIterator_data_& r1, const TIterator_data_& r2) {
#ifdef DEBUG
#if DEBUG
if (!(r1.pOwn_==r2.pOwn_)) {
JGadget_outMessage msg(JGadget_outMessage::warning, __FILE__, 124);
msg << "r1.pOwn_==r2.pOwn_";
@@ -483,7 +484,7 @@ public:
return (r1.pf_ - r2.pf_) / r1.uSize_;
}
#ifdef DEBUG
#if DEBUG
/* 0x00 */ const TFunctionValue_hermite* pOwn_;
/* 0x04 */ const f32* pf_;
/* 0x08 */ u32 uSize_;
@@ -47,7 +47,7 @@ struct TVariableValue {
}
void setValue_none() {
#ifdef DEBUG
#if DEBUG
field_0xc.fv = NULL;
#endif
field_0x8 = NULL;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "dolphin/os.h"
#ifdef DEBUG
#if DEBUG
#define JUT_SHOW_ASSERT(LINE, COND) JUTAssertion::showAssert(JUTAssertion::getSDevice(), __FILE__, LINE, #COND)
#define JUT_ASSERT(LINE, COND) \
+2 -2
View File
@@ -15,14 +15,14 @@ public:
/* 0x0400 */ cCcD_Obj* mpObjTg[0x300];
/* 0x1000 */ cCcD_Obj* mpObjCo[0x100];
/* 0x1400 */ cCcD_Obj* mpObj[0x500];
#ifdef DEBUG
#if DEBUG
/* 0x2800 */ int m_debug_code;
#endif
/* 0x2800 */ u16 mObjAtCount;
/* 0x2802 */ u16 mObjTgCount;
/* 0x2804 */ u16 mObjCoCount;
/* 0x2806 */ u16 mObjCount;
#ifdef DEBUG
#if DEBUG
/* 0x280C */ u16 field_0x280c;
/* 0x280E */ u16 field_0x280e;
/* 0x2810 */ u16 field_0x2810;
+1 -1
View File
@@ -198,7 +198,7 @@ public:
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; }
#ifdef DEBUG
#if DEBUG
f32 field_0x00_debug;
u8 field_0x04_debug;
#endif
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -87,7 +87,7 @@ public:
/* 0x0568 */ cXyz field_0x568;
/* 0x0574 */ csXyz field_0x574;
#ifdef DEBUG
#if DEBUG
cXyz debug_field_0x570;
csXyz debug_field_0x57c;
#endif
+1 -1
View File
@@ -77,7 +77,7 @@ public:
/* 0x70C */ dBgS_AcchCir mAcchCir;
/* 0x74C */ dBgS_ObjAcch mAcch;
/* 0x924 */ u8 field_0x924;
#ifndef DEBUG
#if !DEBUG
/* 0x928 */ f32 field_0x928;
#endif
/* 0x92C */ dCcD_Stts mStts;
-2
View File
@@ -131,9 +131,7 @@ public:
int bullRunning(void*);
int skipFence(void*);
int talk(void*);
#ifdef DEBUG
int test(void*);
#endif
daNpc_Aru_c(
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
daNpcT_motionAnmData_c const* i_motionAnmData,
+3 -3
View File
@@ -54,7 +54,7 @@ struct daNpcCd_HIO_Jnt_c : public JORReflexible {
virtual ~daNpcCd_HIO_Jnt_c() {}
daNpcCd_HIO_Jnt_c() {}
#ifdef DEBUG
#if DEBUG
void genMessage(JORMContext*);
#endif
@@ -66,7 +66,7 @@ struct daNpcCd_HIO_Child_c : public JORReflexible {
virtual ~daNpcCd_HIO_Child_c() {}
daNpcCd_HIO_Child_c() {}
#ifdef DEBUG
#if DEBUG
void genMessage(JORMContext*);
#endif
@@ -91,7 +91,7 @@ public:
daNpcCd_HIO_c();
virtual ~daNpcCd_HIO_c() {}
#ifdef DEBUG
#if DEBUG
void genMessage(JORMContext*);
#endif
+1 -1
View File
@@ -274,7 +274,7 @@ public:
}
void setCollision() {
#ifdef DEBUG
#if DEBUG
mCyl.SetR(Cd2_HIO_cylR(m_type));
mCyl.SetH(Cd2_HIO_cylH(m_type));
#endif
+1 -3
View File
@@ -74,10 +74,8 @@ public:
OS_REPORT("|%06d:%x|daNpc_Doc_c -> コンストラクト\n", g_Counter.mCounter0, this);
}
#if DEBUG
int test(void*);
#endif
BOOL checkChangeJoint(int i_jointNo) { return i_jointNo == 4; }
BOOL checkRemoveJoint(int i_jointNo) { return i_jointNo == 8; }
s32 getBackboneJointNo() { return 1; }
-2
View File
@@ -196,9 +196,7 @@ public:
BOOL setAction(actionFunc, int);
int wait(int);
int talk(int);
#if DEBUG
int test(int);
#endif
void AppearDemoCall();
void ReturnDemoCall();
void PresentDemoCall();
+8 -7
View File
@@ -13,13 +13,19 @@
*
*/
#if DEBUG
#define NPC_GRMC_HIO_CLASS daNpc_grMC_HIO_c
#else
#define NPC_GRMC_HIO_CLASS daNpc_grMC_Param_c
#endif
struct daNpc_grMC_HIOParam {
/* 0x0 */ daNpcT_HIOParam common;
};
class daNpc_grMC_HIO_c : public mDoHIO_entry_c {
public:
/* 0x8 */ daNpc_grMC_HIOParam param;
/* 0x8 */ daNpc_grMC_HIOParam m;
};
class daNpc_grMC_Param_c {
@@ -92,9 +98,7 @@ public:
int tend(void*);
int talk(void*);
int shop(void*);
#ifdef DEBUG
int test(void*);
#endif
daNpc_grMC_c(
daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData,
daNpcT_motionAnmData_c const* i_motionAnmData,
@@ -118,10 +122,7 @@ public:
static cutFunc mCutList[1];
private:
#ifdef DEBUG
/* 0xFCC */ daNpc_grMC_HIO_c* mHIO;
#endif
/* 0x0F7C */ u8 field_0xf7c[0xf80 - 0xf7c];
/* 0x0F7C */ NPC_GRMC_HIO_CLASS* mHIO;
/* 0x0F80 */ dCcD_Cyl mCyl;
/* 0x10BC */ u8 mType;
/* 0x10C0 */ actionFunc mNextAction;
+1 -1
View File
@@ -17,7 +17,7 @@ struct daNpc_grR_HIOParam {
};
class daNpc_grR_HIO_c
#ifdef DEBUG
#if DEBUG
: public mDoHIO_entry_c
#endif
{
-2
View File
@@ -91,9 +91,7 @@ public:
virtual void evtOrder();
virtual int drawDbgInfo();
#if DEBUG
int test(void*);
#endif
bool getGameStartFlag() { return mGameStartFlag; }
void setPotBreakFlag() { mPotBreakFlag = true; }

Some files were not shown because too many files have changed in this diff Show More