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

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

Issue 1529553003: Merge to XFA: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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
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_EXT_H_ 7 #ifndef CORE_INCLUDE_FXCRT_FX_EXT_H_
8 #define CORE_INCLUDE_FXCRT_FX_EXT_H_ 8 #define CORE_INCLUDE_FXCRT_FX_EXT_H_
9 9
10 #include <cctype> 10 #include <cctype>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void FX_GUID_CreateV4(FX_LPGUID pGUID); 86 void FX_GUID_CreateV4(FX_LPGUID pGUID);
87 void FX_GUID_ToString(FX_LPCGUID pGUID, 87 void FX_GUID_ToString(FX_LPCGUID pGUID,
88 CFX_ByteString& bsStr, 88 CFX_ByteString& bsStr,
89 FX_BOOL bSeparator = TRUE); 89 FX_BOOL bSeparator = TRUE);
90 #endif // PDF_ENABLE_XFA 90 #endif // PDF_ENABLE_XFA
91 91
92 template <class baseType> 92 template <class baseType>
93 class CFX_SSortTemplate { 93 class CFX_SSortTemplate {
94 public: 94 public:
95 void ShellSort(baseType* pArray, int32_t iCount) { 95 void ShellSort(baseType* pArray, int32_t iCount) {
96 FXSYS_assert(pArray != NULL && iCount > 0); 96 FXSYS_assert(pArray && iCount > 0);
97 int32_t i, j, gap; 97 int32_t i, j, gap;
98 baseType v1, v2; 98 baseType v1, v2;
99 gap = iCount >> 1; 99 gap = iCount >> 1;
100 while (gap > 0) { 100 while (gap > 0) {
101 for (i = gap; i < iCount; i++) { 101 for (i = gap; i < iCount; i++) {
102 j = i - gap; 102 j = i - gap;
103 v1 = pArray[i]; 103 v1 = pArray[i];
104 while (j > -1 && (v2 = pArray[j]) > v1) { 104 while (j > -1 && (v2 = pArray[j]) > v1) {
105 pArray[j + gap] = v2; 105 pArray[j + gap] = v2;
106 j -= gap; 106 j -= gap;
107 } 107 }
108 pArray[j + gap] = v1; 108 pArray[j + gap] = v1;
109 } 109 }
110 gap >>= 1; 110 gap >>= 1;
111 } 111 }
112 } 112 }
113 }; 113 };
114 114
115 #endif // CORE_INCLUDE_FXCRT_FX_EXT_H_ 115 #endif // CORE_INCLUDE_FXCRT_FX_EXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698