From 0cda26b10521856406e03d01a63b9739642e5246 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 06:54:53 -0400 Subject: [PATCH] CScriptTemplate: Make use of size_t where applicable Plays nicer with standard containers and eliminates implicit truncation warnings. --- src/Core/Resource/Script/CScriptTemplate.h | 6 +++--- src/Core/Scene/CScriptNode.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Core/Resource/Script/CScriptTemplate.h b/src/Core/Resource/Script/CScriptTemplate.h index 7051a323..e9649806 100644 --- a/src/Core/Resource/Script/CScriptTemplate.h +++ b/src/Core/Resource/Script/CScriptTemplate.h @@ -153,9 +153,9 @@ public: bool IsVisible() const { return mVisible; } TString SourceFile() const { return mSourceFile; } CStructProperty* Properties() const { return mpProperties.get(); } - uint32 NumAttachments() const { return mAttachments.size(); } - const SAttachment& Attachment(uint32 Index) const { return mAttachments[Index]; } - const std::vector& RequiredModules() const { return mModules; } + size_t NumAttachments() const { return mAttachments.size(); } + const SAttachment& Attachment(size_t Index) const { return mAttachments[Index]; } + const std::vector& RequiredModules() const { return mModules; } CStringProperty* NameProperty() const { return mpNameProperty; } CVectorProperty* PositionProperty() const { return mpPositionProperty; } diff --git a/src/Core/Scene/CScriptNode.cpp b/src/Core/Scene/CScriptNode.cpp index 36a8a0e2..825fe389 100644 --- a/src/Core/Scene/CScriptNode.cpp +++ b/src/Core/Scene/CScriptNode.cpp @@ -54,7 +54,7 @@ CScriptNode::CScriptNode(CScene *pScene, uint32 NodeID, CSceneNode *pParent, CSc } // Create attachment nodes - for (uint32 iAttach = 0; iAttach < pTemp->NumAttachments(); iAttach++) + for (size_t iAttach = 0; iAttach < pTemp->NumAttachments(); iAttach++) { const SAttachment& rkAttach = pTemp->Attachment(iAttach); CScriptAttachNode *pAttach = new CScriptAttachNode(pScene, rkAttach, this);