summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-20 21:41:36 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-21 04:53:07 +0000
commite247ec47b75d45d16298e4e11ba68745b9ebe3eb (patch)
treee121024f171c04c928459b258b8cae1c1b9d0b56 /core/fxcrt/xml
parent1badb85e5c3a4b4cd42ca1a2b223d6b3bc67cc4a (diff)
downloadpdfium-e247ec47b75d45d16298e4e11ba68745b9ebe3eb.tar.xz
Replace FXSYS_iswdigit with std::iswdigit.
Replace other one-off implementations as well. Change-Id: I2878f3fae479c12b7de5234ee3a26477d602d14d Reviewed-on: https://pdfium-review.googlesource.com/4398 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt/xml')
-rw-r--r--core/fxcrt/xml/cfx_xmlsyntaxparser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
index ac3f1b5c5d..e3d690f5ab 100644
--- a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
@@ -7,6 +7,7 @@
#include "core/fxcrt/xml/cfx_xmlsyntaxparser.h"
#include <algorithm>
+#include <cwctype>
#include <iterator>
#include "core/fxcrt/fx_extension.h"
@@ -633,20 +634,19 @@ void CFX_XMLSyntaxParser::ParseTextChar(wchar_t character) {
if (iLen > 1 && csEntity[1] == L'x') {
for (int32_t i = 2; i < iLen; i++) {
w = csEntity[i];
- if (w >= L'0' && w <= L'9') {
+ if (std::iswdigit(w))
ch = (ch << 4) + w - L'0';
- } else if (w >= L'A' && w <= L'F') {
+ else if (w >= L'A' && w <= L'F')
ch = (ch << 4) + w - 55;
- } else if (w >= L'a' && w <= L'f') {
+ else if (w >= L'a' && w <= L'f')
ch = (ch << 4) + w - 87;
- } else {
+ else
break;
- }
}
} else {
for (int32_t i = 1; i < iLen; i++) {
w = csEntity[i];
- if (w < L'0' || w > L'9')
+ if (!std::iswdigit(w))
break;
ch = ch * 10 + w - L'0';
}