summaryrefslogtreecommitdiff
path: root/libs/gui/ConsumerBase.cpp
diff options
context:
space:
mode:
author Yi Kong <yikong@google.com> 2018-06-05 15:19:32 -0700
committer Yi Kong <yikong@google.com> 2018-06-07 20:03:46 +0000
commit9c804c47fc86a45ac517e9c91d3c986cb9d315dd (patch)
tree2afdc2095703cf8ce19c68ccf820df8e63239288 /libs/gui/ConsumerBase.cpp
parent88d73c02865a0912efaad3af78d0d77fc0fbb032 (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/ConsumerBase.cpp')
-rw-r--r--libs/gui/ConsumerBase.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index 7aa7872513..2a9d742fc9 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -96,7 +96,7 @@ void ConsumerBase::onLastStrongRef(const void* id __attribute__((unused))) {
void ConsumerBase::freeBufferLocked(int slotIndex) {
CB_LOGV("freeBufferLocked: slotIndex=%d", slotIndex);
- mSlots[slotIndex].mGraphicBuffer = 0;
+ mSlots[slotIndex].mGraphicBuffer = nullptr;
mSlots[slotIndex].mFence = Fence::NO_FENCE;
mSlots[slotIndex].mFrameNumber = 0;
}
@@ -110,7 +110,7 @@ void ConsumerBase::onFrameAvailable(const BufferItem& item) {
listener = mFrameAvailableListener.promote();
}
- if (listener != NULL) {
+ if (listener != nullptr) {
CB_LOGV("actually calling onFrameAvailable");
listener->onFrameAvailable(item);
}
@@ -125,7 +125,7 @@ void ConsumerBase::onFrameReplaced(const BufferItem &item) {
listener = mFrameAvailableListener.promote();
}
- if (listener != NULL) {
+ if (listener != nullptr) {
CB_LOGV("actually calling onFrameReplaced");
listener->onFrameReplaced(item);
}
@@ -298,8 +298,8 @@ status_t ConsumerBase::acquireBufferLocked(BufferItem *item,
return err;
}
- if (item->mGraphicBuffer != NULL) {
- if (mSlots[item->mSlot].mGraphicBuffer != NULL) {
+ if (item->mGraphicBuffer != nullptr) {
+ if (mSlots[item->mSlot].mGraphicBuffer != nullptr) {
freeBufferLocked(item->mSlot);
}
mSlots[item->mSlot].mGraphicBuffer = item->mGraphicBuffer;
@@ -414,7 +414,7 @@ bool ConsumerBase::stillTracking(int slot,
if (slot < 0 || slot >= BufferQueue::NUM_BUFFER_SLOTS) {
return false;
}
- return (mSlots[slot].mGraphicBuffer != NULL &&
+ return (mSlots[slot].mGraphicBuffer != nullptr &&
mSlots[slot].mGraphicBuffer->handle == graphicBuffer->handle);
}