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

Side by Side Diff: core/fxcrt/extension.h

Issue 1951653002: Return bool rather than bitwise-and for FX_BOOL (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: More bool, fix nits. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fxge/ge/fx_ge_text.cpp » ('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_FXCRT_EXTENSION_H_ 7 #ifndef CORE_FXCRT_EXTENSION_H_
8 #define CORE_FXCRT_EXTENSION_H_ 8 #define CORE_FXCRT_EXTENSION_H_
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 FXSYS_memcpy(m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite); 234 FXSYS_memcpy(m_Blocks[(int)nStartBlock] + (size_t)offset, buffer, nWrite);
235 buffer = ((uint8_t*)buffer) + nWrite; 235 buffer = ((uint8_t*)buffer) + nWrite;
236 size -= nWrite; 236 size -= nWrite;
237 nStartBlock++; 237 nStartBlock++;
238 offset = 0; 238 offset = 0;
239 } 239 }
240 return TRUE; 240 return TRUE;
241 } 241 }
242 FX_BOOL Flush() override { return TRUE; } 242 FX_BOOL Flush() override { return TRUE; }
243 FX_BOOL IsConsecutive() const override { 243 FX_BOOL IsConsecutive() const override {
244 return m_dwFlags & FX_MEMSTREAM_Consecutive; 244 return !!(m_dwFlags & FX_MEMSTREAM_Consecutive);
245 } 245 }
246 void EstimateSize(size_t nInitSize, size_t nGrowSize) override { 246 void EstimateSize(size_t nInitSize, size_t nGrowSize) override {
247 if (m_dwFlags & FX_MEMSTREAM_Consecutive) { 247 if (m_dwFlags & FX_MEMSTREAM_Consecutive) {
248 if (m_Blocks.GetSize() < 1) { 248 if (m_Blocks.GetSize() < 1) {
249 uint8_t* pBlock = 249 uint8_t* pBlock =
250 FX_Alloc(uint8_t, std::max(nInitSize, static_cast<size_t>(4096))); 250 FX_Alloc(uint8_t, std::max(nInitSize, static_cast<size_t>(4096)));
251 m_Blocks.Add(pBlock); 251 m_Blocks.Add(pBlock);
252 } 252 }
253 m_nGrowSize = std::max(nGrowSize, static_cast<size_t>(4096)); 253 m_nGrowSize = std::max(nGrowSize, static_cast<size_t>(4096));
254 } else if (m_Blocks.GetSize() < 1) { 254 } else if (m_Blocks.GetSize() < 1) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 uint32_t mt[MT_N]; 325 uint32_t mt[MT_N];
326 }; 326 };
327 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ 327 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
328 FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount); 328 FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount);
329 #endif 329 #endif
330 #ifdef __cplusplus 330 #ifdef __cplusplus
331 } 331 }
332 #endif 332 #endif
333 333
334 #endif // CORE_FXCRT_EXTENSION_H_ 334 #endif // CORE_FXCRT_EXTENSION_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render_image.cpp ('k') | core/fxge/ge/fx_ge_text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698