From 9c804c47fc86a45ac517e9c91d3c986cb9d315dd Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Tue, 5 Jun 2018 15:19:32 -0700 Subject: Replace NULL/0 with nullptr Fixes -Wzero-as-null-pointer-constant warning. clang-tidy -checks=modernize-use-nullptr -p compile_commands.json -fix ... Test: m Bug: 68236239 Change-Id: I3a8e982ba40f9b029bafef78437b146a878f56a9 Merged-In: I3a8e982ba40f9b029bafef78437b146a878f56a9 (cherry picked from commit 48a619f8332e06ea1cd96d82719cdf5e05c69630) --- libs/gui/CpuConsumer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/gui/CpuConsumer.cpp') diff --git a/libs/gui/CpuConsumer.cpp b/libs/gui/CpuConsumer.cpp index ae7c65c441..9f09e0c0d4 100644 --- a/libs/gui/CpuConsumer.cpp +++ b/libs/gui/CpuConsumer.cpp @@ -114,7 +114,7 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) { int slot = b.mSlot; - void *bufferPointer = NULL; + void *bufferPointer = nullptr; android_ycbcr ycbcr = android_ycbcr(); PixelFormat format = mSlots[slot].mGraphicBuffer->getPixelFormat(); @@ -145,7 +145,7 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) { } } - if (bufferPointer == NULL) { // not flexible YUV + if (bufferPointer == nullptr) { // not flexible YUV if (b.mFence.get()) { err = mSlots[slot].mGraphicBuffer->lockAsync( GraphicBuffer::USAGE_SW_READ_OFTEN, @@ -185,7 +185,7 @@ status_t CpuConsumer::lockNextBuffer(LockedBuffer *nativeBuffer) { nativeBuffer->height = mSlots[slot].mGraphicBuffer->getHeight(); nativeBuffer->format = format; nativeBuffer->flexFormat = flexFormat; - nativeBuffer->stride = (ycbcr.y != NULL) ? + nativeBuffer->stride = (ycbcr.y != nullptr) ? static_cast(ycbcr.ystride) : mSlots[slot].mGraphicBuffer->getStride(); @@ -253,7 +253,7 @@ status_t CpuConsumer::releaseAcquiredBufferLocked(size_t lockedIdx) { AcquiredBuffer &ab = mAcquiredBuffers.editItemAt(lockedIdx); ab.mSlot = BufferQueue::INVALID_BUFFER_SLOT; - ab.mBufferPointer = NULL; + ab.mBufferPointer = nullptr; ab.mGraphicBuffer.clear(); mCurrentLockedBuffers--; -- cgit v1.2.3-59-g8ed1b