CSectionMgrIn: Make use of size_t where applicable

This commit is contained in:
Lioncash 2020-06-28 01:04:20 -04:00
parent 8969685254
commit ecff1a7a2b
2 changed files with 6 additions and 8 deletions

View File

@ -580,7 +580,7 @@ void CAreaLoader::LoadSectionDataBuffers()
mpArea->mSectionDataBuffers.resize(mpSectionMgr->NumSections());
mpSectionMgr->ToSection(0);
for (uint32 iSec = 0; iSec < mpSectionMgr->NumSections(); iSec++)
for (size_t iSec = 0; iSec < mpSectionMgr->NumSections(); iSec++)
{
const uint32 Size = mpSectionMgr->CurrentSectionSize();
mpArea->mSectionDataBuffers[iSec].resize(Size);

View File

@ -15,13 +15,11 @@ class CSectionMgrIn
uint32 mSecsStart = 0;
public:
CSectionMgrIn(uint32 Count, IInputStream* pSrc)
: mpInputStream(pSrc)
CSectionMgrIn(size_t Count, IInputStream* pSrc)
: mpInputStream(pSrc), mSectionSizes(Count)
{
mSectionSizes.resize(Count);
for (uint32 iSec = 0; iSec < Count; iSec++)
mSectionSizes[iSec] = pSrc->ReadLong();
for (auto& size : mSectionSizes)
size = pSrc->ReadULong();
}
void Init()
@ -53,7 +51,7 @@ public:
uint32 NextOffset() const { return mCurSecStart + mSectionSizes[mCurSec]; }
uint32 CurrentSection() const { return mCurSec; }
uint32 CurrentSectionSize() const { return mSectionSizes[mCurSec]; }
uint32 NumSections() const { return mSectionSizes.size(); }
size_t NumSections() const { return mSectionSizes.size(); }
void SetInputStream(IInputStream *pIn) { mpInputStream = pIn; }
};