summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroeming <brother64youyou@gmail.com>2025-12-18 16:31:44 -0500
committerGitHub <noreply@github.com>2025-12-18 13:31:44 -0800
commit93067110f6bf969776a553ddbefe6a734504f7d6 (patch)
tree0d2d421527c4cb8516d994ec5978195b55fdc234
parent7cae156176b03d79ef05f3fefae5b60844e0fdf7 (diff)
Use consistent s32/u32 (#2964)
* cleanup long usage * fix regression
-rw-r--r--include/JSystem/JAudio2/JASCalc.h2
-rw-r--r--include/JSystem/JAudio2/JASCallback.h2
-rw-r--r--include/JSystem/JAudio2/JASProbe.h2
-rw-r--r--include/JSystem/JAudio2/JASWaveArcLoader.h2
-rw-r--r--include/JSystem/JGadget/define.h8
-rw-r--r--include/JSystem/JGadget/linklist.h4
-rw-r--r--include/JSystem/JUtility/JUTException.h2
-rw-r--r--include/SSystem/SComponent/c_lib.h4
-rw-r--r--include/d/d_msg_object.h2
-rw-r--r--src/JSystem/JAudio2/JASAudioThread.cpp2
-rw-r--r--src/JSystem/JAudio2/JASCalc.cpp8
-rw-r--r--src/JSystem/JKernel/JKRAssertHeap.cpp2
-rw-r--r--src/JSystem/JStudio/JStudio/fvb.cpp2
-rw-r--r--src/JSystem/JStudio/JStudio/stb.cpp2
-rw-r--r--src/SSystem/SComponent/c_lib.cpp4
-rw-r--r--src/d/actor/d_a_obj_ice_s.cpp10
16 files changed, 29 insertions, 29 deletions
diff --git a/include/JSystem/JAudio2/JASCalc.h b/include/JSystem/JAudio2/JASCalc.h
index 7c267268f4..d72e16d408 100644
--- a/include/JSystem/JAudio2/JASCalc.h
+++ b/include/JSystem/JAudio2/JASCalc.h
@@ -36,7 +36,7 @@ struct JASCalc {
}
f32 fake1();
- f32 fake2(long x);
+ f32 fake2(s32 x);
f32 fake3();
static const s16 CUTOFF_TO_IIR_TABLE[128][4];
diff --git a/include/JSystem/JAudio2/JASCallback.h b/include/JSystem/JAudio2/JASCallback.h
index 5aa3267d9d..0c9fb517a2 100644
--- a/include/JSystem/JAudio2/JASCallback.h
+++ b/include/JSystem/JAudio2/JASCallback.h
@@ -3,7 +3,7 @@
#include "dolphin/types.h"
-typedef long JASCallback(void*);
+typedef s32 JASCallback(void*);
/**
* @ingroup jsystem-jaudio
diff --git a/include/JSystem/JAudio2/JASProbe.h b/include/JSystem/JAudio2/JASProbe.h
index ea26f85ef8..3f4ab89d61 100644
--- a/include/JSystem/JAudio2/JASProbe.h
+++ b/include/JSystem/JAudio2/JASProbe.h
@@ -16,7 +16,7 @@ struct JASProbe {
static JASProbe* sProbeTable[16];
/* 0x000 */ char const* mName;
- /* 0x004 */ long mStartTime;
+ /* 0x004 */ s32 mStartTime;
/* 0x008 */ f32 _08;
/* 0x00C */ f32 _0C;
/* 0x010 */ f32 _10;
diff --git a/include/JSystem/JAudio2/JASWaveArcLoader.h b/include/JSystem/JAudio2/JASWaveArcLoader.h
index 42b94790b3..a3e930ebf1 100644
--- a/include/JSystem/JAudio2/JASWaveArcLoader.h
+++ b/include/JSystem/JAudio2/JASWaveArcLoader.h
@@ -58,7 +58,7 @@ struct JASWaveArc : JASDisposer {
struct loadToAramCallbackParams {
// not official struct name
/* 0x0 */ JASWaveArc* mWavArc;
- /* 0x4 */ long mEntryNum;
+ /* 0x4 */ s32 mEntryNum;
/* 0x8 */ u32 mBase;
/* 0xC */ u32 _c;
};
diff --git a/include/JSystem/JGadget/define.h b/include/JSystem/JGadget/define.h
index 93ba872ad6..c64d61c33e 100644
--- a/include/JSystem/JGadget/define.h
+++ b/include/JSystem/JGadget/define.h
@@ -15,14 +15,14 @@ public:
JGadget_outMessage(MessageFunc fn, const char* file, int line);
~JGadget_outMessage();
- JGadget_outMessage& operator<<(int param_1) { return *this << (signed long)param_1; }
+ JGadget_outMessage& operator<<(int param_1) { return *this << (s32)param_1; }
JGadget_outMessage& operator<<(u16);
- JGadget_outMessage& operator<<(unsigned int);
+ JGadget_outMessage& operator<<(uint);
JGadget_outMessage& operator<<(u8 param_1) { return *this << (char)param_1; }
JGadget_outMessage& operator<<(const char* str);
JGadget_outMessage& operator<<(char);
- JGadget_outMessage& operator<<(signed long);
- JGadget_outMessage& operator<<(unsigned long);
+ JGadget_outMessage& operator<<(s32);
+ JGadget_outMessage& operator<<(u32);
JGadget_outMessage& operator<<(const void*);
private:
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index 1d5d46a804..da51a35060 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -128,8 +128,8 @@ struct TLinkList : TNodeLinkList {
iterator& operator=(const iterator& rhs) {
//TODO: Probably fakematch? Not sure what's going on here exactly
- (TIterator<std::bidirectional_iterator_tag, T, long, T*, T&>&)*this =
- (const TIterator<std::bidirectional_iterator_tag, T, long, T*, T&>&)rhs;
+ (TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&>&)*this =
+ (const TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&>&)rhs;
this->node = rhs.node;
return *this;
}
diff --git a/include/JSystem/JUtility/JUTException.h b/include/JSystem/JUtility/JUTException.h
index dc6ef1ac4d..923349a089 100644
--- a/include/JSystem/JUtility/JUTException.h
+++ b/include/JSystem/JUtility/JUTException.h
@@ -152,7 +152,7 @@ STATIC_ASSERT(sizeof(JUTException) == 0xA4);
*/
struct JUTWarn {
JUTWarn& operator<<(const char*) { return *this; }
- JUTWarn& operator<<(long) { return *this; }
+ JUTWarn& operator<<(s32) { return *this; }
};
#endif /* JUTEXCEPTION_H */
diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h
index a93ba51aa5..48cf3c71df 100644
--- a/include/SSystem/SComponent/c_lib.h
+++ b/include/SSystem/SComponent/c_lib.h
@@ -9,8 +9,8 @@ inline bool cLib_IsZero(f32 value) {
return fabsf(value) < 8e-11f;
}
-void cLib_memCpy(void* dst, const void* src, unsigned long size);
-void cLib_memSet(void* ptr, int value, unsigned long size);
+void cLib_memCpy(void* dst, const void* src, u32 size);
+void cLib_memSet(void* ptr, int value, u32 size);
f32 cLib_addCalc(f32* o_value, f32 target, f32 scale, f32 maxStep, f32 minStep);
void cLib_addCalc2(f32* o_value, f32 target, f32 scale, f32 maxStep);
diff --git a/include/d/d_msg_object.h b/include/d/d_msg_object.h
index 133b9f88ab..2c3c781b5f 100644
--- a/include/d/d_msg_object.h
+++ b/include/d/d_msg_object.h
@@ -411,7 +411,7 @@ inline void dMsgObject_setShopWaitTimer(u8 timer) {
dMsgObject_c::setShopWaitTimer(timer);
}
-inline void dMsgObject_changeFlowGroup(long flow) {
+inline void dMsgObject_changeFlowGroup(s32 flow) {
dMsgObject_getMsgObjectClass()->changeFlowGroup(flow);
}
diff --git a/src/JSystem/JAudio2/JASAudioThread.cpp b/src/JSystem/JAudio2/JASAudioThread.cpp
index 2aa71a329f..e689a9607f 100644
--- a/src/JSystem/JAudio2/JASAudioThread.cpp
+++ b/src/JSystem/JAudio2/JASAudioThread.cpp
@@ -19,7 +19,7 @@ JASAudioThread::JASAudioThread(int stackSize, int msgCount, u32 threadPriority)
OSInitThreadQueue(&sThreadQueue);
}
-void JASAudioThread::create(long threadPriority) {
+void JASAudioThread::create(s32 threadPriority) {
JASAudioThread* sAudioThread = new (JASDram, 0) JASAudioThread(threadPriority, 0x10, 0x1400);
sAudioThread->setCurrentHeap(JKRGetSystemHeap());
sAudioThread->resume();
diff --git a/src/JSystem/JAudio2/JASCalc.cpp b/src/JSystem/JAudio2/JASCalc.cpp
index a076cef9d1..861b8dcd67 100644
--- a/src/JSystem/JAudio2/JASCalc.cpp
+++ b/src/JSystem/JAudio2/JASCalc.cpp
@@ -264,11 +264,11 @@ s16 const JASCalc::CUTOFF_TO_IIR_TABLE[128][4] = {
};
// currently required because of missing functions
-// JASCalc::hannWindow(short *, unsigned long)
-// JASCalc::hammWindow(short *, unsigned long)
-// JASCalc::fft(float *, float *, unsigned long, long)
+// JASCalc::hannWindow(short *, u32)
+// JASCalc::hammWindow(short *, u32)
+// JASCalc::fft(float *, float *, u32, s32)
f32 JASCalc::fake1() { return 0.5f; }
-f32 JASCalc::fake2(long x) { return JASCalc::clamp<s16, long>(x); }
+f32 JASCalc::fake2(s32 x) { return JASCalc::clamp<s16, s32>(x); }
f32 JASCalc::fake3() { return 0.0f; }
f32 JASCalc::pow2(f32 x) {
diff --git a/src/JSystem/JKernel/JKRAssertHeap.cpp b/src/JSystem/JKernel/JKRAssertHeap.cpp
index d38ff3b909..5a3d723340 100644
--- a/src/JSystem/JKernel/JKRAssertHeap.cpp
+++ b/src/JSystem/JKernel/JKRAssertHeap.cpp
@@ -2,7 +2,7 @@
#include "JSystem/JKernel/JKRAssertHeap.h"
-JKRAssertHeap::JKRAssertHeap(void* data, unsigned long size, JKRHeap* parent, bool errorFlag)
+JKRAssertHeap::JKRAssertHeap(void* data, u32 size, JKRHeap* parent, bool errorFlag)
: JKRHeap(data, size, parent, errorFlag) {}
JKRAssertHeap::~JKRAssertHeap() {
diff --git a/src/JSystem/JStudio/JStudio/fvb.cpp b/src/JSystem/JStudio/JStudio/fvb.cpp
index f3500035b9..b2922f2be3 100644
--- a/src/JSystem/JStudio/JStudio/fvb.cpp
+++ b/src/JSystem/JStudio/JStudio/fvb.cpp
@@ -404,7 +404,7 @@ bool TParse::parseHeader_next(void const** ppData_inout, u32* puBlock_out, u32 f
u16 version = header.get_version();
if (version < 2) {
JUTWarn w;
- w << "obselete version : " << (long)0;
+ w << "obselete version : " << (s32)0;
return false;
} else if (version > 0x100) {
JUTWarn w;
diff --git a/src/JSystem/JStudio/JStudio/stb.cpp b/src/JSystem/JStudio/JStudio/stb.cpp
index 6a2f6515c7..c7270facf1 100644
--- a/src/JSystem/JStudio/JStudio/stb.cpp
+++ b/src/JSystem/JStudio/JStudio/stb.cpp
@@ -405,7 +405,7 @@ bool TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 f
u16 version = header.get_version();
if (version < 1) {
JUTWarn w;
- w << "obselete version : " << (long)0;
+ w << "obselete version : " << (s32)0;
return false;
} else if (version > 3) {
JUTWarn w;
diff --git a/src/SSystem/SComponent/c_lib.cpp b/src/SSystem/SComponent/c_lib.cpp
index 4a867e7431..85587fa018 100644
--- a/src/SSystem/SComponent/c_lib.cpp
+++ b/src/SSystem/SComponent/c_lib.cpp
@@ -13,7 +13,7 @@
* @param src Pointer to source data to be copied
* @param num Number of bytes to copy
*/
-void cLib_memCpy(void* dst, const void* src, unsigned long num) {
+void cLib_memCpy(void* dst, const void* src, u32 num) {
memcpy(dst, src, num);
}
@@ -23,7 +23,7 @@ void cLib_memCpy(void* dst, const void* src, unsigned long num) {
* @param value Value to be set
* @param num Number of bytes to set
*/
-void cLib_memSet(void* ptr, int value, unsigned long num) {
+void cLib_memSet(void* ptr, int value, u32 num) {
memset(ptr, value, num);
}
diff --git a/src/d/actor/d_a_obj_ice_s.cpp b/src/d/actor/d_a_obj_ice_s.cpp
index ba32890870..95c74a38c2 100644
--- a/src/d/actor/d_a_obj_ice_s.cpp
+++ b/src/d/actor/d_a_obj_ice_s.cpp
@@ -124,7 +124,7 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3
(void)param_1;
daObjIce_s_c* ice = (daObjIce_s_c*)param_2;
daPy_py_c* player = daPy_getPlayerActorClass();
- cXyz* playerPos = &fopAcM_GetPosition(player);
+ cXyz* playerPos = (cXyz*)&fopAcM_GetPosition(player);
cXyz* pBallCenter = player->getIronBallCenterPos();
// !@bug misplaced ! operator. This condition is probably always false
@@ -138,7 +138,9 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3
}
cXyz* icePos = (cXyz*)&fopAcM_GetPosition(param_2);
- if (pBallCenter != NULL && icePos != NULL && icePos->absXZ(*pBallCenter) < ice->field_0x5c8.x * 600.0f) {
+ if (pBallCenter != NULL && icePos != NULL &&
+ icePos->absXZ(*pBallCenter) < ice->field_0x5c8.x * 600.0f)
+ {
ice->field_0x5d8 = 0x300;
ice->field_0x5a4 = -11.0f;
ice->field_0x5ac = 0x1000;
@@ -150,9 +152,7 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3
ice->field_0x5ac = 0x1000;
ice->Check_RideOn(*playerPos);
}
- if (ice->field_0x5c5 == 0xff &&
- fopAcM_GetName(param_3) == PROC_ALINK)
- {
+ if (ice->field_0x5c5 == 0xff && fopAcM_GetName(param_3) == PROC_ALINK) {
ice->field_0x5d8 = 0x300;
ice->field_0x5a4 = -11.0f;
ice->field_0x5ac = 0x1000;