Fix multiple classes being inappropriately zero-initialized via JKR_NEW* (#70)

This might also fix #71 and #72.
This commit is contained in:
Max Roncace
2026-03-13 02:50:06 -04:00
parent addcda0725
commit eed6df2f46
25 changed files with 73 additions and 73 deletions
+9 -9
View File
@@ -56,7 +56,7 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
heap = JASDram;
}
JASBasicBank* bank = JKR_NEW_ARGS (heap, 0) JASBasicBank();
JASBasicBank* bank = JKR_NEW_ARGS (heap, 0) JASBasicBank;
if (bank == NULL) {
return NULL;
}
@@ -94,7 +94,7 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
BE(u32)* data = (BE(u32)*)((intptr_t)stream + list_chunk->mOffsets[i]);
switch (*data++) {
case 'Inst': {
JASBasicInst* instp = JKR_NEW_ARGS (heap, 0) JASBasicInst();
JASBasicInst* instp = JKR_NEW_ARGS (heap, 0) JASBasicInst;
JUT_ASSERT(187, instp != NULL);
u32 count = *data++;
for (int j = 0; j < count; j++) {
@@ -126,7 +126,7 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
}
case 'Perc': {
JASDrumSet* drump = JKR_NEW_ARGS (heap, 0) JASDrumSet();
JASDrumSet* drump = JKR_NEW_ARGS (heap, 0) JASDrumSet;
JUT_ASSERT(264, drump != NULL);
u32 pmap_count = data[1];
JUT_ASSERT(268, pmap_count <= 128);
@@ -135,7 +135,7 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
for (int j = 0; j < count; j++) {
u32 offset = *data++;
if (offset != 0) {
JASDrumSet::TPerc* percp = JKR_NEW_ARGS (heap, 0) JASDrumSet::TPerc();
JASDrumSet::TPerc* percp = JKR_NEW_ARGS (heap, 0) JASDrumSet::TPerc;
JUT_ASSERT(277, percp);
u32 type = data[0];
JUT_ASSERT(282, type == 'Pmap');
@@ -177,7 +177,7 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
}
THeader const* header = (THeader*)stream;
JASBasicBank* bank = JKR_NEW_ARGS (heap, 0) JASBasicBank();
JASBasicBank* bank = JKR_NEW_ARGS (heap, 0) JASBasicBank;
if (bank == NULL) {
return NULL;
}
@@ -187,7 +187,7 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
for (int i = 0; i < 0x80; i++) {
TInst* tinst = header->mOffsets.mInstOffset[i].ptr(header);
if (tinst != NULL) {
JASBasicInst* instp = JKR_NEW_ARGS (heap, 0) JASBasicInst();
JASBasicInst* instp = JKR_NEW_ARGS (heap, 0) JASBasicInst;
JUT_ASSERT(368, instp != NULL);
instp->setVolume(tinst->mVolume);
instp->setPitch(tinst->mPitch);
@@ -200,7 +200,7 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
if (osc != NULL) {
instp->setOsc(osc_idx, osc);
} else {
osc = JKR_NEW_ARGS (heap, 0) JASOscillator::Data();
osc = JKR_NEW_ARGS (heap, 0) JASOscillator::Data;
JUT_ASSERT(386, osc != NULL);
osc->mTarget = tosc->mTarget;
osc->_04 = tosc->field_0x4;
@@ -256,14 +256,14 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
for (int i = 0; i < 12; i++) {
TPerc* tperc = header->mOffsets.mPercOffset[i].ptr(header);
if (tperc != NULL) {
JASDrumSet* setp = JKR_NEW_ARGS (heap, 0) JASDrumSet();
JASDrumSet* setp = JKR_NEW_ARGS (heap, 0) JASDrumSet;
JUT_ASSERT(509, setp != NULL);
setp->newPercArray(0x80, heap);
for (int j = 0; j < 0x80; j++) {
TPmap* tpmap = tperc->mPmapOffset[j].ptr(header);
if (tpmap != NULL) {
JASDrumSet::TPerc* percp = JKR_NEW_ARGS (heap, 0) JASDrumSet::TPerc();
JASDrumSet::TPerc* percp = JKR_NEW_ARGS (heap, 0) JASDrumSet::TPerc;
JUT_ASSERT(519, percp);
percp->setVolume(tpmap->mVolume);
percp->setPitch(tpmap->mPitch);