From cfded01caa7d70978e4d9e6806cd348755fc465a Mon Sep 17 00:00:00 2001 From: hatal175 Date: Tue, 9 Dec 2025 23:44:27 +0200 Subject: Match resource.cpp with a small fake match (#2936) --- src/JSystem/JMessage/resource.cpp | 19 ++++++++++++------- src/JSystem/JStudio/JStudio/jstudio-control.cpp | 3 ++- src/JSystem/JStudio/JStudio/stb.cpp | 4 ++-- .../MSL/MSL_C++/MSL_Common/Include/algorithm.h | 5 ++++- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/JSystem/JMessage/resource.cpp b/src/JSystem/JMessage/resource.cpp index ff7500fdf2..2b1ddf7068 100644 --- a/src/JSystem/JMessage/resource.cpp +++ b/src/JSystem/JMessage/resource.cpp @@ -100,10 +100,8 @@ JMessage::TResourceContainer::TCResource::TCResource() {} JMessage::TResourceContainer::TCResource::~TCResource() { JGADGET_ASSERTWARN(173, empty()); } - -// NONMATCHING - likely due to incorrect enumerator setup compared to debug JMessage::TResource* JMessage::TResourceContainer::TCResource::Get_groupID(u16 u16GroupID) { - JGadget::TContainerEnumerator enumerator(this); + JGadget::TContainerEnumerator enumerator(*this); while (enumerator) { const TResource* res = &(*enumerator); if (res->getGroupID() == u16GroupID) @@ -117,9 +115,13 @@ JMessage::TResource* JMessage::TResourceContainer::TCResource::Do_create() { return new TResource(); } -// NONMATCHING extra null comparison void JMessage::TResourceContainer::TCResource::Do_destroy(JMessage::TResource* pResource) { + #if DEBUG delete pResource; + #else + // Fake Match - extra null comparison when not doing the conversion + delete (void*)pResource; + #endif } JMessage::TResourceContainer::TResourceContainer() : encodingType_(0), pfnParseCharacter_(NULL) {} @@ -141,14 +143,17 @@ void JMessage::TResourceContainer::setEncoding_(u8 e) { } JMessage::TParse::TParse(JMessage::TResourceContainer* pContainer) { + u8 sp8[5]; + JMessage::TResourceContainer* cont; JUT_ASSERT(324, pContainer!=NULL); - pContainer_ = pContainer; + cont = pContainer; + pContainer_ = cont; pResource_ = NULL; + sp8[0] = 0; } JMessage::TParse::~TParse() {} -// NONMATCHING regalloc, missing clrlwi bool JMessage::TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_out, u32 param_2) { JUT_ASSERT(343, ppData_inout!=NULL); JUT_ASSERT(344, puBlock_out!=NULL); @@ -172,7 +177,7 @@ bool JMessage::TParse::parseHeader_next(const void** ppData_inout, u32* puBlock_ return false; } - u8 uEncoding = oHeader.get_encoding(); + const u8 uEncoding = oHeader.get_encoding(); if (uEncoding != 0) { if (!pContainer_->isEncodingSettable(uEncoding)) { JGADGET_WARNMSG(369, "encoding not acceptable"); diff --git a/src/JSystem/JStudio/JStudio/jstudio-control.cpp b/src/JSystem/JStudio/JStudio/jstudio-control.cpp index 0a9f83585b..b58fb20f0f 100644 --- a/src/JSystem/JStudio/JStudio/jstudio-control.cpp +++ b/src/JSystem/JStudio/JStudio/jstudio-control.cpp @@ -80,8 +80,9 @@ void JStudio::TFactory::appendCreateObject(JStudio::TCreateObject* param_0) { mList.Push_back(param_0); } + JStudio::TObject* JStudio::TFactory::create(JStudio::stb::data::TParse_TBlock_object const& param_0) { - JGadget::TContainerEnumerator aTStack_368(&mList); + JGadget::TContainerEnumerator > aTStack_368(mList); while(aTStack_368) { TCreateObject& piVar1 = *aTStack_368; JStudio::TObject* obj; diff --git a/src/JSystem/JStudio/JStudio/stb.cpp b/src/JSystem/JStudio/JStudio/stb.cpp index b3e20a63f7..776f6c39f8 100644 --- a/src/JSystem/JStudio/JStudio/stb.cpp +++ b/src/JSystem/JStudio/JStudio/stb.cpp @@ -335,7 +335,7 @@ TObject* TControl::getObject(void const* param_0, u32 param_1) { void TControl::reset() { resetStatus_(); mObject_control.reset(NULL); - JGadget::TContainerEnumerator aTStack_18(&mObjectContainer); + JGadget::TContainerEnumerator > aTStack_18(mObjectContainer); while (aTStack_18) { (*aTStack_18).reset(NULL); } @@ -346,7 +346,7 @@ bool TControl::forward(u32 param_0) { bool rv = mObject_control.forward(param_0); int uVar7 = 0xf; int uVar6 = 0; - JGadget::TContainerEnumerator aTStack_38(&mObjectContainer); + JGadget::TContainerEnumerator > aTStack_38(mObjectContainer); while (aTStack_38) { JStudio::stb::TObject& this_00 = *aTStack_38; rv = this_00.forward(param_0) || rv; diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/algorithm.h b/src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/algorithm.h index bd4c0713a8..126a38f5ba 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/algorithm.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/algorithm.h @@ -31,7 +31,9 @@ inline ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, template ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& val) { // For some reason, calling the other lower_bound matches for debug, but not for retail: - // return lower_bound(first, last, val, std::detail::less()); + #if DEBUG + return lower_bound(first, last, val, std::detail::less()); + #else typedef typename iterator_traits::difference_type difference_type; difference_type len = std::distance(first, last); @@ -50,6 +52,7 @@ ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T } return first; + #endif } template -- cgit v1.2.3