diff options
author | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-08-04 12:19:10 -0700 |
commit | b048f791a15f2da781a01eba5b09eb9d389f9c11 (patch) | |
tree | 6850a73c18bbc41eaf4b1fdc6b3c96646d45587b /core/src/fxcodec/jbig2/JBig2_List.h | |
parent | c8eeed31f217d99a706b0cbf5e4ce0bcc12beb64 (diff) | |
download | pdfium-b048f791a15f2da781a01eba5b09eb9d389f9c11.tar.xz |
clang-format all pdfium code.
No behavior change.
Generated by:
find . -name '*.cpp' -o -name '*.h' | \
grep -E -v 'third_party|thirdparties|lpng_v163' | \
xargs ../../buildtools/mac/clang-format -i
See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion.
BUG=none
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1265503005 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_List.h')
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_List.h | 84 |
1 files changed, 35 insertions, 49 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_List.h b/core/src/fxcodec/jbig2/JBig2_List.h index 19f99dec3d..be2d7cb7e4 100644 --- a/core/src/fxcodec/jbig2/JBig2_List.h +++ b/core/src/fxcodec/jbig2/JBig2_List.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef _JBIG2_LIST_H_ @@ -9,59 +9,45 @@ #include "JBig2_Define.h" #include "JBig2_Object.h" template <class TYPE> -class CJBig2_List : public CJBig2_Object -{ -public: - - CJBig2_List(int32_t nSize = 8) - { - m_nSize = nSize; - m_pArray = (TYPE**)m_pModule->JBig2_Malloc2(sizeof(TYPE*), nSize); - m_nLength = 0; - } - - ~CJBig2_List() - { - clear(); - m_pModule->JBig2_Free(m_pArray); - } - - void clear() - { - int32_t i; - for(i = 0; i < m_nLength; i++) { - delete m_pArray[i]; - } - m_nLength = 0; +class CJBig2_List : public CJBig2_Object { + public: + CJBig2_List(int32_t nSize = 8) { + m_nSize = nSize; + m_pArray = (TYPE**)m_pModule->JBig2_Malloc2(sizeof(TYPE*), nSize); + m_nLength = 0; + } + + ~CJBig2_List() { + clear(); + m_pModule->JBig2_Free(m_pArray); + } + + void clear() { + int32_t i; + for (i = 0; i < m_nLength; i++) { + delete m_pArray[i]; } - - void addItem(TYPE *pItem) - { - if(m_nLength >= m_nSize) { - m_nSize += 8; - m_pArray = (TYPE**)m_pModule->JBig2_Realloc(m_pArray, sizeof(TYPE*)*m_nSize); - } - m_pArray[m_nLength++] = pItem; + m_nLength = 0; + } + + void addItem(TYPE* pItem) { + if (m_nLength >= m_nSize) { + m_nSize += 8; + m_pArray = + (TYPE**)m_pModule->JBig2_Realloc(m_pArray, sizeof(TYPE*) * m_nSize); } + m_pArray[m_nLength++] = pItem; + } + int32_t getLength() { return m_nLength; } - int32_t getLength() - { - return m_nLength; - } + TYPE* getAt(int32_t nIndex) { return m_pArray[nIndex]; } - TYPE *getAt(int32_t nIndex) - { - return m_pArray[nIndex]; - } + TYPE* getLast() { return m_pArray[m_nLength - 1]; } - TYPE *getLast() - { - return m_pArray[m_nLength - 1]; - } -private: - int32_t m_nSize; - TYPE **m_pArray; - int32_t m_nLength; + private: + int32_t m_nSize; + TYPE** m_pArray; + int32_t m_nLength; }; #endif |