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

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

Issue 811593007: XFA: merge patch from CL 733693003, getting rid of more casts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 6 years 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_bstring.cpp ('k') | core/src/fxcrt/fx_extension.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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch; 185 *(FX_WCHAR*)(m_pBuffer + m_DataSize) = ch;
186 m_DataSize += sizeof(FX_WCHAR); 186 m_DataSize += sizeof(FX_WCHAR);
187 } 187 }
188 CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str) 188 CFX_WideTextBuf& CFX_WideTextBuf::operator << (FX_WSTR str)
189 { 189 {
190 AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR)); 190 AppendBlock(str.GetPtr(), str.GetLength() * sizeof(FX_WCHAR));
191 return *this; 191 return *this;
192 } 192 }
193 CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str) 193 CFX_WideTextBuf& CFX_WideTextBuf::operator << (const CFX_WideString &str)
194 { 194 {
195 AppendBlock((FX_LPCWSTR)str, str.GetLength() * sizeof(FX_WCHAR)); 195 AppendBlock(str.c_str(), str.GetLength() * sizeof(FX_WCHAR));
196 return *this; 196 return *this;
197 } 197 }
198 CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i) 198 CFX_WideTextBuf& CFX_WideTextBuf::operator << (int i)
199 { 199 {
200 char buf[32]; 200 char buf[32];
201 FXSYS_itoa(i, buf, 10); 201 FXSYS_itoa(i, buf, 10);
202 FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf); 202 FX_STRSIZE len = (FX_STRSIZE)FXSYS_strlen(buf);
203 if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) { 203 if (m_AllocSize < m_DataSize + (FX_STRSIZE)(len * sizeof(FX_WCHAR))) {
204 ExpandBuf(len * sizeof(FX_WCHAR)); 204 ExpandBuf(len * sizeof(FX_WCHAR));
205 } 205 }
(...skipping 348 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/fxcrt/fx_basic_bstring.cpp ('k') | core/src/fxcrt/fx_extension.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698