Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: core/fxcrt/fx_basic_wstring.cpp

Issue 1801383002: Re-enable several MSVC warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase again Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcrt/fx_basic_maps.cpp ('k') | core/fxge/dib/fx_dib_composite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_wstring.cpp
diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp
index 95b761bd09e67a55b38ae5216ab5e555b8872a96..8282bd501453013802f26ae0e121dcb5bb56527a 100644
--- a/core/fxcrt/fx_basic_wstring.cpp
+++ b/core/fxcrt/fx_basic_wstring.cpp
@@ -640,13 +640,12 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld,
FX_STRSIZE nCount = 0;
FX_WCHAR* lpszStart = m_pData->m_String;
FX_WCHAR* lpszEnd = m_pData->m_String + m_pData->m_nDataLength;
- FX_WCHAR* lpszTarget;
- {
- while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) &&
- lpszStart < lpszEnd) {
- nCount++;
- lpszStart = lpszTarget + nSourceLen;
- }
+ while (lpszStart < lpszEnd) {
+ FX_WCHAR* lpszTarget = FXSYS_wcsstr(lpszStart, lpszOld);
+ if (!lpszTarget)
+ break;
+ nCount++;
+ lpszStart = lpszTarget + nSourceLen;
}
if (nCount > 0) {
CopyBeforeWrite();
@@ -667,9 +666,10 @@ FX_STRSIZE CFX_WideString::Replace(const FX_WCHAR* lpszOld,
lpszStart = m_pData->m_String;
lpszEnd = m_pData->m_String + std::max(m_pData->m_nDataLength, nNewLength);
{
- while ((lpszTarget = (FX_WCHAR*)FXSYS_wcsstr(lpszStart, lpszOld)) !=
- NULL &&
- lpszStart < lpszEnd) {
+ while (lpszStart < lpszEnd) {
+ FX_WCHAR* lpszTarget = FXSYS_wcsstr(lpszStart, lpszOld);
+ if (!lpszTarget)
+ break;
FX_STRSIZE nBalance =
nOldLength -
(FX_STRSIZE)(lpszTarget - m_pData->m_String + nSourceLen);
« no previous file with comments | « core/fxcrt/fx_basic_maps.cpp ('k') | core/fxge/dib/fx_dib_composite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698