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

Side by Side Diff: core/src/fxcrt/fx_basic_wstring.cpp

Issue 1783023002: Re-enable MSVC warning 4800 for compiling with chromium_code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: remove cast change on security_handler file 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 unified diff | Download patch
« no previous file with comments | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxge/agg/fx_agg_driver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cctype> 10 #include <cctype>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 ConcatInPlace(str.GetLength(), str.GetPtr()); 198 ConcatInPlace(str.GetLength(), str.GetPtr());
199 return *this; 199 return *this;
200 } 200 }
201 bool CFX_WideString::Equal(const wchar_t* ptr) const { 201 bool CFX_WideString::Equal(const wchar_t* ptr) const {
202 if (!m_pData) { 202 if (!m_pData) {
203 return !ptr || ptr[0] == L'\0'; 203 return !ptr || ptr[0] == L'\0';
204 } 204 }
205 if (!ptr) { 205 if (!ptr) {
206 return m_pData->m_nDataLength == 0; 206 return m_pData->m_nDataLength == 0;
207 } 207 }
208 return wcslen(ptr) == m_pData->m_nDataLength && 208 return wcslen(ptr) == static_cast<size_t>(m_pData->m_nDataLength) &&
209 wmemcmp(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0; 209 wmemcmp(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0;
210 } 210 }
211 bool CFX_WideString::Equal(const CFX_WideStringC& str) const { 211 bool CFX_WideString::Equal(const CFX_WideStringC& str) const {
212 if (!m_pData) { 212 if (!m_pData) {
213 return str.IsEmpty(); 213 return str.IsEmpty();
214 } 214 }
215 return str.GetLength() == m_pData->m_nDataLength && 215 return str.GetLength() == m_pData->m_nDataLength &&
216 wmemcmp(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength) == 0; 216 wmemcmp(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength) == 0;
217 } 217 }
218 bool CFX_WideString::Equal(const CFX_WideString& other) const { 218 bool CFX_WideString::Equal(const CFX_WideString& other) const {
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 int dest_len = 1041 int dest_len =
1042 FXSYS_MultiByteToWideChar(codepage, 0, bstr, src_len, nullptr, 0); 1042 FXSYS_MultiByteToWideChar(codepage, 0, bstr, src_len, nullptr, 0);
1043 CFX_WideString wstr; 1043 CFX_WideString wstr;
1044 if (dest_len) { 1044 if (dest_len) {
1045 FX_WCHAR* dest_buf = wstr.GetBuffer(dest_len); 1045 FX_WCHAR* dest_buf = wstr.GetBuffer(dest_len);
1046 FXSYS_MultiByteToWideChar(codepage, 0, bstr, src_len, dest_buf, dest_len); 1046 FXSYS_MultiByteToWideChar(codepage, 0, bstr, src_len, dest_buf, dest_len);
1047 wstr.ReleaseBuffer(dest_len); 1047 wstr.ReleaseBuffer(dest_len);
1048 } 1048 }
1049 return wstr; 1049 return wstr;
1050 } 1050 }
OLDNEW
« no previous file with comments | « core/src/fxcrt/fx_basic_buffer.cpp ('k') | core/src/fxge/agg/fx_agg_driver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698