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

Unified Diff: core/src/fxcodec/jbig2/JBig2_List.h

Issue 453133004: clang-format all code (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: core/src/fxcodec/jbig2/JBig2_List.h
diff --git a/core/src/fxcodec/jbig2/JBig2_List.h b/core/src/fxcodec/jbig2/JBig2_List.h
index 9292724b1ee0e6c9c801b15497fb1e732b966c68..4e36de1bf5b8d79d197ccc3daeecee580185e43d 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(FX_INT32 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()
- {
- FX_INT32 i;
- for(i = 0; i < m_nLength; i++) {
- delete m_pArray[i];
- }
- m_nLength = 0;
+class CJBig2_List : public CJBig2_Object {
+ public:
+ CJBig2_List(FX_INT32 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() {
+ FX_INT32 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;
+ }
+ FX_INT32 getLength() { return m_nLength; }
- FX_INT32 getLength()
- {
- return m_nLength;
- }
+ TYPE* getAt(FX_INT32 nIndex) { return m_pArray[nIndex]; }
- TYPE *getAt(FX_INT32 nIndex)
- {
- return m_pArray[nIndex];
- }
+ TYPE* getLast() { return m_pArray[m_nLength - 1]; }
- TYPE *getLast()
- {
- return m_pArray[m_nLength - 1];
- }
-private:
- FX_INT32 m_nSize;
- TYPE **m_pArray;
- FX_INT32 m_nLength;
+ private:
+ FX_INT32 m_nSize;
+ TYPE** m_pArray;
+ FX_INT32 m_nLength;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698