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

@@ -7,6 +7,8 @@
DECOMP_SIZE_ASSERT(MxBitmap, 0x20);
DECOMP_SIZE_ASSERT(MxBITMAPINFO, 0x428);
DECOMP_SIZE_ASSERT(BITMAPFILEHEADER, 0xe);
// GLOBAL: LEGO1 0x10102184
// GLOBAL: BETA10 0x10203030
MxU16 g_bitmapSignature = TWOCC('B', 'M');
@@ -207,7 +209,7 @@ MxResult MxBitmap::LoadFile(HANDLE p_handle)
MxLong size;
DWORD bytesRead;
BITMAPFILEHEADER hdr;
if (!ReadFile(p_handle, &hdr, sizeof(hdr), &bytesRead, NULL)) {
if (!ReadFile(p_handle, &hdr, 14, &bytesRead, NULL)) {
goto done;
}