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

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

Issue 809993004: Get rid of FX_LPCSTR cast. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Indent Created 5 years, 11 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/fpdfdoc/doc_form.cpp ('k') | core/src/fxcrt/fxcrt_platforms.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 "../../include/fxcrt/fx_basic.h" 7 #include "../../include/fxcrt/fx_basic.h"
8 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf); 8 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_LPSTR buf);
9 CFX_BinaryBuf::CFX_BinaryBuf() 9 CFX_BinaryBuf::CFX_BinaryBuf()
10 : m_AllocStep(0) 10 : m_AllocStep(0)
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 FX_LPSTR buffer = str.GetBuffer(len); 364 FX_LPSTR buffer = str.GetBuffer(len);
365 FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len); 365 FXSYS_memcpy32(buffer, m_pLoadingBuf + m_LoadingPos, len);
366 str.ReleaseBuffer(len); 366 str.ReleaseBuffer(len);
367 m_LoadingPos += len; 367 m_LoadingPos += len;
368 return *this; 368 return *this;
369 } 369 }
370 CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_WideString& str) 370 CFX_ArchiveLoader& CFX_ArchiveLoader::operator >> (CFX_WideString& str)
371 { 371 {
372 CFX_ByteString encoded; 372 CFX_ByteString encoded;
373 operator >> (encoded); 373 operator >> (encoded);
374 str = CFX_WideString::FromUTF16LE((const unsigned short*)(FX_LPCSTR)encoded, encoded.GetLength()); 374 str = CFX_WideString::FromUTF16LE((const unsigned short*)encoded.c_str(), en coded.GetLength());
375 return *this; 375 return *this;
376 } 376 }
377 FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize) 377 FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize)
378 { 378 {
379 if (m_LoadingPos + dwSize > m_LoadingSize) { 379 if (m_LoadingPos + dwSize > m_LoadingSize) {
380 return FALSE; 380 return FALSE;
381 } 381 }
382 FXSYS_memcpy32(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize); 382 FXSYS_memcpy32(pBuf, m_pLoadingBuf + m_LoadingPos, dwSize);
383 m_LoadingPos += dwSize; 383 m_LoadingPos += dwSize;
384 return TRUE; 384 return TRUE;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size) 554 FX_BOOL CFX_FileBufferArchive::DoWork(const void* pBuf, size_t size)
555 { 555 {
556 if (!m_pFile) { 556 if (!m_pFile) {
557 return FALSE; 557 return FALSE;
558 } 558 }
559 if (!pBuf || size < 1) { 559 if (!pBuf || size < 1) {
560 return TRUE; 560 return TRUE;
561 } 561 }
562 return m_pFile->WriteBlock(pBuf, size); 562 return m_pFile->WriteBlock(pBuf, size);
563 } 563 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_form.cpp ('k') | core/src/fxcrt/fxcrt_platforms.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698