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

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

Issue 1512763013: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 5 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 | « no previous file | core/include/fxcrt/fx_ext.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_INCLUDE_FXCRT_FX_BASIC_H_ 7 #ifndef CORE_INCLUDE_FXCRT_FX_BASIC_H_
8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_
9 9
10 #include "fx_memory.h" 10 #include "fx_memory.h"
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 }; 1064 };
1065 template <typename T1, typename T2> 1065 template <typename T1, typename T2>
1066 class CFX_ListArrayTemplate { 1066 class CFX_ListArrayTemplate {
1067 public: 1067 public:
1068 void Clear() { m_Data.Clear(); } 1068 void Clear() { m_Data.Clear(); }
1069 1069
1070 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); } 1070 void Add(int32_t nStart, int32_t nCount) { m_Data.Append(nStart, nCount); }
1071 1071
1072 T2& operator[](int32_t nIndex) { 1072 T2& operator[](int32_t nIndex) {
1073 uint8_t* data = m_Data.GetAt(nIndex); 1073 uint8_t* data = m_Data.GetAt(nIndex);
1074 FXSYS_assert(data != NULL); 1074 FXSYS_assert(data);
1075 return (T2&)(*(volatile T2*)data); 1075 return (T2&)(*(volatile T2*)data);
1076 } 1076 }
1077 1077
1078 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); } 1078 T2* GetPtrAt(int32_t nIndex) { return (T2*)m_Data.GetAt(nIndex); }
1079 1079
1080 protected: 1080 protected:
1081 T1 m_Data; 1081 T1 m_Data;
1082 }; 1082 };
1083 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>, 1083 typedef CFX_ListArrayTemplate<CFX_SortListArray<sizeof(FX_FILESIZE)>,
1084 FX_FILESIZE> CFX_FileSizeListArray; 1084 FX_FILESIZE> CFX_FileSizeListArray;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 FX_FLOAT c; 1141 FX_FLOAT c;
1142 FX_FLOAT d; 1142 FX_FLOAT d;
1143 FX_FLOAT e; 1143 FX_FLOAT e;
1144 FX_FLOAT f; 1144 FX_FLOAT f;
1145 FX_FLOAT g; 1145 FX_FLOAT g;
1146 FX_FLOAT h; 1146 FX_FLOAT h;
1147 FX_FLOAT i; 1147 FX_FLOAT i;
1148 }; 1148 };
1149 1149
1150 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ 1150 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_
OLDNEW
« no previous file with comments | « no previous file | core/include/fxcrt/fx_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698