diff options
| author | Luke Street <luke@street.dev> | 2026-02-28 21:19:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-28 20:19:17 -0800 |
| commit | 6a48380461bc9baabe1706ba57ca0cedfa2d0c51 (patch) | |
| tree | 593e054cfcb0250e63917c58b445a7e1f025a023 /include/JSystem/JAudio2 | |
| parent | b5d3b8c059c10711370437f7db7539cd90f1cb29 (diff) | |
More GCC compatibility/warning fixes (#3118)
* Wrap >4-char literals in a MULTI_CHAR macro
Modern compilers do not support CW's non-standard behavior with
>4 char literals. We can, however, use a constexpr function to
compute the u64 values directly. This leaves <=4 char literals
unchanged.
* Replace non-pointer usages of NULL with 0
* Define NULL to nullptr on C++11 and above
* Fix more -Wpointer-arith and -Woverflow warnings
* Replace u32/s32 with uintptr_t/intptr_t where appropriate
* JSUOutputStream: Overload all standard int types
Diffstat (limited to 'include/JSystem/JAudio2')
| -rw-r--r-- | include/JSystem/JAudio2/JAISeMgr.h | 4 | ||||
| -rw-r--r-- | include/JSystem/JAudio2/JAISound.h | 7 | ||||
| -rw-r--r-- | include/JSystem/JAudio2/JASDSPInterface.h | 2 | ||||
| -rw-r--r-- | include/JSystem/JAudio2/JASResArcLoader.h | 6 |
4 files changed, 10 insertions, 9 deletions
diff --git a/include/JSystem/JAudio2/JAISeMgr.h b/include/JSystem/JAudio2/JAISeMgr.h index 50f81fb1b4..928d85525b 100644 --- a/include/JSystem/JAudio2/JAISeMgr.h +++ b/include/JSystem/JAudio2/JAISeMgr.h @@ -15,7 +15,7 @@ struct JASNonCopyable { JASNonCopyable() {} ~JASNonCopyable() {} - /* 0x0 */ int field_0x0; + /* 0x0 */ void* field_0x0; }; // Size: 0x4 /** @@ -56,7 +56,7 @@ public: mParams.init(); mMaxActiveSe = 0; mMaxInactiveSe = 0; - field_0x0 = 0; + field_0x0 = NULL; } virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion); diff --git a/include/JSystem/JAudio2/JAISound.h b/include/JSystem/JAudio2/JAISound.h index 5e414ade24..5e1cd40b4b 100644 --- a/include/JSystem/JAudio2/JAISound.h +++ b/include/JSystem/JAudio2/JAISound.h @@ -5,6 +5,7 @@ #include "JSystem/JAudio2/JAIAudible.h" #include "JSystem/JUtility/JUTAssert.h" #include "global.h" +#include <cstdint> class JAISound; @@ -134,7 +135,7 @@ struct JAISoundStatus_ { u8 flag8 : 1; } flags; } state; - /* 0x4 */ u32 userdata_; + /* 0x4 */ uintptr_t userdata_; }; // Size: 0x8 /** @@ -294,8 +295,8 @@ public: void setAnimationState(u32 state) { status_.state.flags.animationState = state; } - u32 getUserData() const { return status_.userdata_; } - void setUserData(u32 userData) { status_.userdata_ = userData; } + uintptr_t getUserData() const { return status_.userdata_; } + void setUserData(uintptr_t userData) { status_.userdata_ = userData; } JAIAudible* getAudible() { return audible_; } bool isHandleAttached() const { return handle_ != NULL; } bool hasLifeTime() const { return status_.field_0x1.flags.flag2; } diff --git a/include/JSystem/JAudio2/JASDSPInterface.h b/include/JSystem/JAudio2/JASDSPInterface.h index d68727c9ea..0642fdc018 100644 --- a/include/JSystem/JAudio2/JASDSPInterface.h +++ b/include/JSystem/JAudio2/JASDSPInterface.h @@ -112,7 +112,7 @@ namespace JASDsp { void invalChannelAll(); void initBuffer(); int setFXLine(u8, s16*, JASDsp::FxlineConfig_*); - BOOL changeFXLineParam(u8, u8, u32); + BOOL changeFXLineParam(u8, u8, uintptr_t); extern u8 const DSPADPCM_FILTER[64]; extern u32 const DSPRES_FILTER[320]; diff --git a/include/JSystem/JAudio2/JASResArcLoader.h b/include/JSystem/JAudio2/JASResArcLoader.h index 1b375e798e..bcaf1fb06f 100644 --- a/include/JSystem/JAudio2/JASResArcLoader.h +++ b/include/JSystem/JAudio2/JASResArcLoader.h @@ -8,10 +8,10 @@ namespace JASResArcLoader { size_t getResSize(JKRArchive const*, u16); size_t getResMaxSize(JKRArchive const*); static void loadResourceCallback(void*); - int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, u32), u32); + int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, uintptr_t), uintptr_t); // from pikmin2 - typedef void (*LoadCallback)(u32, u32); + typedef void (*LoadCallback)(u32, uintptr_t); struct TLoadResInfo { inline TLoadResInfo(JKRArchive* archive, u16 id, void* buf, u32 size) @@ -30,7 +30,7 @@ namespace JASResArcLoader { void* mBuffer; // _08 u32 mBufferSize; // _0C LoadCallback mCallback; // _10 - u32 mCallbackArg; // _14, arg to pass to mCallback along with readResource result + uintptr_t mCallbackArg; // _14, arg to pass to mCallback along with readResource result OSMessageQueue* mQueue; // _18 }; }; |
