diff options
author | Yi Kong <yikong@google.com> | 2018-06-07 17:52:27 -0700 |
---|---|---|
committer | Yi Kong <yikong@google.com> | 2018-06-07 17:54:21 -0700 |
commit | fdd8da9e3f79be25b91293e22114c177c3b3fd8d (patch) | |
tree | cbc9fea00e9b67d631bde2bbb70de5b151dfcadc /libs/binder/Value.cpp | |
parent | a160f5a70ffba3715c8a92f4f469922d59635356 (diff) | |
download | native-fdd8da9e3f79be25b91293e22114c177c3b3fd8d.tar.gz |
[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)
Diffstat (limited to 'libs/binder/Value.cpp')
-rw-r--r-- | libs/binder/Value.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/binder/Value.cpp b/libs/binder/Value.cpp index 85cd739411..2b263ed2ee 100644 --- a/libs/binder/Value.cpp +++ b/libs/binder/Value.cpp @@ -143,12 +143,12 @@ template<typename T> bool Value::ContentBase::get(T* out) const // ==================================================================== -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 @@ bool Value::operator==(const Value& rhs) const return true; } - if ( (lhs.mContent == NULL) - || (rhs.mContent == NULL) + if ( (lhs.mContent == nullptr) + || (rhs.mContent == nullptr) ) { return false; } @@ -186,25 +186,25 @@ Value& Value::operator=(const Value& rhs) 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 @@ status_t Value::readFromParcel(const Parcel* parcel) int32_t value_type = VAL_NULL; delete mContent; - mContent = NULL; + mContent = nullptr; RETURN_IF_FAILED(parcel->readInt32(&value_type)); |