summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-03-09 17:46:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-09 17:46:50 +0000
commit69da36c5f841e8c6e5ded6c704d9ef58c57d532a (patch)
tree42f50adb5d062f3971f8c6a4f899e737f5462c6c /xfa
parent3baef5c6daf58cec2df193714b5727802d0bd42e (diff)
downloadpdfium-69da36c5f841e8c6e5ded6c704d9ef58c57d532a.tar.xz
Explicitly mark helper methods that only operate on ASCII ranges
A number of our character helper methods take in wide character types, but only do tests/operations on the ASCII range of characters. As a very quick first pass I am renaming all of the foot-gun methods to explictly call out this behaviour, while I do a bigger cleanup/refactor. BUG=pdfium:1035 Change-Id: Ia035dfa1cb6812fa6d45155c4565475032c4c165 Reviewed-on: https://pdfium-review.googlesource.com/28330 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/crt/cfgas_formatstring.cpp8
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmlexer.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_localevalue.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fgas/crt/cfgas_formatstring.cpp b/xfa/fgas/crt/cfgas_formatstring.cpp
index d7273d0e4a..e4185b83c9 100644
--- a/xfa/fgas/crt/cfgas_formatstring.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring.cpp
@@ -1096,7 +1096,7 @@ bool CFGAS_FormatString::ParseText(const WideString& wsSrcText,
break;
}
case 'A':
- if (FXSYS_iswalpha(pStrText[iText])) {
+ if (FXSYS_iswASCIIalpha(pStrText[iText])) {
*wsValue += pStrText[iText];
iText++;
}
@@ -1110,7 +1110,7 @@ bool CFGAS_FormatString::ParseText(const WideString& wsSrcText,
case 'O':
case '0':
if (FXSYS_isDecimalDigit(pStrText[iText]) ||
- FXSYS_iswalpha(pStrText[iText])) {
+ FXSYS_iswASCIIalpha(pStrText[iText])) {
*wsValue += pStrText[iText];
iText++;
}
@@ -1815,7 +1815,7 @@ bool CFGAS_FormatString::FormatText(const WideString& wsSrcText,
break;
}
case 'A':
- if (iText >= iLenText || !FXSYS_iswalpha(pStrText[iText]))
+ if (iText >= iLenText || !FXSYS_iswASCIIalpha(pStrText[iText]))
return false;
*wsOutput += pStrText[iText++];
@@ -1831,7 +1831,7 @@ bool CFGAS_FormatString::FormatText(const WideString& wsSrcText,
case 'O':
case '0':
if (iText >= iLenText || (!FXSYS_isDecimalDigit(pStrText[iText]) &&
- !FXSYS_iswalpha(pStrText[iText]))) {
+ !FXSYS_iswASCIIalpha(pStrText[iText]))) {
return false;
}
*wsOutput += pStrText[iText++];
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
index 3559fb7aeb..4dc8788a1a 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
@@ -306,7 +306,7 @@ CXFA_FMToken CXFA_FMLexer::AdvanceForNumber() {
wchar_t* end = nullptr;
if (m_cursor)
wcstod(const_cast<wchar_t*>(m_cursor), &end);
- if (!end || FXSYS_iswalpha(*end)) {
+ if (!end || FXSYS_iswASCIIalpha(*end)) {
RaiseError();
return CXFA_FMToken();
}
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 8ef67e5183..57d6fbb4b6 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -202,7 +202,7 @@ double CXFA_LocaleValue::GetDoubleNum() const {
bool bExpSign = false;
const wchar_t* str = m_wsValue.c_str();
int len = m_wsValue.GetLength();
- while (FXSYS_iswspace(str[cc]) && cc < len)
+ while (FXSYS_iswASCIIspace(str[cc]) && cc < len)
cc++;
if (cc >= len)