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

@@ -64,7 +64,7 @@ LegoResult LegoTree::Read(LegoStorage* p_storage, LegoTreeNode*& p_node)
return result;
}
LegoU32 numChildren;
if ((result = p_storage->Read(&numChildren, sizeof(numChildren))) != SUCCESS) {
if ((result = p_storage->Read(&numChildren, sizeof(LegoU32))) != SUCCESS) {
return result;
}
if (numChildren) {
@@ -91,7 +91,7 @@ LegoResult LegoTree::Write(LegoStorage* p_storage, LegoTreeNode* p_node)
}
}
LegoU32 numChildren = p_node->GetNumChildren();
if ((result = p_storage->Write(&numChildren, sizeof(numChildren))) != SUCCESS) {
if ((result = p_storage->Write(&numChildren, sizeof(LegoU32))) != SUCCESS) {
return result;
}
for (LegoU32 i = 0; i < p_node->GetNumChildren(); i++) {