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/JHostIO/JORMContext.h b/include/JSystem/JHostIO/JORMContext.h index 99de2bac17..551c2410f2 100644 --- a/include/JSystem/JHostIO/JORMContext.h +++ b/include/JSystem/JHostIO/JORMContext.h @@ -249,7 +249,7 @@ public: */ DEFINE_GEN_SLIDER(u8, 0x100 | jhostio::EKind_8B) DEFINE_GEN_SLIDER(s16, jhostio::EKind_16B) - DEFINE_GEN_SLIDER(f32, JORPropertyEvent::EKind_FloatValue | jhostio::EKind_32B) + DEFINE_GEN_SLIDER(f32, (u32)JORPropertyEvent::EKind_FloatValue | (u32)jhostio::EKind_32B) DEFINE_GEN_SLIDER(s32, jhostio::EKind_32B) DEFINE_GEN_SLIDER_ID(f64, JORPropertyEvent::EKind_ValueID | JORPropertyEvent::EKind_FloatValue) diff --git a/include/JSystem/JSupport/JSupport.h b/include/JSystem/JSupport/JSupport.h index 5b6b26a20f..1940e6dff8 100644 --- a/include/JSystem/JSupport/JSupport.h +++ b/include/JSystem/JSupport/JSupport.h @@ -24,7 +24,7 @@ T* JSUConvertOffsetToPtr(const void* ptr, u32 offset) { T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) { #endif T* ret; - if (offset == NULL) { + if (offset == 0) { ret = NULL; } else { ret = (T*)((intptr_t)ptr + (intptr_t)offset); diff --git a/include/JSystem/JUtility/JUTAssert.h b/include/JSystem/JUtility/JUTAssert.h index e10171f992..03306a8f8a 100644 --- a/include/JSystem/JUtility/JUTAssert.h +++ b/include/JSystem/JUtility/JUTAssert.h @@ -60,13 +60,13 @@ JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, MSG, OSPanic(__FILE__, __LINE__, "Halt"); #define JUT_WARN_DEVICE(LINE, DEVICE, ...) \ - JUTAssertion::setWarningMessage_f(DEVICE, __FILE__, __LINE__, __VA_ARGS__); \ + JUTAssertion::setWarningMessage_f(DEVICE, const_cast(__FILE__), __LINE__, __VA_ARGS__); \ #define JUT_LOG(LINE, ...) \ - JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), __FILE__, __LINE__, __VA_ARGS__) + JUTAssertion::setLogMessage_f(JUTAssertion::getSDevice(), const_cast(__FILE__), __LINE__, __VA_ARGS__) #define JUT_SET_CONFIRM(LINE, COND) \ - JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), __FILE__, __LINE__, COND, #COND) + JUTAssertion::setConfirmMessage(JUTAssertion::getSDevice(), const_cast(__FILE__), __LINE__, COND, #COND) #endif #define JUT_WARN(LINE, ...) \ diff --git a/include/dusk/math.h b/include/dusk/math.h index 578ff80398..14c50db90a 100644 --- a/include/dusk/math.h +++ b/include/dusk/math.h @@ -3,7 +3,9 @@ #include +#ifndef M_PI #define M_PI 3.14159265358979323846f +#endif #define M_SQRT3 1.73205f #define DEG_TO_RAD(degrees) (degrees * (M_PI / 180.0f)) diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index d743c143f2..6aa5713e1b 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -199,7 +199,7 @@ public: BOOL chkCondition(u16 condition) { return (mCondition & condition) == condition; } void suspendProc(void* actor) { - if (field_0x10 != NULL) { + if (field_0x10 != 0) { field_0x14(actor); } } diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 83f009a41e..b3a8873bcc 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -423,7 +423,14 @@ inline BOOL fopAcM_CULLSIZE_IS_BOX(int i_culltype) { i_culltype == fopAc_CULLBOX_CUSTOM_e; } -inline const cXyz& fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) { +inline +#ifdef __MWERKS__ +// In the original code, this constructs a temporary and returns a reference to it +const cXyz& +#else +const Vec& +#endif +fopAcM_getCullSizeSphereCenter(const fopAc_ac_c* i_actor) { return i_actor->cull.sphere.center; } diff --git a/src/JSystem/J2DGraph/J2DMaterialFactory.cpp b/src/JSystem/J2DGraph/J2DMaterialFactory.cpp index c8c9fc65f7..fdb604f01b 100644 --- a/src/JSystem/J2DGraph/J2DMaterialFactory.cpp +++ b/src/JSystem/J2DGraph/J2DMaterialFactory.cpp @@ -248,7 +248,7 @@ u16 J2DMaterialFactory::newTexNo(int param_0, int param_1) const { if (iVar2->field_0x38[param_1] != 0xffff) { return field_0x28[iVar2->field_0x38[param_1]]; } - return 0x1FFFF; + return 0xFFFF; } u16 J2DMaterialFactory::newFontNo(int param_0) const { @@ -256,7 +256,7 @@ u16 J2DMaterialFactory::newFontNo(int param_0) const { if (iVar2->field_0x48 != 0xffff) { return field_0x2c[iVar2->field_0x48]; } - return 0x1FFFF; + return 0xFFFF; } J2DTevOrder J2DMaterialFactory::newTevOrder(int param_0, int param_1) const { diff --git a/src/JSystem/JKernel/JKRAramArchive.cpp b/src/JSystem/JKernel/JKRAramArchive.cpp index f13f7fcbac..5ed1bc181c 100644 --- a/src/JSystem/JKernel/JKRAramArchive.cpp +++ b/src/JSystem/JKernel/JKRAramArchive.cpp @@ -208,7 +208,7 @@ void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) { &outBuf); *pOutSize = size; - if (size == NULL) { + if (size == 0) { return NULL; } @@ -243,7 +243,7 @@ void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* } else { if (compression == COMPRESSION_YAZ0) { u32 expandSize = this->getExpandSize(pEntry); - if (expandSize != NULL) { + if (expandSize != 0) { size = expandSize; } } diff --git a/src/JSystem/JKernel/JKRAramStream.cpp b/src/JSystem/JKernel/JKRAramStream.cpp index 94b9ca91fc..76324f6f14 100644 --- a/src/JSystem/JKernel/JKRAramStream.cpp +++ b/src/JSystem/JKernel/JKRAramStream.cpp @@ -128,7 +128,7 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) { } } - OSSendMessage(&command->mMessageQueue, (OSMessage)writtenLength, OS_MESSAGE_NOBLOCK); + OSSendMessage(&command->mMessageQueue, (OSMessage)(uintptr_t)writtenLength, OS_MESSAGE_NOBLOCK); return writtenLength; } diff --git a/src/JSystem/JUtility/JUTGraphFifo.cpp b/src/JSystem/JUtility/JUTGraphFifo.cpp index 2ec9de1de2..840eca7523 100644 --- a/src/JSystem/JUtility/JUTGraphFifo.cpp +++ b/src/JSystem/JUtility/JUTGraphFifo.cpp @@ -18,7 +18,7 @@ JUTGraphFifo::JUTGraphFifo(u32 size) { GXInitFifoPtrs(mFifo, mBase, mBase); } else { mBase = JKRAllocFromSysHeap(mSize + 0xA0, 32); - mBase = (void*)ROUND((intptr_t)mBase, 0x20); + mBase = (void*)ALIGN_NEXT((intptr_t)mBase, 0x20); mFifo = GXInit(mBase, mSize); GXSetColorUpdate(GX_ENABLE); data_804514B8 = true;