From 8b1408e7053247def45659515cda19a64a7fccd5 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 27 Sep 2017 11:07:51 -0400 Subject: Remove FXSYS_strlen and FXSYS_wcslen With the conversion of internal string sizes to size_t, these wrappers are no longer needed. Replacing them with strlen and wcslen respectively. BUG=pdfium:828 Change-Id: Ia087ca2ddaf688a57ec9bd9ddfb8533cbe41510d Reviewed-on: https://pdfium-review.googlesource.com/14890 Commit-Queue: Ryan Harrison Reviewed-by: dsinclair --- xfa/fxfa/cxfa_ffwidget.cpp | 6 +++--- xfa/fxfa/cxfa_textparser.cpp | 4 ++-- xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp | 3 +-- xfa/fxfa/parser/cxfa_dataexporter.cpp | 2 +- xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 859287388f..77f1ac5006 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -1780,7 +1780,7 @@ static uint8_t* XFA_RemoveBase64Whitespace(const uint8_t* pStr, int32_t iLen) { uint8_t* pCP; int32_t i = 0, j = 0; if (iLen == 0) { - iLen = FXSYS_strlen((char*)pStr); + iLen = strlen((char*)pStr); } pCP = FX_Alloc(uint8_t, iLen + 1); for (; i < iLen; i++) { @@ -1799,11 +1799,11 @@ static int32_t XFA_Base64Decode(const char* pStr, uint8_t* pOutBuffer) { return 0; } uint8_t* pBuffer = - XFA_RemoveBase64Whitespace((uint8_t*)pStr, FXSYS_strlen((char*)pStr)); + XFA_RemoveBase64Whitespace((uint8_t*)pStr, strlen((char*)pStr)); if (!pBuffer) { return 0; } - int32_t iLen = FXSYS_strlen((char*)pBuffer); + int32_t iLen = strlen((char*)pBuffer); int32_t i = 0, j = 0; uint32_t dwLimb = 0; for (; i + 3 < iLen; i += 4) { diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp index 9cbb72aa19..35e9b01580 100644 --- a/xfa/fxfa/cxfa_textparser.cpp +++ b/xfa/fxfa/cxfa_textparser.cpp @@ -84,8 +84,8 @@ std::unique_ptr CXFA_TextParser::LoadDefaultSheetStyle() { L"sub{vertical-align:-15em;font-size:.66em}"; auto sheet = pdfium::MakeUnique(); - return sheet->LoadBuffer(s_pStyle, FXSYS_wcslen(s_pStyle)) ? std::move(sheet) - : nullptr; + return sheet->LoadBuffer(s_pStyle, wcslen(s_pStyle)) ? std::move(sheet) + : nullptr; } RetainPtr CXFA_TextParser::CreateRootStyle( diff --git a/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp index b4d070ac7d..00df0163f7 100644 --- a/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/cxfa_fm2jscontext.cpp @@ -3342,8 +3342,7 @@ WideString CXFA_FM2JSContext::DecodeXML(const WideString& wsXMLString) { const wchar_t* const strName[] = {L"quot", L"amp", L"apos", L"lt", L"gt"}; int32_t iIndex = 0; while (iIndex < 5) { - if (memcmp(strString, strName[iIndex], FXSYS_wcslen(strName[iIndex])) == - 0) { + if (memcmp(strString, strName[iIndex], wcslen(strName[iIndex])) == 0) { break; } ++iIndex; diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index 5433ba788e..44b0dca98c 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -399,7 +399,7 @@ void XFA_DataExporter_RegenerateFormFile( pStream->WriteString(L" xmlns=\""); const wchar_t* pURI = XFA_GetPacketByIndex(XFA_PACKET_Form)->pURI; - pStream->WriteString(WideStringView(pURI, FXSYS_wcslen(pURI))); + pStream->WriteString(WideStringView(pURI, wcslen(pURI))); WideString wsVersionNumber; RecognizeXFAVersionNumber( diff --git a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp index 7d9a2188c8..8bc71f11d3 100644 --- a/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp +++ b/xfa/fxfa/parser/cxfa_itemlayoutprocessor.cpp @@ -36,7 +36,7 @@ std::vector SeparateStringW(const wchar_t* pStr, if (!pStr) return ret; if (iStrLen < 0) - iStrLen = FXSYS_wcslen(pStr); + iStrLen = wcslen(pStr); const wchar_t* pToken = pStr; const wchar_t* pEnd = pStr + iStrLen; -- cgit v1.2.3