diff --git a/include/JSystem/JAudio2/JAISound.h b/include/JSystem/JAudio2/JAISound.h index 5e414ade24..0d38f39ce7 100644 --- a/include/JSystem/JAudio2/JAISound.h +++ b/include/JSystem/JAudio2/JAISound.h @@ -134,7 +134,7 @@ struct JAISoundStatus_ { u8 flag8 : 1; } flags; } state; - /* 0x4 */ u32 userdata_; + /* 0x4 */ uintptr_t userdata_; }; // Size: 0x8 /** @@ -294,8 +294,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/JASHeapCtrl.h b/include/JSystem/JAudio2/JASHeapCtrl.h index 05a97838b9..196c79edd5 100644 --- a/include/JSystem/JAudio2/JASHeapCtrl.h +++ b/include/JSystem/JAudio2/JASHeapCtrl.h @@ -265,13 +265,13 @@ namespace JASKernel { void setupRootHeap(JKRSolidHeap*, u32); JKRHeap* getSystemHeap(); JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* getCommandHeap(); - void setupAramHeap(u32, u32); + void setupAramHeap(uintptr_t, u32); JASHeap* getAramHeap(); u32 getAramFreeSize(); u32 getAramSize(); extern JASHeap audioAramHeap; - extern u32 sAramBase; + extern uintptr_t sAramBase; extern JKRHeap* sSystemHeap; extern JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* sCommandHeap; }; 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 }; }; diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index 17b3059314..b6a0367bd0 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -72,7 +72,7 @@ public: JKRHeap* find(void* ptr) const; JKRHeap* findAllHeap(void* ptr) const; - void dispose_subroutine(u32 start, u32 end); + void dispose_subroutine(uintptr_t start, uintptr_t end); bool dispose(void* ptr, u32 size); void dispose(void* begin, void* end); void dispose(); diff --git a/include/JSystem/JSupport/JSUOutputStream.h b/include/JSystem/JSupport/JSUOutputStream.h index 25f5e70a37..8dc7809d24 100644 --- a/include/JSystem/JSupport/JSUOutputStream.h +++ b/include/JSystem/JSupport/JSUOutputStream.h @@ -2,6 +2,7 @@ #define JSUOUTPUTSTREAM_H #include "JSystem/JSupport/JSUIosBase.h" +#include /** * @ingroup jsystem-jsupport @@ -18,7 +19,7 @@ public: s32 write(const void*, s32); void write(const char*); -#ifdef TARGET_PC +#if INTPTR_MAX > INT32_MAX JSUOutputStream& operator<<(uintptr_t param_0) { write(¶m_0, sizeof(uintptr_t)); return *this; diff --git a/include/JSystem/JSupport/JSupport.h b/include/JSystem/JSupport/JSupport.h index 1940e6dff8..c982af6103 100644 --- a/include/JSystem/JSupport/JSupport.h +++ b/include/JSystem/JSupport/JSupport.h @@ -18,11 +18,7 @@ T* JSUConvertOffsetToPtr(const void* ptr, uintptr_t offset) { * */ template -#if TARGET_PC -T* JSUConvertOffsetToPtr(const void* ptr, u32 offset) { -#else T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) { -#endif T* ret; if (offset == 0) { ret = NULL; diff --git a/include/f_op/f_op_scene_mng.h b/include/f_op/f_op_scene_mng.h index 996a3b6d6e..20b847259a 100644 --- a/include/f_op/f_op_scene_mng.h +++ b/include/f_op/f_op_scene_mng.h @@ -4,14 +4,15 @@ #include "f_op/f_op_scene_pause.h" #include "f_pc/f_pc_manager.h" #include "f_op/f_op_scene.h" +#include typedef struct base_process_class base_process_class; scene_class* fopScnM_SearchByID(fpc_ProcID id); int fopScnM_ChangeReq(scene_class* i_scene, s16 i_procName, s16 param_3, u16 param_4); fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene); -int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data); -u32 fopScnM_ReRequest(s16 i_procName, u32 i_data); +int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, uintptr_t i_data); +u32 fopScnM_ReRequest(s16 i_procName, uintptr_t i_data); void fopScnM_Management(); void fopScnM_Init(); diff --git a/src/JSystem/JAudio2/JASAramStream.cpp b/src/JSystem/JAudio2/JASAramStream.cpp index 61b00f2163..3c813af5f2 100644 --- a/src/JSystem/JAudio2/JASAramStream.cpp +++ b/src/JSystem/JAudio2/JASAramStream.cpp @@ -143,7 +143,7 @@ bool JASAramStream::start() { } bool JASAramStream::stop(u16 param_0) { - if (!OSSendMessage(&field_0x000, (OSMessage)(param_0 << 0x10 | 1), OS_MESSAGE_NOBLOCK)) { + if (!OSSendMessage(&field_0x000, (OSMessage)(uintptr_t)(param_0 << 0x10 | 1), OS_MESSAGE_NOBLOCK)) { JUT_WARN(290, "%s", "OSSendMessage Failed"); return false; } diff --git a/src/JSystem/JAudio2/JASDSPInterface.cpp b/src/JSystem/JAudio2/JASDSPInterface.cpp index f777865186..9b6bbc069f 100644 --- a/src/JSystem/JAudio2/JASDSPInterface.cpp +++ b/src/JSystem/JAudio2/JASDSPInterface.cpp @@ -472,7 +472,7 @@ int JASDsp::setFXLine(u8 param_0, s16* buffer, JASDsp::FxlineConfig_* param_2) { return 1; } -BOOL JASDsp::changeFXLineParam(u8 param_0, u8 param_1, u32 param_2) { +BOOL JASDsp::changeFXLineParam(u8 param_0, u8 param_1, uintptr_t param_2) { JUT_ASSERT(450, dspMutex); FxBuf* buf = &FX_BUF[param_0]; switch (param_1) { diff --git a/src/JSystem/JAudio2/JASHeapCtrl.cpp b/src/JSystem/JAudio2/JASHeapCtrl.cpp index e23ae3909f..f53676185e 100644 --- a/src/JSystem/JAudio2/JASHeapCtrl.cpp +++ b/src/JSystem/JAudio2/JASHeapCtrl.cpp @@ -285,7 +285,7 @@ void JASGenericMemPool::free(void* ptr, u32 param_1) { freeMemCount++; } -u32 JASKernel::sAramBase; +uintptr_t JASKernel::sAramBase; JKRHeap* JASKernel::sSystemHeap; @@ -310,7 +310,7 @@ JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* JASKernel::getCom JASHeap JASKernel::audioAramHeap; -void JASKernel::setupAramHeap(u32 param_0, u32 param_1) { +void JASKernel::setupAramHeap(uintptr_t param_0, u32 param_1) { #if !PLATFORM_GCN OSReport("setupAramHeap %x, %x, %x\n", param_0, ARGetBaseAddress(), param_1); param_0 = ARGetBaseAddress(); diff --git a/src/JSystem/JAudio2/JASResArcLoader.cpp b/src/JSystem/JAudio2/JASResArcLoader.cpp index 7fb2aff736..a55c73469c 100644 --- a/src/JSystem/JAudio2/JASResArcLoader.cpp +++ b/src/JSystem/JAudio2/JASResArcLoader.cpp @@ -55,7 +55,7 @@ static void JASResArcLoader::loadResourceCallback(void* args) { } -int JASResArcLoader::loadResourceAsync(JKRArchive* archive, u16 id, u8* buffer, u32 size, LoadCallback callback, u32 cbArg) +int JASResArcLoader::loadResourceAsync(JKRArchive* archive, u16 id, u8* buffer, u32 size, LoadCallback callback, uintptr_t cbArg) { TLoadResInfo args(archive, id, buffer, size); args.mCallback = callback; diff --git a/src/JSystem/JAudio2/JAUSeqDataBlockMgr.cpp b/src/JSystem/JAudio2/JAUSeqDataBlockMgr.cpp index df8741a191..6b31c78a29 100644 --- a/src/JSystem/JAudio2/JAUSeqDataBlockMgr.cpp +++ b/src/JSystem/JAudio2/JAUSeqDataBlockMgr.cpp @@ -111,10 +111,10 @@ bool JAUDynamicSeqDataBlocks::appendDynamicSeqDataBlock(JAUSeqDataBlock* seqData return 1; } -static void JAUDynamicSeqDataBlocks_receiveLoaded_(u32 param_0, u32 param_1) { +static void JAUDynamicSeqDataBlocks_receiveLoaded_(u32 param_0, uintptr_t param_1) { JSULink* link = (JSULink*)param_1; JAUSeqDataBlock* seqDataBlock = link->getObject(); - if (param_0 != NULL) { + if (param_0 != 0) { seqDataBlock->field_0x1c = 2; } else { seqDataBlock->field_0x1c = 0; diff --git a/src/JSystem/JKernel/JKRDvdFile.cpp b/src/JSystem/JKernel/JKRDvdFile.cpp index 41eec5809d..face6c824b 100644 --- a/src/JSystem/JKernel/JKRDvdFile.cpp +++ b/src/JSystem/JKernel/JKRDvdFile.cpp @@ -125,7 +125,7 @@ s32 JKRDvdFile::sync(void) { void JKRDvdFile::doneProcess(s32 id, DVDFileInfo* fileInfo) { // fileInfo->field_0x3c looks like some kind of user pointer? JKRDvdFile* dvdFile = *(JKRDvdFile**)((u8*)fileInfo + (offsetof(JKRDvdFile, mDvdFile) - offsetof(JKRDvdFile, mFileInfo))); - OSSendMessage(&dvdFile->mMessageQueue2, (OSMessage)id, OS_MESSAGE_NOBLOCK); + OSSendMessage(&dvdFile->mMessageQueue2, (OSMessage)(intptr_t)id, OS_MESSAGE_NOBLOCK); } s32 JKRDvdFile::getFileSize(void) const { diff --git a/src/JSystem/JKernel/JKRHeap.cpp b/src/JSystem/JKernel/JKRHeap.cpp index 0778122787..3364bfc492 100644 --- a/src/JSystem/JKernel/JKRHeap.cpp +++ b/src/JSystem/JKernel/JKRHeap.cpp @@ -386,7 +386,7 @@ JKRHeap* JKRHeap::findAllHeap(void* ptr) const { return NULL; } -void JKRHeap::dispose_subroutine(u32 begin, u32 end) { +void JKRHeap::dispose_subroutine(uintptr_t begin, uintptr_t end) { JSUListIterator next_iterator((JSULink*)NULL); JSUListIterator it = mDisposerList.getFirst(); while (it != mDisposerList.getEnd()) { diff --git a/src/JSystem/JUtility/JUTVideo.cpp b/src/JSystem/JUtility/JUTVideo.cpp index 823402eff4..77d9be31b1 100644 --- a/src/JSystem/JUtility/JUTVideo.cpp +++ b/src/JSystem/JUtility/JUTVideo.cpp @@ -178,7 +178,7 @@ void JUTVideo::postRetraceProc(u32 retrace_count) { sManager->mPostCallback(retrace_count); } - OSSendMessage(&sManager->mMessageQueue, (OSMessage)VIGetRetraceCount(), OS_MESSAGE_NOBLOCK); + OSSendMessage(&sManager->mMessageQueue, (OSMessage)(uintptr_t)VIGetRetraceCount(), OS_MESSAGE_NOBLOCK); } void JUTVideo::setRenderMode(GXRenderModeObj const* pObj) { diff --git a/src/Z2AudioLib/Z2Audience.cpp b/src/Z2AudioLib/Z2Audience.cpp index 46b7107473..5e8522701b 100644 --- a/src/Z2AudioLib/Z2Audience.cpp +++ b/src/Z2AudioLib/Z2Audience.cpp @@ -454,7 +454,7 @@ f32 Z2SpotMic::calcMicVolume(f32 param_0, int camID, f32 param_2) { JUT_ASSERT(687, camID >= 0); JUT_ASSERT(688, camID < 1); - if (mMicOn == NULL) { + if (mMicOn == false) { return param_2; } diff --git a/src/Z2AudioLib/Z2Creature.cpp b/src/Z2AudioLib/Z2Creature.cpp index e02d1abcd5..14b0d31023 100644 --- a/src/Z2AudioLib/Z2Creature.cpp +++ b/src/Z2AudioLib/Z2Creature.cpp @@ -718,11 +718,11 @@ void Z2SoundObjBeeGroup::playBeeGroupSound(JAISoundID soundID, u8 param_1) { Z2SoundHandlePool* handle1 = startLevelSound((u32)soundID, 0, -1); Z2SoundHandlePool* handle2 = startLevelSound(sound_id2, 0, -1); - if (handle1 != NULL && *handle1 != NULL) { + if (handle1 != NULL && *handle1 != false) { f32 volume = Z2Calc::linearTransform(param_1, 1.0f, 5.0f, 0.5f, 1.0f, false); (*handle1)->getAuxiliary().moveVolume(volume, 0); } - if (handle2 != NULL && *handle2 != NULL) { + if (handle2 != NULL && *handle2 != false) { f32 volume = Z2Calc::linearTransform(param_1, 1.0f, 20.0f, 0.1f, 1.0f, false); (*handle2)->getAuxiliary().moveVolume(volume, 0); } @@ -924,28 +924,28 @@ Z2SoundHandlePool* Z2CreatureOI::startCreatureSoundLevel(JAISoundID soundID, u32 f32 pitch = Z2Calc::getParamByExp(mapinfo, 0.0f, 42.0f, 0.4f, 0.9f, 1.1f, Z2Calc::CURVE_POSITIVE); - if (handle1 != NULL && *handle1 != NULL) { + if (handle1 != NULL && *handle1 != false) { (*handle1)->getAuxiliary().moveVolume(volume, 0); (*handle1)->getAuxiliary().movePitch(pitch, 0); } else { return NULL; } - if (handle2 != NULL && *handle2 != NULL) { + if (handle2 != NULL && *handle2 != false) { (*handle2)->getAuxiliary().moveVolume(volume, 0); (*handle2)->getAuxiliary().movePitch(pitch, 0); } else { return NULL; } - if (handle3 != NULL && *handle3 != NULL) { + if (handle3 != NULL && *handle3 != false) { (*handle3)->getAuxiliary().moveVolume(volume, 0); (*handle3)->getAuxiliary().movePitch(pitch, 0); } else { return NULL; } - if (handle4 != NULL && *handle4 != NULL) { + if (handle4 != NULL && *handle4 != false) { (*handle4)->getAuxiliary().moveVolume(volume, 0); (*handle4)->getAuxiliary().movePitch(pitch, 0); return handle4; @@ -979,7 +979,7 @@ Z2SoundHandlePool* Z2CreatureOI::startTentacleSoundLevel(JAISoundID soundID, u8 } static void Z2_E_sw_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) { - if (handle != NULL && *handle != NULL) { + if (handle != NULL && *handle != false) { f32 pitch = 1.0f; switch (mapinfo) { case 1: @@ -994,7 +994,7 @@ static void Z2_E_sw_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) { } static void Z2_E_ms_modVol(Z2SoundHandlePool* handle, u32 mapinfo) { - if (handle != NULL && *handle != NULL) { + if (handle != NULL && *handle != false) { f32 var_f31 = 0.2f; if (mapinfo == 1) { (*handle)->getAuxiliary().moveVolume(var_f31, 0); @@ -1003,7 +1003,7 @@ static void Z2_E_ms_modVol(Z2SoundHandlePool* handle, u32 mapinfo) { } static void Z2_E_mm_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) { - if (handle != NULL && *handle != NULL) { + if (handle != NULL && *handle != false) { f32 var_f31 = 0.7f; if (mapinfo == 3) { (*handle)->getAuxiliary().movePitch(var_f31, 0); @@ -1012,7 +1012,7 @@ static void Z2_E_mm_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) { } static void Z2_B_zan_modPitch(Z2SoundHandlePool* handle, u32 mapinfo) { - if (handle != NULL && *handle != NULL) { + if (handle != NULL && *handle != false) { f32 pitch = 1.0f; f32 volume = 1.0f; if (mapinfo > 400) { diff --git a/src/Z2AudioLib/Z2SoundObject.cpp b/src/Z2AudioLib/Z2SoundObject.cpp index a3b8b4c88a..69b0dc3bad 100644 --- a/src/Z2AudioLib/Z2SoundObject.cpp +++ b/src/Z2AudioLib/Z2SoundObject.cpp @@ -164,7 +164,7 @@ Z2SoundHandlePool* Z2SoundObjBase::startLevelSound(JAISoundID soundID, u32 mapin if (handle != NULL) { soundStarter_->startSound(soundID, handle, pos_, mapinfo, fxMix, 1.0f, 1.0f, -1.0f, -1.0f, 0); - if (handle != NULL && (*handle) != NULL) { + if (handle != NULL && (*handle) != false) { (*handle)->setLifeTime(1, false); #if PLATFORM_WII || PLATFORM_SHIELD @@ -210,7 +210,7 @@ Z2SoundHandlePool* Z2SoundObjBase::startCollisionSE(u32 hitID, u32 mapinfo, Z2So } Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(JAISoundID(hitID), mapinfo, -1); - if (handle != NULL && (*handle) != NULL) { + if (handle != NULL && (*handle) != false) { (*handle)->setUserData(mapinfo); if (30 <= mapinfo && mapinfo <= 52) { Z2Audible* audible = (Z2Audible*)(*handle)->getAudible(); @@ -251,7 +251,7 @@ Z2SoundHandlePool* Z2DopplerSoundObjBase::startSound(JAISoundID soundID, u32 map pos_ = NULL; Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb); - if (pos != NULL && handle != NULL && (*handle) != NULL) { + if (pos != NULL && handle != NULL && (*handle) != false) { if ((*handle)->acceptsNewAudible()) { (*handle)->newAudible(*pos, &field_0x20, 0, NULL); } @@ -266,7 +266,7 @@ Z2SoundHandlePool* Z2DopplerSoundObjBase::startLevelSound(JAISoundID soundID, u3 pos_ = NULL; Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb); - if (pos != NULL && handle != NULL && (*handle) != NULL) { + if (pos != NULL && handle != NULL && (*handle) != false) { if ((*handle)->acceptsNewAudible()) { (*handle)->newAudible(*pos, &field_0x20, 0, NULL); } @@ -285,7 +285,7 @@ void Z2SoundObjSimple::init(Vec* posPtr, u8 handleNum) { Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID soundID, u32 mapinfo, s8 reverb) { Z2SoundHandlePool* handle = Z2SoundObjBase::startSound(soundID, mapinfo, reverb); - if (soundID == Z2SE_AL_UKI_POKOPOKO && handle != NULL && (*handle) != NULL) { + if (soundID == Z2SE_AL_UKI_POKOPOKO && handle != NULL && (*handle) != false) { f32 volume = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.4f, 1.0f, Z2Calc::CURVE_POSITIVE); f32 pitch = Z2Calc::getParamByExp((f32)mapinfo, 0.0f, 127.0f, 0.2f, 0.6f, 1.2f, Z2Calc::CURVE_POSITIVE); (*handle)->getAuxiliary().movePitch(pitch, 0); @@ -298,7 +298,7 @@ Z2SoundHandlePool* Z2SoundObjSimple::startSound(JAISoundID soundID, u32 mapinfo, Z2SoundHandlePool* Z2SoundObjSimple::startLevelSound(JAISoundID soundID, u32 mapinfo, s8 reverb) { Z2SoundHandlePool* handle = Z2SoundObjBase::startLevelSound(soundID, mapinfo, reverb); - if (handle != NULL && (*handle) != NULL) { + if (handle != NULL && (*handle) != false) { f32 pitch = 1.0f; f32 volume = 1.0f; switch (soundID) { @@ -502,7 +502,7 @@ void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3& pos, f32 para u32 id = getSoundID(animationSound, pos, param_1); if (!Z2GetSeMgr()->isSoundCulling(id)) { JAISoundHandle* handle = getHandleUserData(user_data); - if (handle != NULL && (*handle) != NULL && (*handle)->getAnimationState() != 1) { + if (handle != NULL && (*handle) != false && (*handle)->getAnimationState() != 1) { handle = NULL; } @@ -514,7 +514,7 @@ void Z2SoundObjAnime::startSoundInner(const JGeometry::TVec3& pos, f32 para bool result = soundStarter->startSound(id, handle, &pos, mapinfo, (f32)reverb / 127.0f, animationSound->field_0x0c, (f32)animationSound->field_0x14 / 127.0f, -1.0f, -1.0f, 0); - if ((*handle) != NULL) { + if ((*handle) != false) { (*handle)->setAnimationState(1); (*handle)->setUserData(user_data); if (animationSound->setsLifeTime()) { diff --git a/src/c/c_dylink.cpp b/src/c/c_dylink.cpp index a9e023318b..2d47e2df7a 100644 --- a/src/c/c_dylink.cpp +++ b/src/c/c_dylink.cpp @@ -916,7 +916,7 @@ BOOL cCc_Check() { BOOL rt = TRUE; for (int i = 0; i < ARRAY_SIZEU(DynamicNameTable); i++) { uintptr_t ptr = (uintptr_t)DMC[i]; - if (ptr != NULL) { + if (ptr != 0) { u32 ptr_hi_byte = ptr >> 0x18; if (ptr_hi_byte < 0x80 || ptr_hi_byte > 0x83) { // "cCc_Check invalid pointer detected" diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index aed6026b10..5f6bd7ca17 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -3082,7 +3082,7 @@ cXyz* daAlink_c::getNeckAimPos(cXyz* param_0, int* param_1, int param_2) { } } else if (field_0x35c4.abs2XZ() > 1.0f && checkModeFlg(1)) { f32 var_f31; - if (checkWolf() != NULL) { + if (checkWolf() != 0) { var_f31 = 80.0f; } else { var_f31 = 150.0f; diff --git a/src/d/actor/d_a_coach_fire.cpp b/src/d/actor/d_a_coach_fire.cpp index 80433c573e..f2f46b9eab 100644 --- a/src/d/actor/d_a_coach_fire.cpp +++ b/src/d/actor/d_a_coach_fire.cpp @@ -113,11 +113,11 @@ int daCoachFire_c::execute() { dAttention_c* attn = dComIfGp_getAttention(); if (attn->LockonTruth()) { if (attn->LockonTarget(0) != this) { - if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != NULL) { + if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != false) { fopAcM_delete(this); } } - } else if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != NULL) { + } else if (coach->deleteFireArrowFromList(fopAcM_GetID(this)) != false) { fopAcM_delete(this); } } diff --git a/src/d/actor/d_a_door_shutter.cpp b/src/d/actor/d_a_door_shutter.cpp index 66441fb197..d47c4c9c3c 100644 --- a/src/d/actor/d_a_door_shutter.cpp +++ b/src/d/actor/d_a_door_shutter.cpp @@ -1380,7 +1380,7 @@ int daDoor20_c::createKey() { } field_0x5ec = fopAcM_createChildFromOffset(PROC_Obj_Lv5Key, fopAcM_GetID(this), 0xffffffff, - &cStack_28, roomNo, &cStack_30, &scale, 0xffffffff, 0); + &cStack_28, roomNo, &cStack_30, &scale, -1, 0); break; default: OSReport_Error("シャッタードア:鍵タイプが不明です\n"); // Shutter door: key type unknown @@ -1399,7 +1399,7 @@ int daDoor20_c::createKey() { } field_0x5ec = fopAcM_createChildFromOffset(PROC_OBJ_KEYHOLE, fopAcM_GetID(this), 0xffffffff, - &cStack_28, roomNo, &cStack_30, &scale, 0xffffffff, 0); + &cStack_28, roomNo, &cStack_30, &scale, -1, 0); } current.pos = prevPos; diff --git a/src/d/actor/d_a_e_arrow.cpp b/src/d/actor/d_a_e_arrow.cpp index a62958bca3..b3d1a7b26e 100644 --- a/src/d/actor/d_a_e_arrow.cpp +++ b/src/d/actor/d_a_e_arrow.cpp @@ -330,7 +330,7 @@ static void e_arrow_spin(e_arrow_class* i_this) { } static void* s_limit_sub(void* i_actor, void* i_data) { - if (fopAcM_IsActor(i_actor) != NULL && i_actor != i_data && + if (fopAcM_IsActor(i_actor) != FALSE && i_actor != i_data && fopAcM_GetName(i_actor) == PROC_E_ARROW && static_cast(i_actor)->mAction == ACTION_ARROW_FIRE && fabsf(static_cast(i_actor)->field_0xa00.z - diff --git a/src/d/actor/d_a_e_bg.cpp b/src/d/actor/d_a_e_bg.cpp index be19dfcae2..9c8320c188 100644 --- a/src/d/actor/d_a_e_bg.cpp +++ b/src/d/actor/d_a_e_bg.cpp @@ -93,7 +93,7 @@ int daE_BG_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) { } int daE_BG_c::JointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daE_BG_c* bg = (daE_BG_c*)model->getUserArea(); if (bg != NULL) { diff --git a/src/d/actor/d_a_e_df.cpp b/src/d/actor/d_a_e_df.cpp index cd1fd1b187..9ae161b968 100644 --- a/src/d/actor/d_a_e_df.cpp +++ b/src/d/actor/d_a_e_df.cpp @@ -659,7 +659,7 @@ int daE_DF_c::Create() { return cPhs_ERROR_e; } - if (fopAcM_entrySolidHeap(this, useHeapInit, 0x1a40) == NULL) { + if (fopAcM_entrySolidHeap(this, useHeapInit, 0x1a40) == false) { return cPhs_ERROR_e; } diff --git a/src/d/actor/d_a_e_gi.cpp b/src/d/actor/d_a_e_gi.cpp index 4dac5344b4..cfdcd94442 100644 --- a/src/d/actor/d_a_e_gi.cpp +++ b/src/d/actor/d_a_e_gi.cpp @@ -93,7 +93,7 @@ int daE_GI_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) { } int daE_GI_c::JointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daE_GI_c* a_this = (daE_GI_c*)model->getUserArea(); diff --git a/src/d/actor/d_a_e_hp.cpp b/src/d/actor/d_a_e_hp.cpp index a1f202489a..114ca27387 100644 --- a/src/d/actor/d_a_e_hp.cpp +++ b/src/d/actor/d_a_e_hp.cpp @@ -119,7 +119,7 @@ int daE_HP_c::ctrlJoint(J3DJoint* i_joint, J3DModel* i_model) { } int daE_HP_c::JointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daE_HP_c* poe = (daE_HP_c*)model->getUserArea(); if (poe != NULL) { @@ -155,7 +155,7 @@ int daE_HP_c::LampCtrlJoint(J3DJoint* i_joint, J3DModel* i_model) { } int daE_HP_c::LampJointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daE_HP_c* poe = (daE_HP_c*)model->getUserArea(); if (poe != NULL) { diff --git a/src/d/actor/d_a_formation_mng.cpp b/src/d/actor/d_a_formation_mng.cpp index 531172731b..70535c25ff 100644 --- a/src/d/actor/d_a_formation_mng.cpp +++ b/src/d/actor/d_a_formation_mng.cpp @@ -382,7 +382,7 @@ void daFmtMng_c::create_init() { for (int i = 0; i < mFormationLine * mFormationRow; i++, member++) { member->mNpcId = fopAcM_createChild(0x294, fopAcM_GetID(this), (inTime << 0x10) | 0x200, &member->field_0x04, fopAcM_GetRoomNo(this), - &home.angle, NULL, 0xffffffff, NULL); + &home.angle, NULL, -1, NULL); } } diff --git a/src/d/actor/d_a_kago.cpp b/src/d/actor/d_a_kago.cpp index c2d2d8b489..9f4dd6e463 100644 --- a/src/d/actor/d_a_kago.cpp +++ b/src/d/actor/d_a_kago.cpp @@ -188,7 +188,7 @@ bool daKago_c::checkBck(int param_0) { } int daKago_c::draw() { - if (field_0x6de == NULL) { + if (field_0x6de == 0) { return 1; } @@ -692,7 +692,7 @@ int daKago_c::setSceneChange(int param_0) { void daKago_c::createBalloonScore() { if (field_0x6e7 != 0 && mBalloon2DId == fpcM_ERROR_PROCESS_ID_e) { - mBalloon2DId = fopAcM_create(PROC_BALLOON2D, 0, 0, 0xffffffff, 0, 0, 0xffffffff); + mBalloon2DId = fopAcM_create(PROC_BALLOON2D, 0, 0, 0xffffffff, 0, 0, -1); field_0x6e9 = 1; } } @@ -1199,7 +1199,7 @@ void daKago_c::executeFly() { } if (field_0x744 == 3) { cLib_chaseUC(&field_0x6de, 0, 4); - cLib_addCalcAngleS(¤t.angle.x, 0xffffe000, 8, 0x100, 0x10); + cLib_addCalcAngleS(¤t.angle.x, -8192, 8, 0x100, 0x10); } else { cLib_addCalcAngleS(¤t.angle.x, unkInt2, 8, 0x100, 0x10); } @@ -2230,7 +2230,7 @@ bool daKago_c::PerchDemoAwayForward() { if (field_0x728 < 30) { cLib_addCalcAngleS(¤t.angle.x, 0, 8, 0x100, 0x40); } else { - cLib_addCalcAngleS(¤t.angle.x, 0xffffe000, 8, 0x100, 0x40); + cLib_addCalcAngleS(¤t.angle.x, -8192, 8, 0x100, 0x40); } shape_angle.x = current.angle.x; @@ -2277,7 +2277,7 @@ bool daKago_c::PerchDemoAwayForward() { cLib_chaseF(&field_0x6f8, 30.0f, 1.0f); - cLib_addCalcAngleS(¤t.angle.x, 0xffffe000, 8, 0x100, 0x40); + cLib_addCalcAngleS(¤t.angle.x, -8192, 8, 0x100, 0x40); shape_angle.x = current.angle.x; shape_angle.y = current.angle.y; @@ -2547,7 +2547,7 @@ bool daKago_c::executeFirstDemo() { if (field_0x728 > 30) { cLib_chaseF(&field_0x6cc, 350.0f, 4.0f); - cLib_addCalcAngleS(&field_0x718, 0xfffff800, 8, 0x100, 0x10); + cLib_addCalcAngleS(&field_0x718, -2048, 8, 0x100, 0x10); } else { cLib_chaseF(&field_0x6cc, 350.0f, 6.0f); cLib_addCalcAngleS(&field_0x718, 0x400, 8, 0x200, 0x10); @@ -2699,7 +2699,7 @@ bool daKago_c::executeFirstDemo() { case 6: dComIfGp_getEvent()->setSkipProc(this, DemoSkipCallBack, 2); - cLib_addCalcAngleS(¤t.angle.x, 0xffffe000, 8, 0x100, 0x40); + cLib_addCalcAngleS(¤t.angle.x, -8192, 8, 0x100, 0x40); shape_angle.x = current.angle.x; shape_angle.y = current.angle.y; @@ -2944,7 +2944,7 @@ void daKago_c::executeLandingLakeHairia() { speedF = field_0x6f8 * std::abs(cM_scos(current.angle.x)); speed.y = -field_0x6f8 * cM_ssin(current.angle.x); - cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x100); + cLib_chaseAngleS(&shape_angle.x, -8192, 0x100); current.angle.x = shape_angle.x; if (field_0x728 == 90) { @@ -3078,7 +3078,7 @@ void daKago_c::executeLandingBoartHouse() { speedF = field_0x6f8 * std::abs(cM_scos(current.angle.x)); speed.y = -field_0x6f8 * cM_ssin(current.angle.x); - cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x100); + cLib_chaseAngleS(&shape_angle.x, -8192, 0x100); current.angle.x = shape_angle.x; if (field_0x728 == 0x50) { @@ -3391,7 +3391,7 @@ void daKago_c::setDashBlurEffect(int param_0) { field_0x6be.y = shape_angle.y; field_0x6be.z = 0; } - field_0xb40 = dComIfGp_particle_set(field_0xb40, 0x860f, &cameraEyeOffset, &tevStr, &field_0x6be, 0, 0xff, 0, 0xffffffff, 0, 0, 0); + field_0xb40 = dComIfGp_particle_set(field_0xb40, 0x860f, &cameraEyeOffset, &tevStr, &field_0x6be, 0, 0xff, 0, -1, 0, 0, 0); } void daKago_c::setWallHitEffect(cXyz param_0, int param_1) { @@ -3422,7 +3422,7 @@ void daKago_c::setSibukiEffect() { for (int i = 0; i < 3; i++) { field_0xb44[i] = dComIfGp_particle_set(field_0xb44[i], kago_wave_id[i], &acStack_28, &tevStr, &cStack_30, - 0, 0xff, 0, 0xffffffff, 0, 0, 0); + 0, 0xff, 0, -1, 0, 0, 0); } if (field_0x6e7 == 0) { @@ -3436,7 +3436,7 @@ void daKago_c::setDashSibukiEffect() { cXyz acStack_20(current.pos.x, field_0x70c + l_HIO.mYOffsetFromWaterSurface, current.pos.z); csXyz cStack_28(0, shape_angle.y, 0); field_0xb50 = dComIfGp_particle_set(field_0xb50, 0x86fe, &acStack_20, &tevStr, &cStack_28, 0, - 0xff, 0, 0xffffffff, 0, 0, 0); + 0xff, 0, -1, 0, 0, 0); } void daKago_c::setWaterFallEffect() { @@ -3450,7 +3450,7 @@ void daKago_c::setWaterFallEffect() { for (int i = 0; i < 2; i++) { field_0xb44[i] = dComIfGp_particle_set(field_0xb44[i], kago_wave_id[i], &acStack_28, &tevStr, &cStack_30, - 0, 0xff, 0, 0xffffffff, 0, 0, 0); + 0, 0xff, 0, -1, 0, 0, 0); } if (field_0x6e7 == 0) { mSound.startCreatureSoundLevel(Z2SE_EN_YC_SPLASH, 0, -1); @@ -3734,7 +3734,7 @@ int daKago_c::ctrlJoint(J3DJoint* param_0, J3DModel* param_1) { } int daKago_c::JointCallBack(J3DJoint* param_0, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daKago_c* kago = (daKago_c*)model->getUserArea(); if (kago != NULL) { diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index 37093569ef..0a548f74d5 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -3719,7 +3719,7 @@ BOOL daMP_WaitUntilPrepare() { } void daMP_PrepareReady(BOOL msg) { - OSSendMessage(&daMP_PrepareReadyQueue, (OSMessage)msg, 1); + OSSendMessage(&daMP_PrepareReadyQueue, (OSMessage)(uintptr_t)msg, 1); } static BOOL daMP_THPPlayerPrepare(s32 frame, s32 flag, s32 audioTrack) { diff --git a/src/d/actor/d_a_nbomb.cpp b/src/d/actor/d_a_nbomb.cpp index 5090950574..48d785a7ce 100644 --- a/src/d/actor/d_a_nbomb.cpp +++ b/src/d/actor/d_a_nbomb.cpp @@ -97,7 +97,7 @@ int daNbomb_c::searchEnemy(fopAc_ac_c* i_enemy) { static void* daNbomb_searchEnemy(fopAc_ac_c* i_actor, void* i_data) { if (fopAcM_GetGroup(i_actor) == fopAc_ENEMY_e && - ((daNbomb_c*)i_data)->searchEnemy(i_actor) != NULL) + ((daNbomb_c*)i_data)->searchEnemy(i_actor) != 0) { return i_actor; } diff --git a/src/d/actor/d_a_npc_chin.cpp b/src/d/actor/d_a_npc_chin.cpp index 500ff60eaa..6fc9002f1a 100644 --- a/src/d/actor/d_a_npc_chin.cpp +++ b/src/d/actor/d_a_npc_chin.cpp @@ -362,7 +362,7 @@ int daNpcChin_c::CreateHeap() { setMotionAnm(motionAnmParam, 0.0f); - if (field_0xe24 != 0 && mSpotLight.loadModel() == NULL) { + if (field_0xe24 != 0 && mSpotLight.loadModel() == 0) { return 0; } @@ -439,7 +439,7 @@ int daNpcChin_c::createHeapCallBack(fopAc_ac_c* i_this) { } int daNpcChin_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daNpcChin_c* chin = (daNpcChin_c*)model->getUserArea(); if (chin != NULL) { diff --git a/src/d/actor/d_a_npc_hanjo.cpp b/src/d/actor/d_a_npc_hanjo.cpp index 06dc3c57a7..e80428e355 100644 --- a/src/d/actor/d_a_npc_hanjo.cpp +++ b/src/d/actor/d_a_npc_hanjo.cpp @@ -1791,7 +1791,7 @@ int daNpc_Hanjo_c::takayose(void* param_0) { } } } - if (daPy_py_c::checkNowWolf() && mCyl2.ChkCoHit() != NULL) { + if (daPy_py_c::checkNowWolf() && mCyl2.ChkCoHit() != 0) { if (!daPy_getPlayerActorClass()->checkPlayerFly() || daPy_getPlayerActorClass()->checkAutoJump() || daPy_getPlayerActorClass()->checkWolfTriggerJump()) diff --git a/src/d/actor/d_a_npc_henna.cpp b/src/d/actor/d_a_npc_henna.cpp index 0eef1094f7..2991eaa6e6 100644 --- a/src/d/actor/d_a_npc_henna.cpp +++ b/src/d/actor/d_a_npc_henna.cpp @@ -2498,7 +2498,7 @@ static int daNpc_Henna_Execute(npc_henna_class* i_this) { mDoMtx_stack_c::transS(-460.0f + AREG_F(0), 51.0f + AREG_F(1), -240.0f + AREG_F(2)); mDoMtx_stack_c::YrotM(-17729 + AREG_S(0)); - mDoMtx_stack_c::XrotM(AREG_S(1) - 0x8107); + mDoMtx_stack_c::XrotM((s16)(AREG_S(1) - 0x8107)); mDoMtx_stack_c::ZrotM(AREG_S(2) + 2000 + sp_0xe); } else { mDoMtx_stack_c::transS(-790.0f + AREG_F(0), 153.0f + AREG_F(1), diff --git a/src/d/actor/d_a_npc_kn.cpp b/src/d/actor/d_a_npc_kn.cpp index 6a6568f9d5..1197e744ce 100644 --- a/src/d/actor/d_a_npc_kn.cpp +++ b/src/d/actor/d_a_npc_kn.cpp @@ -4965,7 +4965,7 @@ int daNpc_Kn_c::setPrtcl() { mParticleMngr[i].mpModel == true ? &mParticleMngr[i].mAngle : NULL, 0, fopAcM_GetRoomNo(this), 0.0f, speedF); - if (mParticleMngr[i].mpModel != NULL) { + if (mParticleMngr[i].mpModel != false) { emitter = mParticleMngr[i].mManager.getCenterEmitter(0, 0); if (emitter != NULL) { switch (i) { diff --git a/src/d/actor/d_a_npc_rafrel.cpp b/src/d/actor/d_a_npc_rafrel.cpp index 1b897adfaa..cc9b2382d9 100644 --- a/src/d/actor/d_a_npc_rafrel.cpp +++ b/src/d/actor/d_a_npc_rafrel.cpp @@ -421,7 +421,7 @@ int daNpcRafrel_c::createHeapCallBack(fopAc_ac_c* i_this) { } int daNpcRafrel_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* mdl_p = j3dSys.getModel(); daNpcRafrel_c* i_this = (daNpcRafrel_c*)mdl_p->getUserArea(); diff --git a/src/d/actor/d_a_npc_tk.cpp b/src/d/actor/d_a_npc_tk.cpp index 09e5a64514..8b83afb997 100644 --- a/src/d/actor/d_a_npc_tk.cpp +++ b/src/d/actor/d_a_npc_tk.cpp @@ -1340,7 +1340,7 @@ void daNPC_TK_c::executeBack() { if (current.pos.y > unkXyz1.y) { cLib_chaseAngleS(&shape_angle.x, 0x2000, 0x400); } else { - cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x400); + cLib_chaseAngleS(&shape_angle.x, -8192, 0x400); } } else { cLib_chaseAngleS(&field_0x69c, 0x200, 0x10); @@ -1379,7 +1379,7 @@ void daNPC_TK_c::executeBack() { if (current.pos.y > unkXyz1.y) { cLib_chaseAngleS(&shape_angle.x, 0x2000, 0x400); } else { - cLib_chaseAngleS(&shape_angle.x, 0xffffe000, 0x400); + cLib_chaseAngleS(&shape_angle.x, -8192, 0x400); } } else { cLib_chaseAngleS(&field_0x69c, 0x200, 0x10); @@ -2456,7 +2456,7 @@ void daNPC_TK_c::executeWolfPerch() { void daNPC_TK_c::executeResistanceDemo() { daNpcMoiR_c* npcMoiR; - if (fopAcM_SearchByName(PROC_NPC_MOIR, (fopAc_ac_c**)&npcMoiR) == NULL || npcMoiR == NULL) { + if (fopAcM_SearchByName(PROC_NPC_MOIR, (fopAc_ac_c**)&npcMoiR) == 0 || npcMoiR == NULL) { return; } @@ -2623,7 +2623,7 @@ void daNPC_TK_c::executeResistanceDemo() { // fallthrough case 8: { - cLib_addCalcAngleS2(&field_0x6a2, 0xffffdc00, 8, 0x200); + cLib_addCalcAngleS2(&field_0x6a2, -9216, 8, 0x200); cLib_addCalcAngleS2(&field_0x6a0, 0x1000, 8, 0x200); cLib_addCalcAngleS2(&field_0x6aa, 0x2000, 8, 0x200); diff --git a/src/d/actor/d_a_npc_tkj2.cpp b/src/d/actor/d_a_npc_tkj2.cpp index 103a9d57f2..d364c06cc1 100644 --- a/src/d/actor/d_a_npc_tkj2.cpp +++ b/src/d/actor/d_a_npc_tkj2.cpp @@ -176,7 +176,7 @@ static void Wind_effect(npc_tkj2_class* i_this) { if ((s16)(sVar1 - i_this->field_0x5c4) < 0) { cLib_addCalcAngleS(&a_this->shape_angle.z, 0x2000, 0x10, 0x1000, 0); } else { - cLib_addCalcAngleS(&a_this->shape_angle.z, 0xFFFFE000, 2, 0x1000, 0); + cLib_addCalcAngleS(&a_this->shape_angle.z, -8192, 2, 0x1000, 0); } } diff --git a/src/d/actor/d_a_npc_uri.cpp b/src/d/actor/d_a_npc_uri.cpp index ba04932225..c1fe5f439b 100644 --- a/src/d/actor/d_a_npc_uri.cpp +++ b/src/d/actor/d_a_npc_uri.cpp @@ -904,12 +904,12 @@ int daNpc_Uri_c::selectAction() { switch (mType) { case TYPE_1: - if (field_0x100d != NULL) { + if (field_0x100d != 0) { field_0xfc0[0] = &daNpc_Uri_c::sitWait; } else { - if (field_0x100e != NULL) { + if (field_0x100e != 0) { /* T_0007 - Ordon Village - During Uli's pick-up tutorial */ - if (daNpcT_chkTmpBit(7) && field_0x100f == NULL) { + if (daNpcT_chkTmpBit(7) && field_0x100f == 0) { field_0xfc0[0] = &daNpc_Uri_c::walk; } else { field_0xfc0[0] = &daNpc_Uri_c::wait; @@ -981,7 +981,7 @@ int daNpc_Uri_c::getTutorialCond(cXyz param_1) { field_0x1000 = mpHIO->m.field_0xa8 - 100.0f; return 5; } - if (field_0x1009 != NULL) { + if (field_0x1009 != 0) { return 8; } } diff --git a/src/d/actor/d_a_npc_ykw.cpp b/src/d/actor/d_a_npc_ykw.cpp index 9c2c816d37..25b3df0e8f 100644 --- a/src/d/actor/d_a_npc_ykw.cpp +++ b/src/d/actor/d_a_npc_ykw.cpp @@ -462,7 +462,7 @@ int daNpc_ykW_c::createHeapCallBack(fopAc_ac_c* i_this) { } int daNpc_ykW_c::ctrlJointCallBack(J3DJoint* i_joint, int param_1) { - if (param_1 == NULL) { + if (param_1 == 0) { J3DModel* model = j3dSys.getModel(); daNpc_ykW_c* ykw = (daNpc_ykW_c*)model->getUserArea(); if (ykw != 0) { diff --git a/src/d/actor/d_a_obj_avalanche.cpp b/src/d/actor/d_a_obj_avalanche.cpp index 23b4daf8fa..795b9ff45f 100644 --- a/src/d/actor/d_a_obj_avalanche.cpp +++ b/src/d/actor/d_a_obj_avalanche.cpp @@ -253,7 +253,7 @@ int daObjAvalanche_c::demoProc() { void daObjAvalanche_c::setEffect() { cXyz acStack_18(0.0f, 0.0f, 0.0f); csXyz cStack_20(0, 0, 0); - dComIfGp_particle_set(0x8c51, &acStack_18, &cStack_20, NULL, 0xff, NULL, 0xffffffff, NULL, NULL, + dComIfGp_particle_set(0x8c51, &acStack_18, &cStack_20, NULL, 0xff, NULL, -1, NULL, NULL, NULL); } diff --git a/src/d/actor/d_a_obj_magne_arm.cpp b/src/d/actor/d_a_obj_magne_arm.cpp index e2531f8d34..049323dace 100644 --- a/src/d/actor/d_a_obj_magne_arm.cpp +++ b/src/d/actor/d_a_obj_magne_arm.cpp @@ -186,8 +186,8 @@ int daObjMarm_c::Create() { mIsYRotForward = 0; } - if (dComIfG_Bgsp().Regist((dBgW_Base*)mpBgW1, this) != NULL || - dComIfG_Bgsp().Regist((dBgW_Base*)mpBgW2, this) != NULL) + if (dComIfG_Bgsp().Regist((dBgW_Base*)mpBgW1, this) != false || + dComIfG_Bgsp().Regist((dBgW_Base*)mpBgW2, this) != false) { return FALSE; } @@ -1060,11 +1060,11 @@ void daObjMarm_c::debugDraw() { } int daObjMarm_c::Delete() { - if (mpBgW1 != NULL && mpBgW1->ChkUsed() != NULL) { + if (mpBgW1 != NULL && mpBgW1->ChkUsed() != false) { dComIfG_Bgsp().Release(mpBgW1); } - if (mpBgW2 != NULL && mpBgW2->ChkUsed() != NULL) { + if (mpBgW2 != NULL && mpBgW2->ChkUsed() != false) { dComIfG_Bgsp().Release(mpBgW2); } endMagneHoleEffect(); diff --git a/src/d/d_bg_s.cpp b/src/d/d_bg_s.cpp index 190e2badc9..7295126a6b 100644 --- a/src/d/d_bg_s.cpp +++ b/src/d/d_bg_s.cpp @@ -712,7 +712,7 @@ void dBgS::MoveBgMatrixCrrPos(cBgS_PolyInfo const& i_poly, bool param_1, cXyz* i void dBgS_MoveBGProc_Typical(dBgW* i_bgw, void* i_actor_ptr, cBgS_PolyInfo const& i_poly, bool param_3, cXyz* i_pos, csXyz* i_angle, csXyz* i_shapeAngle) { Mtx m; - if (i_bgw->GetOldInvMtx(m) != NULL) { + if (i_bgw->GetOldInvMtx(m) != 0) { cXyz move_old; MTXMultVec(m, i_pos, &move_old); diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 8ce17ecc83..d724fb65ed 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -10131,7 +10131,7 @@ bool dCamera_c::eventCamera(s32 param_0) { } int* sp90_i; - if (getEvStringData(sp90, "Trim", "DEFAULT") != NULL) { + if (getEvStringData(sp90, "Trim", "DEFAULT") != false) { sp90_i = (int*)sp90; if (*sp90_i == 'STAN') { mEventData.field_0x1c = 0; diff --git a/src/d/d_ev_camera.cpp b/src/d/d_ev_camera.cpp index aef250cae0..444a9be213 100644 --- a/src/d/d_ev_camera.cpp +++ b/src/d/d_ev_camera.cpp @@ -3134,7 +3134,7 @@ bool dCamera_c::useItem1EvCamera() { if (item_p->field_0x20 < item_p->field_0x4) break; - if (data_list[item_p->mType][1].field_0x08 != NULL && item_p->field_0x1c == 0) { + if (data_list[item_p->mType][1].field_0x08 != 0 && item_p->field_0x1c == 0) { item_p->field_0x1c = 1; item_p->field_0x0 = 1; break; diff --git a/src/d/d_kankyo_rain.cpp b/src/d/d_kankyo_rain.cpp index 73e9af07cc..fce7f79a71 100644 --- a/src/d/d_kankyo_rain.cpp +++ b/src/d/d_kankyo_rain.cpp @@ -2540,9 +2540,9 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) { color_reg0.b = 0; f32 size = 8000.0f; - if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == NULL) { + if (strcmp(dComIfGp_getStartStageName(), "F_SP127") == 0) { size = 11000.0f; - } else if (strcmp(dComIfGp_getStartStageName(), "F_SP200") == NULL) { + } else if (strcmp(dComIfGp_getStartStageName(), "F_SP200") == 0) { size = 10000.0f; } diff --git a/src/d/d_menu_fmap.cpp b/src/d/d_menu_fmap.cpp index a9e88c8696..2cb5987613 100644 --- a/src/d/d_menu_fmap.cpp +++ b/src/d/d_menu_fmap.cpp @@ -2270,7 +2270,7 @@ bool dMenu_Fmap_c::readFieldMapData(void** o_data, char const* i_path, bool para } void dMenu_Fmap_c::decodeFieldMapData() { - int field_data = (intptr_t)mpFieldDat; + intptr_t field_data = (intptr_t)mpFieldDat; dMenu_Fmap_field_region_data_c* region_data = (dMenu_Fmap_field_region_data_c*)(field_data + mpFieldDat->mRegionDataOffset); dMenuMapCommon_c::Stage_c* stage_data diff --git a/src/d/d_menu_item_explain.cpp b/src/d/d_menu_item_explain.cpp index a6cb9a456a..7119ef3e03 100644 --- a/src/d/d_menu_item_explain.cpp +++ b/src/d/d_menu_item_explain.cpp @@ -290,7 +290,7 @@ void dMenu_ItemExplain_c::move() { if (status != mStatus) { (this->*init_process[mStatus])(); } - if (mStatus != NULL) { + if (mStatus != 0) { mpInfoScreen->animation(); } if (g_ringHIO.mItemDescAlpha != mDescAlpha) { diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index ac3dbd949b..cc34f26938 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -1484,12 +1484,12 @@ void dMenu_Option_c::screenSet() { } } for (int i = 0; i < 6; i++) { - if (let2_n[i] != NULL) { + if (let2_n[i] != 0) { mpMenuPane3[i] = new CPaneMgr(mpClipScreen, let2_n[i], 0, NULL); } else { mpMenuPane3[i] = NULL; } - if (menu3_n[i] != NULL) { + if (menu3_n[i] != 0) { mpMenuPane32[i] = new CPaneMgr(mpClipScreen, menu3_n[i], 0, NULL); } else { mpMenuPane32[i] = NULL; @@ -1720,7 +1720,7 @@ void dMenu_Option_c::screenSet() { field_0x1c0[i] = 0; } for (int i = 0; i < 3; i++) { - if (z_tx[i] != NULL) { + if (z_tx[i] != 0) { mpZButtonText[i] = new CPaneMgr(mpBackScreen, z_tx[i], 2, NULL); } else { mpZButtonText[i] = NULL; diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 002323e476..0a169d2546 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -1602,7 +1602,7 @@ s32 dPa_control_c::getPolyColor(cBgS_PolyInfo& param_0, int param_1, _GXColor* p return 0; } - if (param_1 == NULL) { + if (param_1 == 0) { dKy_pol_eff_prim_get(¶m_0, param_2); dKy_pol_eff_env_get(¶m_0, param_3); *param_4 = dKy_pol_eff_alpha_get(¶m_0); diff --git a/src/d/d_resorce.cpp b/src/d/d_resorce.cpp index fe2b2e37ef..40c94e7e51 100644 --- a/src/d/d_resorce.cpp +++ b/src/d/d_resorce.cpp @@ -54,7 +54,7 @@ int dRes_info_c::set(char const* i_arcName, char const* i_path, u8 i_mountDirect JUT_ASSERT(120, strlen(i_arcName) <= NAME_MAX); #endif - if (*i_path != NULL) { + if (*i_path != '\0') { char path[40]; snprintf(path, sizeof(path), "%s%s.arc", i_path, i_arcName); mDMCommand = mDoDvdThd_mountArchive_c::create(path, i_mountDirection, i_heap); diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index 69512ffea2..1e4636c457 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -554,7 +554,7 @@ static int phase_3(dScnPly_c* i_this) { return cPhs_INIT_e; } - if (!i_this->field_0x1d0 == NULL && !i_this->field_0x1d0->sync()) { + if (i_this->field_0x1d0 != NULL && !i_this->field_0x1d0->sync()) { return cPhs_INIT_e; } diff --git a/src/d/d_s_room.cpp b/src/d/d_s_room.cpp index 1adb5a43f1..cf3bb7c93b 100644 --- a/src/d/d_s_room.cpp +++ b/src/d/d_s_room.cpp @@ -329,7 +329,7 @@ static int phase_1(room_of_scene_class* i_this) { } else { stage_stag_info_class* stagInfo = dComIfGp_getStage()->getStagInfo(); - if (dStage_staginfo_GetArchiveHeap(stagInfo) != NULL) { + if (dStage_staginfo_GetArchiveHeap(stagInfo) != FALSE) { heap = mDoExt_getArchiveHeap(); } } diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 4fdbd71a44..cd0fcd0958 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -2725,7 +2725,7 @@ void dStage_Delete() { OS_REPORT("dStage_Delete\n"); char* demoArcName = dStage_roomControl_c::getDemoArcName(); - if (*demoArcName != NULL) { + if (*demoArcName != '\0') { dComIfG_deleteObjectResMain(demoArcName); } diff --git a/src/f_op/f_op_scene_mng.cpp b/src/f_op/f_op_scene_mng.cpp index 7f40ccd845..5d516e8adf 100644 --- a/src/f_op/f_op_scene_mng.cpp +++ b/src/f_op/f_op_scene_mng.cpp @@ -29,14 +29,14 @@ fpc_ProcID fopScnM_DeleteReq(scene_class* i_scene) { return fopScnRq_Request(1, i_scene, 0x7FFF, NULL, 0x7FFF, 0) != fpcM_ERROR_PROCESS_ID_e; } -int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, u32 i_data) { +int fopScnM_CreateReq(s16 i_procName, s16 param_2, u16 param_3, uintptr_t i_data) { printf("[DIAG] fopScnM_CreateReq: procName=%d fade=%d\n", i_procName, param_2); fflush(stdout); fpc_ProcID result = fopScnRq_Request(0, 0, i_procName, (void*)i_data, param_2, param_3); printf("[DIAG] fopScnM_CreateReq: result=%d (error=%d)\n", result, fpcM_ERROR_PROCESS_ID_e); fflush(stdout); return result != fpcM_ERROR_PROCESS_ID_e; } -u32 fopScnM_ReRequest(s16 i_procName, u32 i_data) { +u32 fopScnM_ReRequest(s16 i_procName, uintptr_t i_data) { if (l_scnRqID == fpcM_ERROR_PROCESS_ID_e) { return 0; } diff --git a/src/f_pc/f_pc_pause.cpp b/src/f_pc/f_pc_pause.cpp index a3484d1c7c..60515726b0 100644 --- a/src/f_pc/f_pc_pause.cpp +++ b/src/f_pc/f_pc_pause.cpp @@ -6,6 +6,7 @@ #include "f_pc/f_pc_pause.h" #include "f_pc/f_pc_node.h" #include "f_pc/f_pc_layer_iter.h" +#include int fpcPause_IsEnable(void* i_proc, u8 i_flag) { if ((((base_process_class*)i_proc)->pause_flag & i_flag) == i_flag) { @@ -20,7 +21,7 @@ int fpcPause_Enable(void* i_proc, u8 i_flag) { if (fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)i_proc)->subtype)) { fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Enable, - (void*)i_flag); + (void*)(uintptr_t)i_flag); } return 1; } @@ -30,7 +31,7 @@ int fpcPause_Disable(void* i_proc, u8 i_flag) { ((base_process_class*)i_proc)->pause_flag &= var_r31; if (fpcBs_Is_JustOfType(g_fpcNd_type, ((base_process_class*)i_proc)->subtype)) { - fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Disable, (void*)i_flag); + fpcLyIt_OnlyHere(&((process_node_class*)i_proc)->layer, (fpcLyIt_OnlyHereFunc)fpcPause_Disable, (void*)(uintptr_t)i_flag); } return 1; diff --git a/src/m_Do/m_Do_Reset.cpp b/src/m_Do/m_Do_Reset.cpp index fd478e51a1..e2a062d204 100644 --- a/src/m_Do/m_Do_Reset.cpp +++ b/src/m_Do/m_Do_Reset.cpp @@ -99,7 +99,7 @@ void mDoRst_reset(int reset, u32 resetCode, int forceMenu) { } void checkDiskCallback(s32 result, DVDCommandBlock* block) { - block->userData = (void*)result; + block->userData = (void*)(intptr_t)result; } void mDoRst_resetCallBack(int port, void*) { diff --git a/src/m_Do/m_Do_ext.cpp b/src/m_Do/m_Do_ext.cpp index a71ed9a42c..cb9dc7fb80 100644 --- a/src/m_Do/m_Do_ext.cpp +++ b/src/m_Do/m_Do_ext.cpp @@ -3713,7 +3713,7 @@ J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u3 bool hasSharedDlistObj = i_modelData->getMaterialNodePointer(0)->getSharedDisplayListObj() != NULL; // Update the modelFlag if the model data passed in has a shared dlist object - if (hasSharedDlistObj != NULL) { + if (hasSharedDlistObj != false) { if (i_modelData->isLocked()) { i_modelFlag = J3DMdlFlag_UseSharedDL; } else if (i_modelFlag == J3DMdlFlag_UseSharedDL) { diff --git a/src/m_Do/m_Do_machine.cpp b/src/m_Do/m_Do_machine.cpp index 2811cff7b1..9fbf2ae305 100644 --- a/src/m_Do/m_Do_machine.cpp +++ b/src/m_Do/m_Do_machine.cpp @@ -586,7 +586,7 @@ static void fault_callback_scroll(u16, OSContext* p_context, u32, u32) { JUTException* manager = JUTException::getManager(); JUTConsole* exConsole = manager->getConsole(); - u32 srr0 = p_context->srr0 & -4; + uintptr_t srr0 = p_context->srr0 & -4; if (srr0 >= 0x8000000C && srr0 < 0x82FFFFFF) { exConsole->print_f("(SRR0-3):%08X %08X %08X %08X\n", *(u32*)(srr0 - 0xC), *(u32*)(srr0 - 0x8), *(u32*)(srr0 - 0x4), *(u32*)srr0);