clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety
and clarity, as nullptr is the modern C++ standard for null pointers.
Tested: Build verified
Change-Id: Iade4e4f1f25092f880fe06d61703db505b6e03d1
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/gpioMonMain.cpp b/gpioMonMain.cpp
index 47c4d39..2a29d1f 100644
--- a/gpioMonMain.cpp
+++ b/gpioMonMain.cpp
@@ -83,7 +83,7 @@
std::string lineMsg = "GPIO Line ";
/* GPIO line */
- gpiod_line* line = NULL;
+ gpiod_line* line = nullptr;
/* GPIO line configuration, default to monitor both edge */
struct gpiod_line_request_config config
@@ -130,7 +130,7 @@
line = gpiod_line_find(lineName.c_str());
}
- if (line == NULL)
+ if (line == nullptr)
{
lg2::error("Failed to find the {GPIO}", "GPIO", lineMsg);
continue;
diff --git a/multi-presence/main.cpp b/multi-presence/main.cpp
index 368f8bb..858ac7c 100644
--- a/multi-presence/main.cpp
+++ b/multi-presence/main.cpp
@@ -84,7 +84,7 @@
std::string lineMsg = "GPIO Line ";
/* GPIO line */
- gpiod_line* line = NULL;
+ gpiod_line* line = nullptr;
/* GPIO line configuration, default to monitor both edge */
struct gpiod_line_request_config config
@@ -131,7 +131,7 @@
line = gpiod_line_find(lineName.c_str());
}
- if (line == NULL)
+ if (line == nullptr)
{
lg2::error("Failed to find the {GPIO}", "GPIO", lineMsg);
continue;
diff --git a/presence/gpio_presence.hpp b/presence/gpio_presence.hpp
index 3125ba2..52a1653 100644
--- a/presence/gpio_presence.hpp
+++ b/presence/gpio_presence.hpp
@@ -81,7 +81,7 @@
// DRIVER_BIND_DELAY_MS environment variable is set.
// Update the bind delay (in milliseconds) to the value from the
// environment.
- delay = std::strtoull(envDelay, NULL, 10);
+ delay = std::strtoull(envDelay, nullptr, 10);
}
determinePresence();
}