mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Merge branch 'esmreader_log' into 'master'
Improve a bit two esmreader logging call See merge request OpenMW/openmw!1037
This commit is contained in:
commit
82eb0c6a7a
@ -125,8 +125,7 @@ void ESMReader::getHExact(void*p, int size)
|
|||||||
{
|
{
|
||||||
getSubHeader();
|
getSubHeader();
|
||||||
if (size != static_cast<int> (mCtx.leftSub))
|
if (size != static_cast<int> (mCtx.leftSub))
|
||||||
fail("Size mismatch, requested " + std::to_string(size) + " but got "
|
reportSubSizeMismatch(size, mCtx.leftSub);
|
||||||
+ std::to_string(mCtx.leftSub));
|
|
||||||
getExact(p, size);
|
getExact(p, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,7 +263,7 @@ void ESMReader::getRecHeader(uint32_t &flags)
|
|||||||
|
|
||||||
// Check that sizes add up
|
// Check that sizes add up
|
||||||
if (mCtx.leftFile < mCtx.leftRec)
|
if (mCtx.leftFile < mCtx.leftRec)
|
||||||
fail("Record size is larger than rest of file");
|
reportSubSizeMismatch(mCtx.leftFile, mCtx.leftRec);
|
||||||
|
|
||||||
// Adjust number of bytes mCtx.left in file
|
// Adjust number of bytes mCtx.left in file
|
||||||
mCtx.leftFile -= mCtx.leftRec;
|
mCtx.leftFile -= mCtx.leftRec;
|
||||||
|
@ -258,7 +258,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
[[noreturn]] void reportSubSizeMismatch(size_t want, size_t got) {
|
[[noreturn]] void reportSubSizeMismatch(size_t want, size_t got) {
|
||||||
fail("subrecord size mismatch, requested " +
|
fail("record size mismatch, requested " +
|
||||||
std::to_string(want) +
|
std::to_string(want) +
|
||||||
", got" +
|
", got" +
|
||||||
std::to_string(got));
|
std::to_string(got));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user