refactor: only use sizeof with parenthesis

This commit is contained in:
Jan
2024-03-24 19:56:06 +01:00
parent 4f0ee35740
commit 1b13f1f1b4
16 changed files with 33 additions and 33 deletions

View File

@ -146,7 +146,7 @@ void ContentLoader::Load(Zone* zone, IZoneInputStream* stream)
m_stream->PushBlock(XFILE_BLOCK_VIRTUAL);
XAssetList assetList{};
m_stream->LoadDataRaw(&assetList, sizeof assetList);
m_stream->LoadDataRaw(&assetList, sizeof(assetList));
varScriptStringList = &assetList.stringList;
LoadScriptStringList(false);

View File

@ -166,7 +166,7 @@ void ContentLoader::Load(Zone* zone, IZoneInputStream* stream)
m_stream->PushBlock(XFILE_BLOCK_VIRTUAL);
XAssetList assetList{};
m_stream->LoadDataRaw(&assetList, sizeof assetList);
m_stream->LoadDataRaw(&assetList, sizeof(assetList));
varScriptStringList = &assetList.stringList;
LoadScriptStringList(false);

View File

@ -130,11 +130,11 @@ class ZoneLoaderFactory::Impl
zoneLoader->AddLoadingStep(std::make_unique<StepVerifyMagic>(ZoneConstants::MAGIC_AUTH_HEADER));
zoneLoader->AddLoadingStep(std::make_unique<StepSkipBytes>(4)); // Skip reserved
auto subHeaderHash = std::make_unique<StepLoadHash>(sizeof DB_AuthHash::bytes, 1);
auto subHeaderHash = std::make_unique<StepLoadHash>(sizeof(DB_AuthHash::bytes), 1);
auto* subHeaderHashPtr = subHeaderHash.get();
zoneLoader->AddLoadingStep(std::move(subHeaderHash));
auto subHeaderHashSignature = std::make_unique<StepLoadSignature>(sizeof DB_AuthSignature::bytes);
auto subHeaderHashSignature = std::make_unique<StepLoadSignature>(sizeof(DB_AuthSignature::bytes));
auto* subHeaderHashSignaturePtr = subHeaderHashSignature.get();
zoneLoader->AddLoadingStep(std::move(subHeaderHashSignature));
@ -147,7 +147,7 @@ class ZoneLoaderFactory::Impl
zoneLoader->AddLoadingStep(std::make_unique<StepVerifyFileName>(fileName, sizeof(DB_AuthSubHeader::fastfileName)));
zoneLoader->AddLoadingStep(std::make_unique<StepSkipBytes>(4)); // Skip reserved
auto masterBlockHashes = std::make_unique<StepLoadHash>(sizeof DB_AuthHash::bytes, std::extent_v<decltype(DB_AuthSubHeader::masterBlockHashes)>);
auto masterBlockHashes = std::make_unique<StepLoadHash>(sizeof(DB_AuthHash::bytes), std::extent_v<decltype(DB_AuthSubHeader::masterBlockHashes)>);
auto* masterBlockHashesPtr = masterBlockHashes.get();
zoneLoader->AddLoadingStep(std::move(masterBlockHashes));

View File

@ -175,7 +175,7 @@ void ContentLoader::Load(Zone* zone, IZoneInputStream* stream)
m_stream->PushBlock(XFILE_BLOCK_VIRTUAL);
XAssetList assetList{};
m_stream->LoadDataRaw(&assetList, sizeof assetList);
m_stream->LoadDataRaw(&assetList, sizeof(assetList));
varScriptStringList = &assetList.stringList;
LoadScriptStringList(false);

View File

@ -114,11 +114,11 @@ class ZoneLoaderFactory::Impl
zoneLoader->AddLoadingStep(std::make_unique<StepVerifyMagic>(ZoneConstants::MAGIC_AUTH_HEADER));
zoneLoader->AddLoadingStep(std::make_unique<StepSkipBytes>(4)); // Skip reserved
auto subHeaderHash = std::make_unique<StepLoadHash>(sizeof DB_AuthHash::bytes, 1);
auto subHeaderHash = std::make_unique<StepLoadHash>(sizeof(DB_AuthHash::bytes), 1);
auto* subHeaderHashPtr = subHeaderHash.get();
zoneLoader->AddLoadingStep(std::move(subHeaderHash));
auto subHeaderHashSignature = std::make_unique<StepLoadSignature>(sizeof DB_AuthSignature::bytes);
auto subHeaderHashSignature = std::make_unique<StepLoadSignature>(sizeof(DB_AuthSignature::bytes));
auto* subHeaderHashSignaturePtr = subHeaderHashSignature.get();
zoneLoader->AddLoadingStep(std::move(subHeaderHashSignature));
@ -131,7 +131,7 @@ class ZoneLoaderFactory::Impl
zoneLoader->AddLoadingStep(std::make_unique<StepVerifyFileName>(fileName, sizeof(DB_AuthSubHeader::fastfileName)));
zoneLoader->AddLoadingStep(std::make_unique<StepSkipBytes>(4)); // Skip reserved
auto masterBlockHashes = std::make_unique<StepLoadHash>(sizeof DB_AuthHash::bytes, std::extent_v<decltype(DB_AuthSubHeader::masterBlockHashes)>);
auto masterBlockHashes = std::make_unique<StepLoadHash>(sizeof(DB_AuthHash::bytes), std::extent_v<decltype(DB_AuthSubHeader::masterBlockHashes)>);
auto* masterBlockHashesPtr = masterBlockHashes.get();
zoneLoader->AddLoadingStep(std::move(masterBlockHashes));

View File

@ -159,7 +159,7 @@ void ContentLoader::Load(Zone* zone, IZoneInputStream* stream)
m_stream->PushBlock(XFILE_BLOCK_VIRTUAL);
XAssetList assetList{};
m_stream->LoadDataRaw(&assetList, sizeof assetList);
m_stream->LoadDataRaw(&assetList, sizeof(assetList));
varScriptStringList = &assetList.stringList;
LoadScriptStringList(false);

View File

@ -188,7 +188,7 @@ void ContentLoader::Load(Zone* zone, IZoneInputStream* stream)
m_stream->PushBlock(XFILE_BLOCK_VIRTUAL);
XAssetList assetList{};
m_stream->LoadDataRaw(&assetList, sizeof assetList);
m_stream->LoadDataRaw(&assetList, sizeof(assetList));
varScriptStringList = &assetList.stringList;
LoadScriptStringList(false);