Use sizeof(type) instead of sizeof(variableName) when (de)serializing data (#1505)

* Use sizeof(type) instead of sizeof(variableName) when (de)serializing data

* Less usage of sizeof(variableName) while (de)serializing
This commit is contained in:
Anonymous Maarten
2025-05-18 22:56:28 +02:00
committed by GitHub
parent c9b41e2db8
commit 2915aa014f
27 changed files with 227 additions and 234 deletions

View File

@@ -178,43 +178,34 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
LegoActorInfo* info = &g_actorInfo[i];
if (p_storage->Read(&info->m_sound, sizeof(info->m_sound)) != SUCCESS) {
if (p_storage->Read(&info->m_sound, sizeof(MxS32)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_move, sizeof(info->m_move)) != SUCCESS) {
if (p_storage->Read(&info->m_move, sizeof(MxS32)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_mood, sizeof(info->m_mood)) != SUCCESS) {
if (p_storage->Read(&info->m_mood, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_infohatPart].m_unk0x08, sizeof(info->m_parts[c_infohatPart].m_unk0x08)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_infohatPart].m_unk0x08, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_infohatPart].m_unk0x14, sizeof(info->m_parts[c_infohatPart].m_unk0x14)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_infohatPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(
&info->m_parts[c_infogronPart].m_unk0x14,
sizeof(info->m_parts[c_infogronPart].m_unk0x14)
) != SUCCESS) {
if (p_storage->Read(&info->m_parts[c_infogronPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_armlftPart].m_unk0x14, sizeof(info->m_parts[c_armlftPart].m_unk0x14)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_armlftPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_armrtPart].m_unk0x14, sizeof(info->m_parts[c_armrtPart].m_unk0x14)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_armrtPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_leglftPart].m_unk0x14, sizeof(info->m_parts[c_leglftPart].m_unk0x14)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_leglftPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
if (p_storage->Read(&info->m_parts[c_legrtPart].m_unk0x14, sizeof(info->m_parts[c_legrtPart].m_unk0x14)) !=
SUCCESS) {
if (p_storage->Read(&info->m_parts[c_legrtPart].m_unk0x14, sizeof(MxU8)) != SUCCESS) {
goto done;
}
}