[cmds] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.
Test: m
Bug: 68236239
Change-Id: I1635395d653ace5a11c75795f4a7d2bf2d9e0b1b
Merged-In: I73a0a82e3e32001f8ffb0880250c7023dd8290d3
diff --git a/cmds/lshal/Timeout.h b/cmds/lshal/Timeout.h
index c940404..58119a6 100644
--- a/cmds/lshal/Timeout.h
+++ b/cmds/lshal/Timeout.h
@@ -57,7 +57,7 @@
BackgroundTaskState &state = *static_cast<BackgroundTaskState *>(data);
state();
state.notify();
- return NULL;
+ return nullptr;
}
template<class R, class P>
@@ -65,7 +65,7 @@
auto now = std::chrono::system_clock::now();
BackgroundTaskState state{std::forward<decltype(func)>(func)};
pthread_t thread;
- if (pthread_create(&thread, NULL, callAndNotify, &state)) {
+ if (pthread_create(&thread, nullptr, callAndNotify, &state)) {
std::cerr << "FATAL: could not create background thread." << std::endl;
return false;
}
@@ -73,7 +73,7 @@
if (!success) {
pthread_kill(thread, SIGINT);
}
- pthread_join(thread, NULL);
+ pthread_join(thread, nullptr);
return success;
}