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

Side by Side Diff: core/fxcrt/fx_basic.h

Issue 2649563003: Replace CFX_ByteArray with CFX_ArrayTemplate<uint8_t> (Closed)
Patch Set: re-upload Created 3 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/fxcrt/fx_arabic.cpp ('k') | xfa/fde/tto/fde_textout.h » ('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 #ifndef CORE_FXCRT_FX_BASIC_H_ 7 #ifndef CORE_FXCRT_FX_BASIC_H_
8 #define CORE_FXCRT_FX_BASIC_H_ 8 #define CORE_FXCRT_FX_BASIC_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 return -1; 306 return -1;
307 } 307 }
308 for (; iStart < (int)m_nSize; iStart++) 308 for (; iStart < (int)m_nSize; iStart++)
309 if (((TYPE*)m_pData)[iStart] == data) { 309 if (((TYPE*)m_pData)[iStart] == data) {
310 return iStart; 310 return iStart;
311 } 311 }
312 return -1; 312 return -1;
313 } 313 }
314 }; 314 };
315 315
316 #ifdef PDF_ENABLE_XFA
317 typedef CFX_ArrayTemplate<uint8_t> CFX_ByteArray;
318 typedef CFX_ArrayTemplate<int32_t> CFX_Int32Array;
319 #endif // PDF_ENABLE_XFA
320
321 template <class DataType, int FixedSize> 316 template <class DataType, int FixedSize>
322 class CFX_FixedBufGrow { 317 class CFX_FixedBufGrow {
323 public: 318 public:
324 explicit CFX_FixedBufGrow(int data_size) { 319 explicit CFX_FixedBufGrow(int data_size) {
325 if (data_size > FixedSize) { 320 if (data_size > FixedSize) {
326 m_pGrowData.reset(FX_Alloc(DataType, data_size)); 321 m_pGrowData.reset(FX_Alloc(DataType, data_size));
327 return; 322 return;
328 } 323 }
329 FXSYS_memset(m_FixedData, 0, sizeof(DataType) * FixedSize); 324 FXSYS_memset(m_FixedData, 0, sizeof(DataType) * FixedSize);
330 } 325 }
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 FX_FLOAT e; 560 FX_FLOAT e;
566 FX_FLOAT f; 561 FX_FLOAT f;
567 FX_FLOAT g; 562 FX_FLOAT g;
568 FX_FLOAT h; 563 FX_FLOAT h;
569 FX_FLOAT i; 564 FX_FLOAT i;
570 }; 565 };
571 566
572 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits); 567 uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits);
573 568
574 #endif // CORE_FXCRT_FX_BASIC_H_ 569 #endif // CORE_FXCRT_FX_BASIC_H_
OLDNEW
« no previous file with comments | « core/fxcrt/fx_arabic.cpp ('k') | xfa/fde/tto/fde_textout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698