Revert changes to libs

This commit is contained in:
PJB3005
2026-03-05 13:32:05 +01:00
parent 3ffc3266d7
commit 3f8130407e
11 changed files with 41 additions and 41 deletions
@@ -9,7 +9,7 @@ template<class ForwardIt, class Size, class T>
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);
}
}
+15 -15
View File
@@ -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);
@@ -89,7 +89,7 @@ namespace homebutton {
if (mpAllocator) {
MEMFreeToAllocator(mpAllocator, p);
} else {
JKR_DELETE(static_cast<IDToComponent*>(p));
delete static_cast<IDToComponent*>(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());
@@ -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();
}
}
}
@@ -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);
@@ -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;
}
@@ -32,7 +32,7 @@ namespace nw4hbm {
const res::Material* pResMaterial = detail::ConvertOffsToPtr<res::Material>(
resBlockSet.pMaterialList, matOffsTbl[pResPic->materialIdx]);
mpMaterial = JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet);
mpMaterial = new (pMemMaterial) Material(pResMaterial, resBlockSet);
}
}
@@ -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<res::Material>(
resBlockSet.pMaterialList, matOffsTbl[pBlock->materialIdx]);
mpMaterial = JKR_NEW_ARGS (pMemMaterial) Material(pResMaterial, resBlockSet);
mpMaterial = new (pMemMaterial) Material(pResMaterial, resBlockSet);
}
}
@@ -232,7 +232,7 @@ namespace nw4hbm {
const res::Material* pResMaterial = detail::ConvertOffsToPtr<res::Material>(
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);
}
}
}
@@ -38,7 +38,7 @@ namespace nw4hbm {
return NULL;
}
return JKR_NEW_ARGS (ptr) T;
return new (ptr) T;
}
void Free(T* obj) {
@@ -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);