mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 12:45:38 +00:00
Merge branch 'size' into 'master'
Reduce a bit the size of getHT See merge request OpenMW/openmw!975
This commit is contained in:
commit
f9667683e7
2 changed files with 9 additions and 6 deletions
|
@ -198,7 +198,7 @@ void ESMReader::skipHSubSize(int size)
|
|||
{
|
||||
skipHSub();
|
||||
if (static_cast<int> (mCtx.leftSub) != size)
|
||||
fail("skipHSubSize() mismatch");
|
||||
reportSubSizeMismatch(mCtx.leftSub, size);
|
||||
}
|
||||
|
||||
void ESMReader::skipHSubUntil(const char *name)
|
||||
|
|
|
@ -134,11 +134,7 @@ public:
|
|||
{
|
||||
getSubHeader();
|
||||
if (mCtx.leftSub != sizeof(X))
|
||||
{
|
||||
fail("getHT(): subrecord size mismatch,requested "
|
||||
+ std::to_string(sizeof(X)) + ", got"
|
||||
+ std::to_string(mCtx.leftSub));
|
||||
}
|
||||
reportSubSizeMismatch(sizeof(X), mCtx.leftSub);
|
||||
getT(x);
|
||||
}
|
||||
|
||||
|
@ -261,6 +257,13 @@ public:
|
|||
size_t getFileSize() const { return mFileSize; }
|
||||
|
||||
private:
|
||||
[[noreturn]] void reportSubSizeMismatch(size_t want, size_t got) {
|
||||
fail("subrecord size mismatch, requested " +
|
||||
std::to_string(want) +
|
||||
", got" +
|
||||
std::to_string(got));
|
||||
}
|
||||
|
||||
void clearCtx();
|
||||
|
||||
Files::IStreamPtr mEsm;
|
||||
|
|
Loading…
Reference in a new issue