1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00
This commit is contained in:
AnyOldName3 2024-03-21 16:18:18 +00:00
parent da8150e2e4
commit 818a99a870
4 changed files with 11 additions and 11 deletions

View file

@ -244,16 +244,16 @@ namespace ESM
skipHString(); skipHString();
} }
void ESMReader::getHExact(void* p, int size) void ESMReader::getHExact(void* p, std::size_t size)
{ {
getSubHeader(); getSubHeader();
if (size != static_cast<int>(mCtx.leftSub)) if (size != mCtx.leftSub)
reportSubSizeMismatch(size, mCtx.leftSub); reportSubSizeMismatch(size, mCtx.leftSub);
getExact(p, size); getExact(p, size);
} }
// Read the given number of bytes from a named subrecord // Read the given number of bytes from a named subrecord
void ESMReader::getHNExact(void* p, int size, NAME name) void ESMReader::getHNExact(void* p, std::size_t size, NAME name)
{ {
getSubNameIs(name); getSubNameIs(name);
getHExact(p, size); getHExact(p, size);
@ -326,10 +326,10 @@ namespace ESM
skip(mCtx.leftSub); skip(mCtx.leftSub);
} }
void ESMReader::skipHSubSize(int size) void ESMReader::skipHSubSize(std::size_t size)
{ {
skipHSub(); skipHSub();
if (static_cast<int>(mCtx.leftSub) != size) if (mCtx.leftSub != size)
reportSubSizeMismatch(mCtx.leftSub, size); reportSubSizeMismatch(mCtx.leftSub, size);
} }

View file

@ -238,10 +238,10 @@ namespace ESM
void skipHRefId(); void skipHRefId();
// Read the given number of bytes from a subrecord // Read the given number of bytes from a subrecord
void getHExact(void* p, int size); void getHExact(void* p, std::size_t size);
// Read the given number of bytes from a named subrecord // Read the given number of bytes from a named subrecord
void getHNExact(void* p, int size, NAME name); void getHNExact(void* p, std::size_t size, NAME name);
ESM::FormId getFormId(bool wide = false, NAME tag = "FRMR"); ESM::FormId getFormId(bool wide = false, NAME tag = "FRMR");
@ -275,7 +275,7 @@ namespace ESM
void skipHSub(); void skipHSub();
// Skip sub record and check its size // Skip sub record and check its size
void skipHSubSize(int size); void skipHSubSize(std::size_t size);
// Skip all subrecords until the given subrecord or no more subrecords remaining // Skip all subrecords until the given subrecord or no more subrecords remaining
void skipHSubUntil(NAME name); void skipHSubUntil(NAME name);

View file

@ -25,7 +25,7 @@ namespace ESM
// Loads data and marks it as loaded. Return true if data is actually loaded from reader, false otherwise // Loads data and marks it as loaded. Return true if data is actually loaded from reader, false otherwise
// including the case when data is already loaded. // including the case when data is already loaded.
bool condLoad(ESMReader& reader, int flags, int& targetFlags, int dataFlag, void* ptr, unsigned int size) bool condLoad(ESMReader& reader, int flags, int& targetFlags, int dataFlag, void* ptr, std::size_t size)
{ {
if ((targetFlags & dataFlag) == 0 && (flags & dataFlag) != 0) if ((targetFlags & dataFlag) == 0 && (flags & dataFlag) != 0)
{ {
@ -94,7 +94,7 @@ namespace ESM
mDataTypes |= DATA_VHGT; mDataTypes |= DATA_VHGT;
break; break;
case fourCC("WNAM"): case fourCC("WNAM"):
esm.getHExact(mWnam.data(), static_cast<int>(mWnam.size())); esm.getHExact(mWnam.data(), mWnam.size());
mDataTypes |= DATA_WNAM; mDataTypes |= DATA_WNAM;
break; break;
case fourCC("VCLR"): case fourCC("VCLR"):

View file

@ -87,7 +87,7 @@ namespace ESM
esm.writeHNT("DATA", mFlags); esm.writeHNT("DATA", mFlags);
esm.writeHNT("NNAM", mChanceNone); esm.writeHNT("NNAM", mChanceNone);
esm.writeHNT<uint32_t>("INDX", static_cast<int>(mList.size())); esm.writeHNT("INDX", static_cast<uint32_t>(mList.size()));
for (const auto& item : mList) for (const auto& item : mList)
{ {