Fix some sign comparison warnings.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1279493003 .

(cherry picked from commit b4c2167fff88665089eeab47afa45a9e890060a3)

Review URL: https://codereview.chromium.org/1287703002 .
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 9d23158..7f078e5 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1208,7 +1208,7 @@
   wchar_t* pResult = (wchar_t*)malloc(iSize.ValueOrDie());
   wchar_t* pFrom = (wchar_t*)cbFrom.GetBuffer(iLength);
 
-  for (int i = 0; i < iLength; i++) {
+  for (size_t i = 0; i < iLength; i++) {
     if (pFrom[i] == L'\\' || pFrom[i] == L'/') {
       pResult[i] = L'\0';
       break;
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 8d7d207..f71ea37 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -1135,8 +1135,8 @@
   if (-1 != pEvent->SelStart())
     w_strSelected = w_strValue2.substr(pEvent->SelStart(),
                                        (pEvent->SelEnd() - pEvent->SelStart()));
-  FX_BOOL bHasSign =
-      (w_strValue2.find('-') != -1) && (w_strSelected.find('-') == -1);
+  bool bHasSign = (w_strValue2.find('-') != std::wstring::npos) &&
+                  (w_strSelected.find('-') == std::wstring::npos);
   if (bHasSign) {
     // can't insert "change" in front to sign postion.
     if (pEvent->SelStart() == 0) {
@@ -1159,7 +1159,7 @@
       break;
   }
 
-  FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
+  bool bHasSep = (w_strValue2.find(cSep) != std::wstring::npos);
   for (std::wstring::iterator it = w_strChange2.begin();
        it != w_strChange2.end(); it++) {
     if (*it == cSep) {
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 858af00..c735b97 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -253,14 +253,12 @@
       return FALSE;  // currently, it doesn't support XFAPicture.
     }
 
-    int iIndex;
-    for (iIndex = 0; iIndex < sizeof(fcTable) / sizeof(stru_TbConvert);
-         iIndex++) {
+    for (size_t i = 0; i < sizeof(fcTable) / sizeof(stru_TbConvert); ++i) {
       int iStart = 0;
       int iEnd;
-      while ((iEnd = cFormat.find(fcTable[iIndex].lpszJSMark, iStart)) != -1) {
-        cFormat.replace(iEnd, FXSYS_wcslen(fcTable[iIndex].lpszJSMark),
-                        fcTable[iIndex].lpszCppMark);
+      while ((iEnd = cFormat.find(fcTable[i].lpszJSMark, iStart)) != -1) {
+        cFormat.replace(iEnd, FXSYS_wcslen(fcTable[i].lpszJSMark),
+                        fcTable[i].lpszCppMark);
         iStart = iEnd;
       }
     }
@@ -292,25 +290,23 @@
         {L"M", iMin},       {L"s", iSec},
     };
 
-    for (iIndex = 0; iIndex < sizeof(cTableAd) / sizeof(stru_TbConvertAd);
-         iIndex++) {
+    for (size_t i = 0; i < sizeof(cTableAd) / sizeof(stru_TbConvertAd); ++i) {
       wchar_t tszValue[10];
       CFX_WideString sValue;
-      sValue.Format(L"%d", cTableAd[iIndex].iValue);
+      sValue.Format(L"%d", cTableAd[i].iValue);
       memcpy(tszValue, (wchar_t*)sValue.GetBuffer(sValue.GetLength() + 1),
              (sValue.GetLength() + 1) * sizeof(wchar_t));
 
       int iStart = 0;
       int iEnd;
-      while ((iEnd = cFormat.find(cTableAd[iIndex].lpszJSMark, iStart)) != -1) {
+      while ((iEnd = cFormat.find(cTableAd[i].lpszJSMark, iStart)) != -1) {
         if (iEnd > 0) {
           if (cFormat[iEnd - 1] == L'%') {
             iStart = iEnd + 1;
             continue;
           }
         }
-        cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[iIndex].lpszJSMark),
-                        tszValue);
+        cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[i].lpszJSMark), tszValue);
         iStart = iEnd;
       }
     }
@@ -335,14 +331,12 @@
     return;  // currently, it doesn't support XFAPicture.
   }
 
-  int iIndex;
-  for (iIndex = 0; iIndex < sizeof(fcTable) / sizeof(stru_TbConvert);
-       iIndex++) {
+  for (size_t i = 0; i < sizeof(fcTable) / sizeof(stru_TbConvert); ++i) {
     int iStart = 0;
     int iEnd;
-    while ((iEnd = cFormat.find(fcTable[iIndex].lpszJSMark, iStart)) != -1) {
-      cFormat.replace(iEnd, FXSYS_wcslen(fcTable[iIndex].lpszJSMark),
-                      fcTable[iIndex].lpszCppMark);
+    while ((iEnd = cFormat.find(fcTable[i].lpszJSMark, iStart)) != -1) {
+      cFormat.replace(iEnd, FXSYS_wcslen(fcTable[i].lpszJSMark),
+                      fcTable[i].lpszCppMark);
       iStart = iEnd;
     }
   }
@@ -377,28 +371,23 @@
   };
 
   // cFormat = strFormat.GetBuffer(strFormat.GetLength()+1);
-  for (iIndex = 0; iIndex < sizeof(cTableAd) / sizeof(stru_TbConvertAd);
-       iIndex++) {
+  for (size_t i = 0; i < sizeof(cTableAd) / sizeof(stru_TbConvertAd); ++i) {
     wchar_t tszValue[10];
-    //_itot(cTableAd[iIndex].iValue,tszValue,10);
     CFX_WideString sValue;
-    sValue.Format(L"%d", cTableAd[iIndex].iValue);
+    sValue.Format(L"%d", cTableAd[i].iValue);
     memcpy(tszValue, (wchar_t*)sValue.GetBuffer(sValue.GetLength() + 1),
            sValue.GetLength() * sizeof(wchar_t));
 
-    // strFormat.Replace(cTableAd[iIndex].lpszJSMark,"%d");
-    // strFormat.Format(strFormat,cTableAd[iIndex].iValue);
     int iStart = 0;
     int iEnd;
-    while ((iEnd = cFormat.find(cTableAd[iIndex].lpszJSMark, iStart)) != -1) {
+    while ((iEnd = cFormat.find(cTableAd[i].lpszJSMark, iStart)) != -1) {
       if (iEnd > 0) {
         if (cFormat[iEnd - 1] == L'%') {
           iStart = iEnd + 1;
           continue;
         }
       }
-      cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[iIndex].lpszJSMark),
-                      tszValue);
+      cFormat.replace(iEnd, FXSYS_wcslen(cTableAd[i].lpszJSMark), tszValue);
       iStart = iEnd;
     }
   }
@@ -441,7 +430,6 @@
     char letter = cFormat[iIndex];
     switch (letter) {
       case '?':
-        // cPurpose.push_back(cSource[itSource]);
         cPurpose += cSource[itSource];
         itSource++;
         break;
@@ -450,7 +438,6 @@
           if ((cSource[itSource] >= '0' && cSource[itSource] <= '9') ||
               (cSource[itSource] >= 'a' && cSource[itSource] <= 'z') ||
               (cSource[itSource] >= 'A' && cSource[itSource] <= 'Z')) {
-            // cPurpose.push_back(cSource[itSource]);
             cPurpose += cSource[itSource];
             itSource++;
             break;
@@ -463,7 +450,6 @@
         while (itSource < iSize) {
           if ((cSource[itSource] >= 'a' && cSource[itSource] <= 'z') ||
               (cSource[itSource] >= 'A' && cSource[itSource] <= 'Z')) {
-            // cPurpose.push_back(cSource[itSource]);
             cPurpose += cSource[itSource];
             itSource++;
             break;
@@ -475,7 +461,6 @@
       case '9': {
         while (itSource < iSize) {
           if (cSource[itSource] >= '0' && cSource[itSource] <= '9') {
-            // cPurpose.push_back(cSource[itSource]);
             cPurpose += cSource[itSource];
             itSource++;
             break;
@@ -508,7 +493,6 @@
       case '=':
         break;
       default:
-        // cPurpose.push_back(letter);
         cPurpose += letter;
         break;
     }