diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-04 13:57:02 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-04 19:15:31 +0000 |
commit | cb6c8d4ec4781c7db8448f2b4d9a8af879cf014e (patch) | |
tree | de752e161b1196c6b26b2f34418b7dff7ee39b64 /xfa/fxfa/parser/cxfa_treelist.cpp | |
parent | 981a2908d7a213363772d1846a7c63c2cfd73c7e (diff) | |
download | pdfium-cb6c8d4ec4781c7db8448f2b4d9a8af879cf014e.tar.xz |
Make CXFA_List::GetLength return a size_t
This requires a number of other minor cleanups to get sizes and
signedness agreeing everywhere.
Change-Id: Ie25318a23d458be5a8a2a91927c3b37eb198f5ce
Reviewed-on: https://pdfium-review.googlesource.com/22256
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_treelist.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_treelist.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_treelist.cpp b/xfa/fxfa/parser/cxfa_treelist.cpp index 754c80d661..941020fe27 100644 --- a/xfa/fxfa/parser/cxfa_treelist.cpp +++ b/xfa/fxfa/parser/cxfa_treelist.cpp @@ -11,6 +11,7 @@ #include "core/fxcrt/fx_extension.h" #include "fxjs/cfxjse_engine.h" #include "fxjs/xfa/cjx_treelist.h" +#include "third_party/base/numerics/safe_conversions.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_list.h" #include "xfa/fxfa/parser/cxfa_node.h" @@ -26,9 +27,9 @@ CXFA_TreeList::~CXFA_TreeList() {} CXFA_Node* CXFA_TreeList::NamedItem(const WideStringView& wsName) { uint32_t dwHashCode = FX_HashCode_GetW(wsName, false); - int32_t iCount = GetLength(); - for (int32_t i = 0; i < iCount; i++) { - CXFA_Node* ret = Item(i); + size_t count = GetLength(); + for (size_t i = 0; i < count; i++) { + CXFA_Node* ret = Item(pdfium::base::checked_cast<int32_t>(i)); if (dwHashCode == ret->GetNameHash()) return ret; } |