From 55d4107c06fb0dc4051a3039174fbba36968f108 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Mon, 23 Jul 2018 14:55:39 -0700 Subject: Modernize codebase by replacing NULL with nullptr Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I23c4346097d1e7cfbbd7225913a4d187a05f7506 --- BpHwBinder.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'BpHwBinder.cpp') diff --git a/BpHwBinder.cpp b/BpHwBinder.cpp index ed7ed2a..bd395a9 100644 --- a/BpHwBinder.cpp +++ b/BpHwBinder.cpp @@ -62,7 +62,7 @@ void BpHwBinder::ObjectManager::attach( void* BpHwBinder::ObjectManager::find(const void* objectID) const { const ssize_t i = mObjects.indexOfKey(objectID); - if (i < 0) return NULL; + if (i < 0) return nullptr; return mObjects.valueAt(i).object; } @@ -77,7 +77,7 @@ void BpHwBinder::ObjectManager::kill() ALOGV("Killing %zu objects in manager %p", N, this); for (size_t i=0; iitemAt(i); if ((obit.recipient == recipient - || (recipient == NULL && obit.cookie == cookie)) + || (recipient == nullptr && obit.cookie == cookie)) && obit.flags == flags) { - if (outRecipient != NULL) { + if (outRecipient != nullptr) { *outRecipient = mObituaries->itemAt(i).recipient; } mObituaries->removeAt(i); @@ -173,7 +173,7 @@ status_t BpHwBinder::unlinkToDeath( self->clearDeathNotification(mHandle, this); self->flushCommands(); delete mObituaries; - mObituaries = NULL; + mObituaries = nullptr; } return NO_ERROR; } @@ -192,12 +192,12 @@ void BpHwBinder::sendObituary() mLock.lock(); Vector* obits = mObituaries; - if(obits != NULL) { + if(obits != nullptr) { ALOGV("Clearing sent death notification: %p handle %d\n", this, mHandle); IPCThreadState* self = IPCThreadState::self(); self->clearDeathNotification(mHandle, this); self->flushCommands(); - mObituaries = NULL; + mObituaries = nullptr; } mObitsSent = 1; mLock.unlock(); @@ -205,7 +205,7 @@ void BpHwBinder::sendObituary() ALOGV("Reporting death of proxy %p for %zu recipients\n", this, obits ? obits->size() : 0U); - if (obits != NULL) { + if (obits != nullptr) { const size_t N = obits->size(); for (size_t i=0; iitemAt(i)); @@ -219,7 +219,7 @@ void BpHwBinder::reportOneDeath(const Obituary& obit) { sp recipient = obit.recipient.promote(); ALOGV("Reporting death to recipient: %p\n", recipient.get()); - if (recipient == NULL) return; + if (recipient == nullptr) return; recipient->binderDied(this); } @@ -259,13 +259,13 @@ BpHwBinder::~BpHwBinder() mLock.lock(); Vector* obits = mObituaries; - if(obits != NULL) { + if(obits != nullptr) { if (ipc) ipc->clearDeathNotification(mHandle, this); - mObituaries = NULL; + mObituaries = nullptr; } mLock.unlock(); - if (obits != NULL) { + if (obits != nullptr) { // XXX Should we tell any remaining DeathRecipient // objects that the last strong ref has gone away, so they // are no longer linked? -- cgit v1.2.3