diff options
author | weili <weili@chromium.org> | 2016-05-16 13:53:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-16 13:53:42 -0700 |
commit | 3cc01f2ba255f4b7584668ee2b8e5ed97792c26d (patch) | |
tree | 6a207d8910696ef1c28ef60a855ae266f81067cd /core/fxcrt | |
parent | c6450bb06b69528406a2a261c70c4ea769965a8d (diff) | |
download | pdfium-3cc01f2ba255f4b7584668ee2b8e5ed97792c26d.tar.xz |
Fix the code that causes warnings
These are the left or newly added code which causes compilation
warnings of "signed and unsigned comparison". Need to fix them
before I re-enable the warning flag.
BUG=pdfium:29
Review-Url: https://codereview.chromium.org/1986533002
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_basic_wstring.cpp | 3 | ||||
-rw-r--r-- | core/fxcrt/fx_basic_wstring_unittest.cpp | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp index 241c3a6985..ba86823fe2 100644 --- a/core/fxcrt/fx_basic_wstring.cpp +++ b/core/fxcrt/fx_basic_wstring.cpp @@ -894,7 +894,8 @@ void CFX_WideString::TrimLeft(const CFX_WideStringC& pTargets) { FX_STRSIZE pos = 0; while (pos < len) { FX_STRSIZE i = 0; - while (i < pTargets.GetLength() && pTargets[i] != m_pData->m_String[pos]) { + while (i < pTargets.GetLength() && + pTargets.CharAt(i) != m_pData->m_String[pos]) { i++; } if (i == pTargets.GetLength()) { diff --git a/core/fxcrt/fx_basic_wstring_unittest.cpp b/core/fxcrt/fx_basic_wstring_unittest.cpp index 4b6f4a5800..efd958d8a6 100644 --- a/core/fxcrt/fx_basic_wstring_unittest.cpp +++ b/core/fxcrt/fx_basic_wstring_unittest.cpp @@ -691,10 +691,10 @@ TEST(fxcrt, WideStringUTF16LE_Encode) { TEST(fxcrt, WideStringCOperatorSubscript) { // CFX_WideStringC includes the NUL terminator for non-empty strings. CFX_WideStringC abc(L"abc"); - EXPECT_EQ(L'a', abc[0]); - EXPECT_EQ(L'b', abc[1]); - EXPECT_EQ(L'c', abc[2]); - EXPECT_EQ(L'\0', abc[3]); + EXPECT_EQ(L'a', abc.CharAt(0)); + EXPECT_EQ(L'b', abc.CharAt(1)); + EXPECT_EQ(L'c', abc.CharAt(2)); + EXPECT_EQ(L'\0', abc.CharAt(3)); } TEST(fxcrt, WideStringCOperatorLT) { |