mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
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:

committed by
GitHub

parent
c9b41e2db8
commit
2915aa014f
@@ -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++) {
|
||||
|
Reference in New Issue
Block a user