diff options
author | 2018-06-05 15:19:32 -0700 | |
---|---|---|
committer | 2018-06-07 20:03:46 +0000 | |
commit | 9c804c47fc86a45ac517e9c91d3c986cb9d315dd (patch) | |
tree | 2afdc2095703cf8ce19c68ccf820df8e63239288 /libs/gui/CpuConsumer.cpp | |
parent | 88d73c02865a0912efaad3af78d0d77fc0fbb032 (diff) |
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)
Diffstat (limited to 'libs/gui/CpuConsumer.cpp')
-rw-r--r-- | libs/gui/CpuConsumer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<uint32_t>(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--; |