CGameArea: Make use of size_t where applicable

Plays nicer with the standard library and avoids truncation warnings.
This commit is contained in:
Lioncash
2020-06-18 05:10:09 -04:00
parent 456530605f
commit 6d98e918ae
13 changed files with 79 additions and 76 deletions

View File

@@ -33,11 +33,13 @@ void CLayerModel::SetArea(CGameArea *pArea)
CScriptLayer* CLayerModel::Layer(const QModelIndex& index) const
{
if (!mpArea) return nullptr;
uint32 NumLayers = mpArea->NumScriptLayers();
if (!mpArea)
return nullptr;
if (index.row() < (int) NumLayers)
return mpArea->ScriptLayer(index.row());
const size_t NumLayers = mpArea->NumScriptLayers();
if (index.row() < static_cast<int>(NumLayers))
return mpArea->ScriptLayer(static_cast<size_t>(index.row()));
return nullptr;
}