diff --git a/libs/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/memory b/libs/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/memory index 1bed557cfa..58a22ef4d7 100644 --- a/libs/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/memory +++ b/libs/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include/memory @@ -9,7 +9,7 @@ template inline void uninitialized_fill_n(ForwardIt first, Size count, const T& value) { ForwardIt r29 = first; for (; count--; ++first) { - JKR_NEW_ARGS (first) T(value); + new (first) T(value); } } diff --git a/libs/revolution/src/homebuttonLib/HBMBase.cpp b/libs/revolution/src/homebuttonLib/HBMBase.cpp index e73a7b1200..f7666506cc 100644 --- a/libs/revolution/src/homebuttonLib/HBMBase.cpp +++ b/libs/revolution/src/homebuttonLib/HBMBase.cpp @@ -141,7 +141,7 @@ namespace homebutton { void* pvVar4 = MEMAllocFromAllocator(&sSoundAllocator, sizeof(nw4hbm::snd::NandSoundArchive)); if (pvVar4 != NULL) { - mpNandSoundArchive = JKR_NEW_ARGS (pvVar4) nw4hbm::snd::NandSoundArchive(); + mpNandSoundArchive = new (pvVar4) nw4hbm::snd::NandSoundArchive(); } NW4HBM_ASSERT(LN(3941, 3884), mpNandSoundArchive); @@ -261,7 +261,7 @@ namespace homebutton { void HomeButton::createInstance(const HBMDataInfo* pHBInfo) { if (void* pMem = HBMAllocMem(sizeof(*spHomeButtonObj))) { - spHomeButtonObj = JKR_NEW_ARGS (pMem) HomeButton(pHBInfo); + spHomeButtonObj = new (pMem) HomeButton(pHBInfo); } } @@ -509,7 +509,7 @@ namespace homebutton { set_text(); if (void* pMem = HBMAllocMem(sizeof(*mpResAccessor))) { - mpResAccessor = JKR_NEW_ARGS (pMem) nw4hbm::lyt::ArcResourceAccessor(); + mpResAccessor = new (pMem) nw4hbm::lyt::ArcResourceAccessor(); } NW4HBM_ASSERT(623, mpResAccessor); @@ -518,7 +518,7 @@ namespace homebutton { if (!mpHBInfo->cursor) { for (i = 0; i < (int)ARRAY_SIZE(mpCursorLayout); i++) { if (void* pMem = HBMAllocMem(sizeof(*mpCursorLayout)[i])) { - mpCursorLayout[i] = JKR_NEW_ARGS (pMem) nw4hbm::lyt::Layout(); + mpCursorLayout[i] = new (pMem) nw4hbm::lyt::Layout(); } NW4HBM_ASSERT(635, mpCursorLayout[i]); @@ -530,7 +530,7 @@ namespace homebutton { } if (void* pMem = HBMAllocMem(sizeof(*mpLayout))) { - mpLayout = JKR_NEW_ARGS (pMem) nw4hbm::lyt::Layout(); + mpLayout = new (pMem) nw4hbm::lyt::Layout(); } { @@ -546,7 +546,7 @@ namespace homebutton { NW4HBM_ASSERT_CHECK_NULL(665, lpaRes); if (void* pMem = HBMAllocMem(sizeof(*mpAnmController)[i])) { - mpAnmController[i] = JKR_NEW_ARGS (pMem) GroupAnmController(); + mpAnmController[i] = new (pMem) GroupAnmController(); } NW4HBM_ASSERT(671, mpAnmController[i]); @@ -578,7 +578,7 @@ namespace homebutton { NW4HBM_ASSERT_CHECK_NULL(697, lpaRes); if (void* pMem = HBMAllocMem(sizeof(*mpGroupAnmController)[i])) { - mpGroupAnmController[i] = JKR_NEW_ARGS (pMem) GroupAnmController(); + mpGroupAnmController[i] = new (pMem) GroupAnmController(); } NW4HBM_ASSERT(703, mpGroupAnmController[i]); @@ -611,7 +611,7 @@ namespace homebutton { NW4HBM_ASSERT_CHECK_NULL(729, lpaRes); if (void* pMem = HBMAllocMem(sizeof(*mpPairGroupAnmController)[i])) { - mpPairGroupAnmController[i] = JKR_NEW_ARGS (pMem) GroupAnmController(); + mpPairGroupAnmController[i] = new (pMem) GroupAnmController(); } NW4HBM_ASSERT(735, mpPairGroupAnmController[i]); @@ -636,14 +636,14 @@ namespace homebutton { } if (void* pMem = HBMAllocMem(sizeof(*mpHomeButtonEventHandler))) { - mpHomeButtonEventHandler = JKR_NEW_ARGS (pMem) HomeButtonEventHandler(this); + mpHomeButtonEventHandler = new (pMem) HomeButtonEventHandler(this); } NW4HBM_ASSERT(758, mpHomeButtonEventHandler); if (void* pMem = HBMAllocMem(sizeof(*mpPaneManager))) { mpPaneManager = - JKR_NEW_ARGS (pMem) gui::PaneManager(mpHomeButtonEventHandler, NULL, spAllocator); + new (pMem) gui::PaneManager(mpHomeButtonEventHandler, NULL, spAllocator); } NW4HBM_ASSERT(765, mpPaneManager); @@ -658,12 +658,12 @@ namespace homebutton { } if (void* pMem = HBMAllocMem(sizeof(*mpRemoteSpk))) { - mpRemoteSpk = JKR_NEW_ARGS (pMem) RemoteSpk(mpHBInfo->spkSeBuf); + mpRemoteSpk = new (pMem) RemoteSpk(mpHBInfo->spkSeBuf); } for (i = 0; i < WPAD_MAX_CONTROLLERS; i++) { if (void* pMem = HBMAllocMem(sizeof(*mpController)[i])) { - mpController[i] = JKR_NEW_ARGS (pMem) Controller(i, mpRemoteSpk); + mpController[i] = new (pMem) Controller(i, mpRemoteSpk); } } @@ -2832,7 +2832,7 @@ namespace homebutton { void* buffer = MEMAllocFromAllocator(&sSoundAllocator, sizeof(nw4hbm::snd::SoundArchivePlayer)); if (buffer != NULL) { - mpSoundArchivePlayer = JKR_NEW_ARGS (buffer) nw4hbm::snd::SoundArchivePlayer(); + mpSoundArchivePlayer = new (buffer) nw4hbm::snd::SoundArchivePlayer(); } NW4HBM_ASSERT(LN(3752, 3695), mpSoundArchivePlayer); @@ -2848,14 +2848,14 @@ namespace homebutton { buffer = MEMAllocFromAllocator(&sSoundAllocator, sizeof(nw4hbm::snd::SoundHandle)); if (buffer != NULL) { - mpSoundHandle = JKR_NEW_ARGS (buffer) nw4hbm::snd::SoundHandle(); + mpSoundHandle = new (buffer) nw4hbm::snd::SoundHandle(); } NW4HBM_ASSERT(LN(3777, 3720), mpSoundHandle); if (bCreateSoundHeap) { buffer = MEMAllocFromAllocator(&sSoundAllocator, sizeof(nw4hbm::snd::SoundHeap)); if (buffer != NULL) { - mpSoundHeap = JKR_NEW_ARGS (buffer) nw4hbm::snd::SoundHeap(); + mpSoundHeap = new (buffer) nw4hbm::snd::SoundHeap(); } NW4HBM_ASSERT(LN(3786, 3729), mpSoundHeap); diff --git a/libs/revolution/src/homebuttonLib/HBMGUIManager.cpp b/libs/revolution/src/homebuttonLib/HBMGUIManager.cpp index 5e90a5af3a..0cb856cbdf 100644 --- a/libs/revolution/src/homebuttonLib/HBMGUIManager.cpp +++ b/libs/revolution/src/homebuttonLib/HBMGUIManager.cpp @@ -89,7 +89,7 @@ namespace homebutton { if (mpAllocator) { MEMFreeToAllocator(mpAllocator, p); } else { - JKR_DELETE(static_cast(p)); + delete static_cast(p); } } } @@ -109,9 +109,9 @@ namespace homebutton { if (mpAllocator) { void* p = MEMAllocFromAllocator(mpAllocator, sizeof(IDToComponent)); - nw4hbm::ut::List_Append(&mIDToComponent, JKR_NEW_ARGS (p) IDToComponent(uID, pComponent)); + nw4hbm::ut::List_Append(&mIDToComponent, new (p) IDToComponent(uID, pComponent)); } else { - nw4hbm::ut::List_Append(&mIDToComponent, JKR_NEW IDToComponent(uID, pComponent)); + nw4hbm::ut::List_Append(&mIDToComponent, new IDToComponent(uID, pComponent)); } } @@ -132,7 +132,7 @@ namespace homebutton { if (mpAllocator) { MEMFreeToAllocator(mpAllocator, p); } else { - JKR_DELETE(p); + delete p; } } @@ -220,8 +220,8 @@ namespace homebutton { MEMFreeToAllocator(mpAllocator, pPaneToComponent->mpComponent); MEMFreeToAllocator(mpAllocator, pPaneToComponent); } else { - JKR_DELETE(pPaneToComponent->mpComponent); - JKR_DELETE(pPaneToComponent); + delete pPaneToComponent->mpComponent; + delete pPaneToComponent; } } } @@ -251,11 +251,11 @@ namespace homebutton { void* p1 = MEMAllocFromAllocator(mpAllocator, sizeof(*pPaneComponent)); void* p2 = MEMAllocFromAllocator(mpAllocator, sizeof(*pPaneToComponent)); - pPaneComponent = JKR_NEW_ARGS (p1) PaneComponent(suIDCounter); - pPaneToComponent = JKR_NEW_ARGS (p2) PaneToComponent(&(*it), pPaneComponent); + pPaneComponent = new (p1) PaneComponent(suIDCounter); + pPaneToComponent = new (p2) PaneToComponent(&(*it), pPaneComponent); } else { - pPaneComponent = JKR_NEW PaneComponent(suIDCounter); - pPaneToComponent = JKR_NEW PaneToComponent(&(*it), pPaneComponent); + pPaneComponent = new PaneComponent(suIDCounter); + pPaneToComponent = new PaneToComponent(&(*it), pPaneComponent); } nw4hbm::ut::List_Append(&mPaneToComponent, pPaneToComponent); @@ -306,8 +306,8 @@ namespace homebutton { MEMFreeToAllocator(mpAllocator, pPaneToComponent->mpComponent); MEMFreeToAllocator(mpAllocator, pPaneToComponent); } else { - JKR_DELETE(pPaneToComponent->mpComponent); - JKR_DELETE(pPaneToComponent); + delete pPaneToComponent->mpComponent; + delete pPaneToComponent; } walkInChildrenDel(it->GetChildList()); diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_animation.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_animation.cpp index 0a0540dd81..f142b9ff51 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_animation.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_animation.cpp @@ -323,7 +323,7 @@ namespace nw4hbm { std::memset(mAnimLinkAry, 0, sizeof(*mAnimLinkAry) * pRes->animContNum); for (u16 i = 0; i < pRes->animContNum; i++) { - JKR_NEW_ARGS (&mAnimLinkAry[i]) AnimationLink(); + new (&mAnimLinkAry[i]) AnimationLink(); } } } diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_group.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_group.cpp index 6021a5508d..c8a0835765 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_group.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_group.cpp @@ -45,7 +45,7 @@ namespace nw4hbm { void Group::AppendPane(Pane* pPane) { if (void* pMem = Layout::AllocMemory(sizeof(detail::PaneLink))) { - detail::PaneLink* pPaneLink = JKR_NEW_ARGS (pMem) detail::PaneLink(); + detail::PaneLink* pPaneLink = new (pMem) detail::PaneLink(); pPaneLink->mTarget = pPane; mPaneLinkList.PushBack(pPaneLink); diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_layout.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_layout.cpp index d7c80ad2f7..53f7566427 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_layout.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_layout.cpp @@ -23,7 +23,7 @@ namespace { void* pMem = Layout::AllocMemory(sizeof(T)); if (pMem) { - return JKR_NEW_ARGS (pMem) T(); + return new (pMem) T(); } else { NW4R_DB_WARNING(47, false, "can't alloc memory."); return NULL; @@ -35,7 +35,7 @@ namespace { void* pMem = Layout::AllocMemory(sizeof(T)); if (pMem) { - return JKR_NEW_ARGS (pMem) T(p1); + return new (pMem) T(p1); } else { return NULL; } @@ -46,7 +46,7 @@ namespace { void* pMem = Layout::AllocMemory(sizeof(T)); if (pMem) { - return JKR_NEW_ARGS (pMem) T(p1, p2); + return new (pMem) T(p1, p2); } else { return NULL; } diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_picture.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_picture.cpp index ca7672a86e..5d1d522523 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_picture.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_picture.cpp @@ -32,7 +32,7 @@ namespace nw4hbm { const res::Material* pResMaterial = detail::ConvertOffsToPtr( resBlockSet.pMaterialList, matOffsTbl[pResPic->materialIdx]); - mpMaterial = JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet); + mpMaterial = new (pMemMaterial) Material(pResMaterial, resBlockSet); } } diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_textBox.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_textBox.cpp index f22a3eddd8..d7bb8f9050 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_textBox.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_textBox.cpp @@ -252,7 +252,7 @@ namespace nw4hbm { resBlockSet.pResAccessor->GetResource('font', fontName, NULL)) { if (void* pMemFont = Layout::AllocMemory(sizeof(ut::ResFont))) { - ut::ResFont* pResFont = JKR_NEW_ARGS (pMemFont) ut::ResFont(); + ut::ResFont* pResFont = new (pMemFont) ut::ResFont(); bool bSuccess = pResFont->SetResource(fontRes); if (!bSuccess) { @@ -273,7 +273,7 @@ namespace nw4hbm { const res::Material* pResMaterial = detail::ConvertOffsToPtr( resBlockSet.pMaterialList, matOffsTbl[pBlock->materialIdx]); - mpMaterial = JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet); + mpMaterial = new (pMemMaterial) Material(pResMaterial, resBlockSet); } } diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_window.cpp b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_window.cpp index 36b8aa957e..294e5ca820 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_window.cpp +++ b/libs/revolution/src/homebuttonLib/nw4hbm/lyt/lyt_window.cpp @@ -232,7 +232,7 @@ namespace nw4hbm { const res::Material* pResMaterial = detail::ConvertOffsToPtr( resBlockSet.pMaterialList, matOffsTbl[pResContent->materialIdx]); - mpMaterial = JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet); + mpMaterial = new (pMemMaterial) Material(pResMaterial, resBlockSet); } mFrameNum = 0; @@ -260,7 +260,7 @@ namespace nw4hbm { matOffsTbl[pResWindowFrame->materialIdx]); mFrames[i].pMaterial = - JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet); + new (pMemMaterial) Material(pResMaterial, resBlockSet); } } } diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/snd/InstancePool.h b/libs/revolution/src/homebuttonLib/nw4hbm/snd/InstancePool.h index 3b29443c7a..69054fc90d 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/snd/InstancePool.h +++ b/libs/revolution/src/homebuttonLib/nw4hbm/snd/InstancePool.h @@ -38,7 +38,7 @@ namespace nw4hbm { return NULL; } - return JKR_NEW_ARGS (ptr) T; + return new (ptr) T; } void Free(T* obj) { diff --git a/libs/revolution/src/homebuttonLib/nw4hbm/snd/SoundInstanceManager.h b/libs/revolution/src/homebuttonLib/nw4hbm/snd/SoundInstanceManager.h index 403c7167f8..9649d6920b 100644 --- a/libs/revolution/src/homebuttonLib/nw4hbm/snd/SoundInstanceManager.h +++ b/libs/revolution/src/homebuttonLib/nw4hbm/snd/SoundInstanceManager.h @@ -39,7 +39,7 @@ namespace nw4hbm { void* ptr = mPool.Alloc(); if (ptr != NULL) { - sound = JKR_NEW_ARGS (ptr) T(this); + sound = new (ptr) T(this); } else { if (mPriorityList.IsEmpty()) { return NULL; @@ -57,7 +57,7 @@ namespace nw4hbm { ptr = mPool.Alloc(); NW4HBM_ASSERT_CHECK_NULL(114, ptr); - sound = JKR_NEW_ARGS (ptr) T(this); + sound = new (ptr) T(this); } InsertPriorityList(sound, priority);