OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |