Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.
Test: m
Bug: 68236239
Change-Id: I8cb04f9f99be029d7fef13c4c7c77aea515f3d61
diff --git a/base/HidlInternal.cpp b/base/HidlInternal.cpp
index babdac1..7d7e960 100644
--- a/base/HidlInternal.cpp
+++ b/base/HidlInternal.cpp
@@ -153,7 +153,7 @@
for (const auto& path : instrumentationLibPaths) {
DIR *dir = opendir(path.c_str());
- if (dir == 0) {
+ if (dir == nullptr) {
LOG(WARNING) << path << " does not exist. ";
return;
}
diff --git a/libhidlcache/MemoryDealer.cpp b/libhidlcache/MemoryDealer.cpp
index e9196a1..dea7bc7 100644
--- a/libhidlcache/MemoryDealer.cpp
+++ b/libhidlcache/MemoryDealer.cpp
@@ -240,7 +240,7 @@
return freed;
}
}
- return 0;
+ return nullptr;
}
void SimpleBestFitAllocator::dump(const char* tag) const {
diff --git a/minijail/HardwareMinijail.cpp b/minijail/HardwareMinijail.cpp
index e6b1144..990a689 100644
--- a/minijail/HardwareMinijail.cpp
+++ b/minijail/HardwareMinijail.cpp
@@ -29,7 +29,7 @@
}
struct minijail* jail = minijail_new();
- if (jail == NULL) {
+ if (jail == nullptr) {
LOG(FATAL) << "Failed to create minijail.";
}