summaryrefslogtreecommitdiff
path: root/BpHwBinder.cpp
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2018-07-24 01:20:52 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-07-24 01:20:52 -0700
commitbf1e65cf98a15ceff99ca56d5a9af1fa90673471 (patch)
treee4aafe580c2fadc935c28baf1b48f332e85c25c8 /BpHwBinder.cpp
parent96c42d70dc37c84c6640dc69564975feb02a4e39 (diff)
parent55d4107c06fb0dc4051a3039174fbba36968f108 (diff)
downloadlibhwbinder-bf1e65cf98a15ceff99ca56d5a9af1fa90673471.tar.gz
Modernize codebase by replacing NULL with nullptrtemp_p_merge
am: 55d4107c06 Change-Id: I77cb3c205454b5500508c48c0768c5611cfc13b4
Diffstat (limited to 'BpHwBinder.cpp')
-rw-r--r--BpHwBinder.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/BpHwBinder.cpp b/BpHwBinder.cpp
index 90b3c6f..223f854 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; i<N; i++) {
const entry_t& e = mObjects.valueAt(i);
- if (e.func != NULL) {
+ if (e.func != nullptr) {
e.func(mObjects.keyAt(i), e.object, e.cleanupCookie);
}
}
@@ -91,7 +91,7 @@ BpHwBinder::BpHwBinder(int32_t handle)
: mHandle(handle)
, mAlive(1)
, mObitsSent(0)
- , mObituaries(NULL)
+ , mObituaries(nullptr)
{
ALOGV("Creating BpHwBinder %p handle %d\n", this, mHandle);
@@ -121,7 +121,7 @@ status_t BpHwBinder::linkToDeath(
ob.cookie = cookie;
ob.flags = flags;
- LOG_ALWAYS_FATAL_IF(recipient == NULL,
+ LOG_ALWAYS_FATAL_IF(recipient == nullptr,
"linkToDeath(): recipient must be non-NULL");
{
@@ -161,9 +161,9 @@ status_t BpHwBinder::unlinkToDeath(
for (size_t i=0; i<N; i++) {
const Obituary& obit = mObituaries->itemAt(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<Obituary>* 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; i<N; i++) {
reportOneDeath(obits->itemAt(i));
@@ -219,7 +219,7 @@ void BpHwBinder::reportOneDeath(const Obituary& obit)
{
sp<DeathRecipient> 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<Obituary>* 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?