mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
refactor: only use sizeof with parenthesis
This commit is contained in:
@ -46,8 +46,8 @@ class IPak::Impl : public ObjContainerReferenceable
|
||||
|
||||
for (unsigned itemIndex = 0; itemIndex < m_index_section->itemCount; itemIndex++)
|
||||
{
|
||||
m_stream->read(reinterpret_cast<char*>(&indexEntry), sizeof indexEntry);
|
||||
if (m_stream->gcount() != sizeof indexEntry)
|
||||
m_stream->read(reinterpret_cast<char*>(&indexEntry), sizeof(indexEntry));
|
||||
if (m_stream->gcount() != sizeof(indexEntry))
|
||||
{
|
||||
printf("Unexpected eof when trying to load index entry %u.\n", itemIndex);
|
||||
return false;
|
||||
@ -99,7 +99,7 @@ class IPak::Impl : public ObjContainerReferenceable
|
||||
IPakHeader header{};
|
||||
|
||||
m_stream->read(reinterpret_cast<char*>(&header), sizeof(header));
|
||||
if (m_stream->gcount() != sizeof header)
|
||||
if (m_stream->gcount() != sizeof(header))
|
||||
{
|
||||
printf("Unexpected eof when trying to load header.\n");
|
||||
return false;
|
||||
|
@ -126,7 +126,7 @@ protected:
|
||||
while (skipAmount > 0)
|
||||
{
|
||||
char temp[1024];
|
||||
const auto toRead = skipAmount > sizeof temp ? sizeof temp : static_cast<size_t>(skipAmount);
|
||||
const auto toRead = skipAmount > sizeof(temp) ? sizeof(temp) : static_cast<size_t>(skipAmount);
|
||||
unzReadCurrentFile(m_container, temp, toRead);
|
||||
skipAmount -= toRead;
|
||||
}
|
||||
@ -216,7 +216,7 @@ public:
|
||||
{
|
||||
unz_file_info64 info;
|
||||
char fileNameBuffer[256];
|
||||
unzGetCurrentFileInfo64(m_unz_file, &info, fileNameBuffer, sizeof fileNameBuffer, nullptr, 0, nullptr, 0);
|
||||
unzGetCurrentFileInfo64(m_unz_file, &info, fileNameBuffer, sizeof(fileNameBuffer), nullptr, 0, nullptr, 0);
|
||||
|
||||
std::string fileName(fileNameBuffer);
|
||||
std::filesystem::path path(fileName);
|
||||
|
Reference in New Issue
Block a user