[binder] 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: I3181bc5683796423a98b0f9b94daf30880c07bdc
Merged-In: I3181bc5683796423a98b0f9b94daf30880c07bdc
(cherry picked from commit 91635563b8a1bf7a31e4ceb439728dacb79abd76)
diff --git a/libs/binder/Value.cpp b/libs/binder/Value.cpp
index 85cd739..2b263ed 100644
--- a/libs/binder/Value.cpp
+++ b/libs/binder/Value.cpp
@@ -143,12 +143,12 @@
// ====================================================================
-Value::Value() : mContent(NULL)
+Value::Value() : mContent(nullptr)
{
}
Value::Value(const Value& value)
- : mContent(value.mContent ? value.mContent->clone() : NULL)
+ : mContent(value.mContent ? value.mContent->clone() : nullptr)
{
}
@@ -165,8 +165,8 @@
return true;
}
- if ( (lhs.mContent == NULL)
- || (rhs.mContent == NULL)
+ if ( (lhs.mContent == nullptr)
+ || (rhs.mContent == nullptr)
) {
return false;
}
@@ -186,25 +186,25 @@
delete mContent;
mContent = rhs.mContent
? rhs.mContent->clone()
- : NULL;
+ : nullptr;
}
return *this;
}
bool Value::empty() const
{
- return mContent == NULL;
+ return mContent == nullptr;
}
void Value::clear()
{
delete mContent;
- mContent = NULL;
+ mContent = nullptr;
}
int32_t Value::parcelType() const
{
- const void* t_info(mContent ? mContent->type_ptr() : NULL);
+ const void* t_info(mContent ? mContent->type_ptr() : nullptr);
if (t_info == internal_type_ptr<bool>()) return VAL_BOOLEAN;
if (t_info == internal_type_ptr<uint8_t>()) return VAL_BYTE;
@@ -381,7 +381,7 @@
int32_t value_type = VAL_NULL;
delete mContent;
- mContent = NULL;
+ mContent = nullptr;
RETURN_IF_FAILED(parcel->readInt32(&value_type));