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) \