Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp

Issue 2023173002: Fix some signed/unsigned comparisons in xfa_fm2jscontext.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index e778d429948df19ebcaa50d4e3e25203666f74fe..9768b16116f260c4efcc6ec2c3ab9c8f8032547d 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -380,7 +380,8 @@ void AlternateDateTimeSymbols(CFX_WideString& wsPattern,
int32_t nLength = wsPattern.GetLength();
FX_BOOL bInConstRange = FALSE;
FX_BOOL bEscape = FALSE;
- int32_t i = 0, n = 0;
+ int32_t i = 0;
+ FX_WCHAR n = 0;
while (i < nLength) {
FX_WCHAR wc = wsPattern[i];
if (wc == L'\'') {
@@ -395,7 +396,7 @@ void AlternateDateTimeSymbols(CFX_WideString& wsPattern,
continue;
}
if (!bInConstRange && (n = wc - L'A') >= 0 && n <= (L'a' - L'A')) {
Lei Zhang 2016/06/01 05:27:04 How about we get rid of |n| and do: if (... wc >=
Oliver Chang 2016/06/01 16:08:22 Done.
- int32_t nAlt = (int32_t)pAltTable[n];
+ int32_t nAlt = static_cast<int32_t>(pAltTable[n]);
Lei Zhang 2016/06/01 05:27:04 Just make |nAlt| a uint8_t?
Lei Zhang 2016/06/01 05:27:04 BTW, both of the possible tables, |g_sAltTable_Dat
Oliver Chang 2016/06/01 16:08:22 Done. Also removed the unused entries (now 33 entr
if (nAlt != 255)
wsPattern.SetAt(i, wsAltSymbols[nAlt]);
}
@@ -4228,7 +4229,7 @@ void CXFA_FM2JSContext::EncodeURL(const CFX_ByteStringC& szURLString,
} else if (ch >= 0x20 && ch <= 0x7e) {
wsResultBuf.AppendChar(ch);
} else {
- int32_t iRadix = 16;
+ FX_WCHAR iRadix = 16;
Lei Zhang 2016/06/01 05:27:04 const?
Oliver Chang 2016/06/01 16:08:22 Done.
CFX_WideString strTmp;
while (ch >= iRadix) {
FX_WCHAR tmp = strCode[ch % iRadix];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698