From 42059a389449665cdd4056648f9551103bb9c72e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 15 Mar 2017 12:22:48 -0400 Subject: Cleanup nits from prior CLs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie69dfc32e7b526eca2ac6ae621eed879ad98476e Reviewed-on: https://pdfium-review.googlesource.com/3054 Commit-Queue: dsinclair Commit-Queue: Nicolás Peña Reviewed-by: Nicolás Peña Reviewed-by: Tom Sepez --- xfa/fxfa/fm2js/xfa_lexer.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'xfa/fxfa/fm2js') diff --git a/xfa/fxfa/fm2js/xfa_lexer.cpp b/xfa/fxfa/fm2js/xfa_lexer.cpp index 5d3f6f5890..7ccd4773fb 100644 --- a/xfa/fxfa/fm2js/xfa_lexer.cpp +++ b/xfa/fxfa/fm2js/xfa_lexer.cpp @@ -62,9 +62,9 @@ inline bool XFA_FMDChar::isAvalid(const wchar_t* p, bool flag) { inline bool XFA_FMDChar::string2number(const wchar_t* s, double* pValue, const wchar_t*& pEnd) { - if (s) { - *pValue = wcstod((wchar_t*)s, (wchar_t**)&pEnd); - } + if (s) + *pValue = wcstod(const_cast(s), const_cast(&pEnd)); + return 0; } @@ -404,12 +404,11 @@ uint32_t CXFA_FMLexer::Number(CXFA_FMToken* t, const wchar_t* p, const wchar_t*& pEnd) { double number = 0; - if (XFA_FMDChar::string2number(p, &number, pEnd)) { + if (XFA_FMDChar::string2number(p, &number, pEnd)) return 1; - } - if (pEnd && XFA_FMDChar::isAlpha(pEnd)) { + if (pEnd && XFA_FMDChar::isAlpha(pEnd)) return 1; - } + t->m_wstring = CFX_WideStringC(p, (pEnd - p)); return 0; } -- cgit v1.2.3