diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-08-31 13:42:25 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-31 18:07:09 +0000 |
commit | 276dd94b300f1a5eb537fceb5bcfd311d75bd2e6 (patch) | |
tree | 3bd9c7b0e3b47568950e9342b581227a697f1137 /xfa/fxfa/fm2js/cxfa_fmlexer.cpp | |
parent | f4b0632fa5e2cb9947222b935d12ffbaad75aef1 (diff) | |
download | pdfium-276dd94b300f1a5eb537fceb5bcfd311d75bd2e6.tar.xz |
Clean up of typing in lexer code
BUG=pdfium:813
Change-Id: I4c638857bf114327dbc0344cc6d231b897f0d001
Reviewed-on: https://pdfium-review.googlesource.com/11971
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmlexer.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp index 16e07b5b4f..1a43e837f4 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp @@ -372,12 +372,13 @@ void 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_iswalpha(*end)) { RaiseError(); return; } - m_token->m_string = CFX_WideStringC(m_cursor, (end - m_cursor)); + m_token->m_string = + CFX_WideStringC(m_cursor, static_cast<FX_STRSIZE>(end - m_cursor)); m_cursor = end; } @@ -393,7 +394,8 @@ void CXFA_FMLexer::AdvanceForString() { ++m_cursor; // If the end of the input has been reached it was not escaped. if (m_cursor > m_end) { - m_token->m_string = CFX_WideStringC(start, (m_cursor - start)); + m_token->m_string = + CFX_WideStringC(start, static_cast<FX_STRSIZE>(m_cursor - start)); return; } // If the next character is not a " then the end of the string has been @@ -427,7 +429,8 @@ void CXFA_FMLexer::AdvanceForIdentifier() { } ++m_cursor; } - m_token->m_string = CFX_WideStringC(start, (m_cursor - start)); + m_token->m_string = + CFX_WideStringC(start, static_cast<FX_STRSIZE>(m_cursor - start)); m_token->m_type = TokenizeIdentifier(m_token->m_string); } |