From a8548dc2de6c2ba098190d76444bfe4cd8174466 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Nov 2017 16:37:20 +0000 Subject: Run clang-tidy modernize-use-nullptr on //third_party/pdfium See the bugs and cxx post for justification and details: https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8 This change was done using clang-tidy as described here: https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md Bug: chromium:778942 Change-Id: I5d94299404647d231c0dc8ef8b75a6c0539f378c Reviewed-on: https://pdfium-review.googlesource.com/19972 Commit-Queue: dsinclair Reviewed-by: Lei Zhang --- third_party/base/allocator/partition_allocator/partition_alloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'third_party/base') diff --git a/third_party/base/allocator/partition_allocator/partition_alloc.h b/third_party/base/allocator/partition_allocator/partition_alloc.h index 04ae17014a..5832b9f4be 100644 --- a/third_party/base/allocator/partition_allocator/partition_alloc.h +++ b/third_party/base/allocator/partition_allocator/partition_alloc.h @@ -660,7 +660,7 @@ ALWAYS_INLINE void* PartitionBucketAlloc(PartitionRootBase* root, // Check that this page is neither full nor freed. DCHECK(page->num_allocated_slots >= 0); void* ret = page->freelist_head; - if (LIKELY(ret != 0)) { + if (LIKELY(ret)) { // If these asserts fire, you probably corrupted memory. DCHECK(PartitionPointerIsValid(ret)); // All large allocations must go through the slow path to correctly @@ -676,7 +676,7 @@ ALWAYS_INLINE void* PartitionBucketAlloc(PartitionRootBase* root, } #if DCHECK_IS_ON() if (!ret) - return 0; + return nullptr; // Fill the uninitialized pattern, and write the cookies. page = PartitionPointerToPage(ret); size_t slot_size = page->bucket->slot_size; -- cgit v1.2.3