summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorJcw87 <Jcw87@users.noreply.github.com>2025-04-29 09:49:09 -0700
committerGitHub <noreply@github.com>2025-04-29 12:49:09 -0400
commit5e7b59f2fe2f0a7e39d2b7ba6f9e19f3bbdf3254 (patch)
tree07cf9ad7a5f7bf7423c0a520b8d64d024990136d /include/JSystem
parenteef20535ac9416dcdc8164ecb2c9d4b7bb50f365 (diff)
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
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/J3DGraphBase/J3DShape.h2
-rw-r--r--include/JSystem/J3DGraphBase/J3DTevs.h2
-rw-r--r--include/JSystem/J3DGraphLoader/J3DAnmLoader.h24
-rw-r--r--include/JSystem/J3DGraphLoader/J3DMaterialFactory.h6
-rw-r--r--include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h34
-rw-r--r--include/JSystem/JAudio/JAIAnimation.h2
-rw-r--r--include/JSystem/JAudio/JASDrumSet.h2
-rw-r--r--include/JSystem/JAudio/osdsp.h2
-rw-r--r--include/JSystem/JAudio/osdsp_task.h4
-rw-r--r--include/JSystem/JGadget/linklist.h2
-rw-r--r--include/JSystem/JMessage/processor.h4
-rw-r--r--include/JSystem/JParticle/JPAField.h2
-rw-r--r--include/JSystem/JStudio/JStudio/jstudio-control.h2
-rw-r--r--include/JSystem/JStudio/JStudio/stb.h2
-rw-r--r--include/JSystem/JStudio/JStudio_JAudio/control.h4
15 files changed, 49 insertions, 45 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h
index c96709d6..266636a8 100644
--- a/include/JSystem/J3DGraphBase/J3DShape.h
+++ b/include/JSystem/J3DGraphBase/J3DShape.h
@@ -55,7 +55,7 @@ public:
class J3DMaterial;
class J3DVertexData;
-class J3DDrawMtxData;
+struct J3DDrawMtxData;
enum J3DShpFlag {
J3DShpFlag_Hide = 0x0001,
diff --git a/include/JSystem/J3DGraphBase/J3DTevs.h b/include/JSystem/J3DGraphBase/J3DTevs.h
index 10f13e34..d3d75b26 100644
--- a/include/JSystem/J3DGraphBase/J3DTevs.h
+++ b/include/JSystem/J3DGraphBase/J3DTevs.h
@@ -204,7 +204,7 @@ struct J3DNBTScale : public J3DNBTScaleInfo {
Vec* getScale() { return &mScale; }
};
-class J3DTexCoord;
+struct J3DTexCoord;
void loadTexCoordGens(u32, J3DTexCoord*);
void loadNBTScale(J3DNBTScale& param_0);
diff --git a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h
index a97bf995..5199d4d9 100644
--- a/include/JSystem/J3DGraphLoader/J3DAnmLoader.h
+++ b/include/JSystem/J3DGraphLoader/J3DAnmLoader.h
@@ -7,29 +7,29 @@ enum J3DAnmLoaderDataBaseFlag { J3DLOADER_UNK_FLAG0 };
class J3DAnmBase;
class J3DAnmClusterFull;
-class J3DAnmClusterFullData;
+struct J3DAnmClusterFullData;
class J3DAnmClusterKey;
-class J3DAnmClusterKeyData;
+struct J3DAnmClusterKeyData;
class J3DAnmColorFull;
-class J3DAnmColorFullData;
+struct J3DAnmColorFullData;
class J3DAnmColorKey;
-class J3DAnmColorKeyData;
+struct J3DAnmColorKeyData;
class J3DAnmTevRegKey;
-class J3DAnmTevRegKeyData;
+struct J3DAnmTevRegKeyData;
class J3DAnmTexPattern;
-class J3DAnmTexPatternFullData;
+struct J3DAnmTexPatternFullData;
class J3DAnmTextureSRTKey;
-class J3DAnmTextureSRTKeyData;
+struct J3DAnmTextureSRTKeyData;
class J3DAnmTransformFull;
-class J3DAnmTransformFullData;
+struct J3DAnmTransformFullData;
class J3DAnmTransformKey;
-class J3DAnmTransformKeyData;
+struct J3DAnmTransformKeyData;
class J3DAnmVisibilityFull;
-class J3DAnmVisibilityFullData;
+struct J3DAnmVisibilityFullData;
class J3DAnmVtxColorFull;
-class J3DAnmVtxColorFullData;
+struct J3DAnmVtxColorFullData;
class J3DAnmVtxColorKey;
-class J3DAnmVtxColorKeyData;
+struct J3DAnmVtxColorKeyData;
struct J3DAnmLoaderDataBase {
static J3DAnmBase* load(const void*);
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
index 8b6c52c6..d97cb003 100644
--- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
+++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h
@@ -11,7 +11,7 @@ struct J3DMaterialDLBlock;
struct J3DMaterialInitData;
struct J3DIndInitData;
struct J3DColorChanInfo;
-struct J3DLightInfo;
+class J3DLightInfo;
struct J3DTexCoordInfo;
struct J3DTexCoord2Info;
struct J3DTexMtxInfo;
@@ -24,13 +24,13 @@ struct J3DAlphaCompInfo;
struct J3DBlendInfo;
struct J3DZModeInfo;
struct J3DNBTScaleInfo;
-struct J3DCurrentMtxInfo;
+class J3DCurrentMtxInfo;
struct J3DColorChan;
struct J3DGXColor;
struct J3DGXColorS10;
struct J3DTexCoord;
-struct J3DTexMtx;
+class J3DTexMtx;
struct J3DTevOrder;
struct J3DTevStage;
struct J3DTevSwapMode;
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h
index e1113eca..d4154791 100644
--- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h
+++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h
@@ -7,24 +7,24 @@
class J3DMaterial;
struct J3DMaterialBlock_v21;
-class J3DMaterialInitData_v21;
-class J3DIndInitData;
-class J3DColorChanInfo;
+struct J3DMaterialInitData_v21;
+struct J3DIndInitData;
+struct J3DColorChanInfo;
class J3DLightInfo;
-class J3DTexCoordInfo;
-class J3DTexCoord2Info;
-class J3DTexMtxInfo;
-class J3DTevOrderInfo;
-class J3DTevStageInfo;
-class J3DTevSwapModeInfo;
-class J3DTevSwapModeTableInfo;
-class J3DFogInfo;
-class J3DAlphaCompInfo;
-class J3DBlendInfo;
-class J3DZModeInfo;
-class J3DNBTScaleInfo;
-class J3DDisplayListInit;
-class J3DPatchingInfo;
+struct J3DTexCoordInfo;
+struct J3DTexCoord2Info;
+struct J3DTexMtxInfo;
+struct J3DTevOrderInfo;
+struct J3DTevStageInfo;
+struct J3DTevSwapModeInfo;
+struct J3DTevSwapModeTableInfo;
+struct J3DFogInfo;
+struct J3DAlphaCompInfo;
+struct J3DBlendInfo;
+struct J3DZModeInfo;
+struct J3DNBTScaleInfo;
+struct J3DDisplayListInit;
+struct J3DPatchingInfo;
class J3DCurrentMtxInfo;
struct J3DMaterialInitData_v21 {
diff --git a/include/JSystem/JAudio/JAIAnimation.h b/include/JSystem/JAudio/JAIAnimation.h
index bed199d7..9df25641 100644
--- a/include/JSystem/JAudio/JAIAnimation.h
+++ b/include/JSystem/JAudio/JAIAnimation.h
@@ -3,7 +3,7 @@
#include "dolphin/types.h"
-class Vec;
+struct Vec;
class JAISound;
class JAIBasic;
namespace JAInter {
diff --git a/include/JSystem/JAudio/JASDrumSet.h b/include/JSystem/JAudio/JASDrumSet.h
index f758d22e..fd3dee3f 100644
--- a/include/JSystem/JAudio/JASDrumSet.h
+++ b/include/JSystem/JAudio/JASDrumSet.h
@@ -5,7 +5,7 @@
namespace JASystem {
class TInstEffect;
- class TInstParam;
+ struct TInstParam;
class TDrumSet : public TInst {
public:
diff --git a/include/JSystem/JAudio/osdsp.h b/include/JSystem/JAudio/osdsp.h
index 7cc4d6a1..8e9e6e19 100644
--- a/include/JSystem/JAudio/osdsp.h
+++ b/include/JSystem/JAudio/osdsp.h
@@ -3,6 +3,6 @@
#include "dolphin/dsp.h"
-void DSPAddPriorTask(STRUCT_DSP_TASK*);
+void DSPAddPriorTask(DSPTaskInfo*);
#endif /* OSDSP_H */
diff --git a/include/JSystem/JAudio/osdsp_task.h b/include/JSystem/JAudio/osdsp_task.h
index 0000efd0..0a8db375 100644
--- a/include/JSystem/JAudio/osdsp_task.h
+++ b/include/JSystem/JAudio/osdsp_task.h
@@ -8,7 +8,11 @@ typedef struct OSContext OSContext;
extern DSPTaskInfo* DSP_prior_task;
+#ifdef __cplusplus
extern "C" void __DSPHandler(int, OSContext*);
+#else
+void __DSPHandler(int, OSContext*);
+#endif
void DsyncFrame2(u32, u32, u32);
void Dsp_Update_Request();
BOOL Dsp_Running_Check();
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index 2b60ce03..9ad3148d 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -184,7 +184,7 @@ struct TLinkList_factory : public TLinkList<T, I> {
virtual T* Do_create() = 0;
virtual void Do_destroy(T*) = 0;
void Erase_destroy(T* elem) {
- Erase(elem);
+ this->Erase(elem);
Do_destroy(elem);
}
};
diff --git a/include/JSystem/JMessage/processor.h b/include/JSystem/JMessage/processor.h
index f55597a5..b63e80be 100644
--- a/include/JSystem/JMessage/processor.h
+++ b/include/JSystem/JMessage/processor.h
@@ -7,7 +7,7 @@ namespace JMessage {
struct TReference;
struct TControl;
-struct TResource;
+class TResource;
struct TProcessor {
public:
@@ -80,7 +80,7 @@ public:
static const char* process_select_(TProcessor*);
void pushCurrent(const char*);
- const char* popCurrent();
+ void popCurrent();
void on_select_begin(OnSelectBeginCallBack, const void*, const char*, u32);
void on_select_end();
void on_select_separate();
diff --git a/include/JSystem/JParticle/JPAField.h b/include/JSystem/JParticle/JPAField.h
index f82dbadd..ec36021e 100644
--- a/include/JSystem/JParticle/JPAField.h
+++ b/include/JSystem/JParticle/JPAField.h
@@ -5,7 +5,7 @@
#include "JSystem/JGeometry.h"
class JPADataBlockLinkInfo;
-class JPAEmitterInfo;
+struct JPAEmitterInfo;
class JPAFieldData;
class JPABaseParticle;
class JPABaseField;
diff --git a/include/JSystem/JStudio/JStudio/jstudio-control.h b/include/JSystem/JStudio/JStudio/jstudio-control.h
index 234e2e66..3fca92ee 100644
--- a/include/JSystem/JStudio/JStudio/jstudio-control.h
+++ b/include/JSystem/JStudio/JStudio/jstudio-control.h
@@ -8,7 +8,7 @@
#include "dolphin/mtx/mtxvec.h"
namespace JStudio {
-struct TObject;
+class TObject;
struct TCreateObject {
TCreateObject() {}
virtual ~TCreateObject() = 0;
diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h
index 5735c928..03c68331 100644
--- a/include/JSystem/JStudio/JStudio/stb.h
+++ b/include/JSystem/JStudio/JStudio/stb.h
@@ -7,7 +7,7 @@
#include "global.h"
namespace JStudio {
-struct TObject;
+class TObject;
namespace stb {
class TControl;
diff --git a/include/JSystem/JStudio/JStudio_JAudio/control.h b/include/JSystem/JStudio/JStudio_JAudio/control.h
index d87b83b7..4e8010ab 100644
--- a/include/JSystem/JStudio/JStudio_JAudio/control.h
+++ b/include/JSystem/JStudio/JStudio_JAudio/control.h
@@ -5,8 +5,8 @@
#include "JSystem/JStudio/JStudio/jstudio-object.h"
#include "JSystem/JStage/JSGSystem.h"
-struct JAIBasic;
-struct JAISound;
+class JAIBasic;
+class JAISound;
namespace JStudio_JAudio {
typedef JStudio::TObject* (*JStudioAudioCreateFunc)(const JStudio::stb::data::TParse_TBlock_object&, JAIBasic*);
typedef void (JAISound::*TVVOSoundSetFunc)(f32, u32); // e.g. JAISound::setDirectVolume, JAISound::setDirectPitch