summaryrefslogtreecommitdiff
path: root/third_party/base
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-30 16:37:20 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-30 16:37:20 +0000
commita8548dc2de6c2ba098190d76444bfe4cd8174466 (patch)
tree2e9d69cebc82144917296108250d32954c4f2cbd /third_party/base
parent0edacf7b24cf5d70c41d3e28dc8e0f6b3c15447d (diff)
downloadpdfium-a8548dc2de6c2ba098190d76444bfe4cd8174466.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'third_party/base')
-rw-r--r--third_party/base/allocator/partition_allocator/partition_alloc.h4
1 files changed, 2 insertions, 2 deletions
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;