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

@@ -128,7 +128,7 @@ LegoResult LegoROI::Read(
m_parentROI = p_unk0xd4;
if (p_storage->Read(&length, sizeof(length)) != SUCCESS) {
if (p_storage->Read(&length, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
m_name = new LegoChar[length + 1];
@@ -153,7 +153,7 @@ LegoResult LegoROI::Read(
SET3(m_unk0x80.Min(), box.GetMin());
SET3(m_unk0x80.Max(), box.GetMax());
if (p_storage->Read(&length, sizeof(length)) != SUCCESS) {
if (p_storage->Read(&length, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
@@ -169,7 +169,7 @@ LegoResult LegoROI::Read(
textureName = NULL;
}
if (p_storage->Read(&m_unk0x100, sizeof(m_unk0x100)) != SUCCESS) {
if (p_storage->Read(&m_unk0x100, sizeof(undefined)) != SUCCESS) {
goto done;
}
@@ -192,7 +192,7 @@ LegoResult LegoROI::Read(
}
}
else {
if (p_storage->Read(&numLODs, sizeof(numLODs)) != SUCCESS) {
if (p_storage->Read(&numLODs, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
@@ -203,7 +203,7 @@ LegoResult LegoROI::Read(
const LegoChar* roiName = m_name;
LegoU32 offset;
if (p_storage->Read(&offset, sizeof(offset)) != SUCCESS) {
if (p_storage->Read(&offset, sizeof(LegoU32)) != SUCCESS) {
goto done;
}
@@ -312,7 +312,7 @@ LegoResult LegoROI::Read(
}
}
if (p_storage->Read(&numROIs, sizeof(numROIs)) != SUCCESS) {
if (p_storage->Read(&numROIs, sizeof(LegoU32)) != SUCCESS) {
goto done;
}