From e247ec47b75d45d16298e4e11ba68745b9ebe3eb Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 20 Apr 2017 21:41:36 -0700 Subject: 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 Reviewed-by: Tom Sepez --- core/fxcrt/xml/cfx_xmlsyntaxparser.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/fxcrt/xml') 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 +#include #include #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'; } -- cgit v1.2.3