summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-05-04 12:13:55 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-04 22:39:39 +0000
commite8c1d4144e8407c0631116a954fa347dd39375ff (patch)
tree6a91c1197a5c183ce0cb7c792755d121dd1ca9b6 /core/fpdfapi/parser/cpdf_parser.cpp
parent426b85af0f780e312221b061e2699c31821872f9 (diff)
downloadpdfium-e8c1d4144e8407c0631116a954fa347dd39375ff.tar.xz
Give a couple of char to int functions better names.chromium/3090
- FXSYS_toDecimalDigit() becomes FXSYS_DecimalCharToInt(). - FXSYS_toHexDigit() becomes FXSYS_HexCharToInt(). Change-Id: If4683e8f85f05124b92ff075056cbc295442087d Reviewed-on: https://pdfium-review.googlesource.com/4930 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 12ec81bc07..a3e5dba40a 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -144,13 +144,13 @@ CPDF_Parser::Error CPDF_Parser::StartParse(
return FORMAT_ERROR;
if (std::isdigit(ch))
- m_FileVersion = FXSYS_toDecimalDigit(static_cast<wchar_t>(ch)) * 10;
+ m_FileVersion = FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch)) * 10;
if (!m_pSyntax->GetCharAt(7, ch))
return FORMAT_ERROR;
if (std::isdigit(ch))
- m_FileVersion += FXSYS_toDecimalDigit(static_cast<wchar_t>(ch));
+ m_FileVersion += FXSYS_DecimalCharToInt(static_cast<wchar_t>(ch));
if (m_pSyntax->m_FileLen < m_pSyntax->m_HeaderOffset + 9)
return FORMAT_ERROR;
@@ -623,7 +623,7 @@ bool CPDF_Parser::RebuildCrossRef() {
if (std::isdigit(byte)) {
start_pos = pos + i;
state = ParserState::kObjNum;
- objnum = FXSYS_toDecimalDigit(static_cast<wchar_t>(byte));
+ objnum = FXSYS_DecimalCharToInt(static_cast<wchar_t>(byte));
} else if (byte == 't') {
state = ParserState::kTrailer;
inside_index = 1;
@@ -638,8 +638,8 @@ bool CPDF_Parser::RebuildCrossRef() {
case ParserState::kObjNum:
if (std::isdigit(byte)) {
- objnum =
- objnum * 10 + FXSYS_toDecimalDigit(static_cast<wchar_t>(byte));
+ objnum = objnum * 10 +
+ FXSYS_DecimalCharToInt(static_cast<wchar_t>(byte));
} else if (PDFCharIsWhitespace(byte)) {
state = ParserState::kPostObjNum;
} else {
@@ -653,7 +653,7 @@ bool CPDF_Parser::RebuildCrossRef() {
if (std::isdigit(byte)) {
start_pos1 = pos + i;
state = ParserState::kGenNum;
- gennum = FXSYS_toDecimalDigit(static_cast<wchar_t>(byte));
+ gennum = FXSYS_DecimalCharToInt(static_cast<wchar_t>(byte));
} else if (byte == 't') {
state = ParserState::kTrailer;
inside_index = 1;
@@ -665,8 +665,8 @@ bool CPDF_Parser::RebuildCrossRef() {
case ParserState::kGenNum:
if (std::isdigit(byte)) {
- gennum =
- gennum * 10 + FXSYS_toDecimalDigit(static_cast<wchar_t>(byte));
+ gennum = gennum * 10 +
+ FXSYS_DecimalCharToInt(static_cast<wchar_t>(byte));
} else if (PDFCharIsWhitespace(byte)) {
state = ParserState::kPostGenNum;
} else {
@@ -681,7 +681,7 @@ bool CPDF_Parser::RebuildCrossRef() {
inside_index = 1;
} else if (std::isdigit(byte)) {
objnum = gennum;
- gennum = FXSYS_toDecimalDigit(static_cast<wchar_t>(byte));
+ gennum = FXSYS_DecimalCharToInt(static_cast<wchar_t>(byte));
start_pos = start_pos1;
start_pos1 = pos + i;
state = ParserState::kGenNum;