CAudioMacro: Make use of size_t where applicable

This commit is contained in:
Lioncash 2020-06-22 22:41:20 -04:00
parent 5d0a08b207
commit e2dedf1b31
2 changed files with 8 additions and 8 deletions

View File

@ -466,23 +466,23 @@ void GenerateAssetNames(CGameProject *pProj)
for (TResourceIterator<EResourceType::AudioMacro> It(pStore); It; ++It)
{
CAudioMacro *pMacro = (CAudioMacro*) It->Load();
const auto* pMacro = static_cast<CAudioMacro*>(It->Load());
TString MacroName = pMacro->MacroName();
ApplyGeneratedName(*It, kSfxDir, MacroName);
for (uint32 iSamp = 0; iSamp < pMacro->NumSamples(); iSamp++)
for (size_t iSamp = 0; iSamp < pMacro->NumSamples(); iSamp++)
{
CAssetID SampleID = pMacro->SampleByIndex(iSamp);
CResourceEntry *pSample = pStore->FindEntry(SampleID);
const CAssetID SampleID = pMacro->SampleByIndex(iSamp);
CResourceEntry* pSample = pStore->FindEntry(SampleID);
if (pSample && !pSample->IsNamed())
if (pSample != nullptr && !pSample->IsNamed())
{
TString SampleName;
if (pMacro->NumSamples() == 1)
SampleName = MacroName;
else
SampleName = TString::Format("%s_%d", *MacroName, iSamp);
SampleName = TString::Format("%s_%zu", *MacroName, iSamp);
ApplyGeneratedName(pSample, kSfxDir, SampleName);
}

View File

@ -28,8 +28,8 @@ public:
// Accessors
TString MacroName() const { return mMacroName; }
uint32 NumSamples() const { return mSamples.size(); }
CAssetID SampleByIndex(uint32 Index) const { return mSamples[Index]; }
size_t NumSamples() const { return mSamples.size(); }
CAssetID SampleByIndex(size_t Index) const { return mSamples[Index]; }
};
#endif // CAUDIOMACRO_H