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: If9e6c34c48821a7cf8577a2166727ce7db06fadc
Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
diff --git a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
index a6665f6..099fe3d 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
@@ -208,7 +208,7 @@
// memory map the topology file into pldm memory
void* fileInMemory =
- mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, topologyFd(), 0);
+ mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, topologyFd(), 0);
if (MAP_FAILED == fileInMemory)
{
error("mmap on topology file failed with error {RC}", "RC", -errno);
@@ -449,7 +449,7 @@
};
void* fileInMemory =
- mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, cableInfoFd(), 0);
+ mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, cableInfoFd(), 0);
if (MAP_FAILED == fileInMemory)
{
diff --git a/oem/ibm/libpldmresponder/utils.cpp b/oem/ibm/libpldmresponder/utils.cpp
index 6eb26a5..393faab 100644
--- a/oem/ibm/libpldmresponder/utils.cpp
+++ b/oem/ibm/libpldmresponder/utils.cpp
@@ -72,7 +72,7 @@
int nfd = sock + 1;
int fd = -1;
- int retval = select(nfd, &rfd, NULL, NULL, &tv);
+ int retval = select(nfd, &rfd, nullptr, nullptr, &tv);
if (retval < 0)
{
error(
@@ -84,7 +84,7 @@
if ((retval > 0) && (FD_ISSET(sock, &rfd)))
{
- fd = accept(sock, NULL, NULL);
+ fd = accept(sock, nullptr, nullptr);
if (fd < 0)
{
error(
@@ -114,7 +114,7 @@
FD_SET(sock, &wfd);
int nfd = sock + 1;
- int retval = select(nfd, NULL, &wfd, NULL, &tv);
+ int retval = select(nfd, nullptr, &wfd, nullptr, &tv);
if (retval < 0)
{
error(
diff --git a/oem/ibm/requester/dbus_to_file_handler.cpp b/oem/ibm/requester/dbus_to_file_handler.cpp
index 47ddf2c..8ed966c 100644
--- a/oem/ibm/requester/dbus_to_file_handler.cpp
+++ b/oem/ibm/requester/dbus_to_file_handler.cpp
@@ -32,7 +32,7 @@
void DbusToFileHandler::sendNewFileAvailableCmd(uint64_t fileSize)
{
- if (instanceIdDb == NULL)
+ if (instanceIdDb == nullptr)
{
error(
"Failed to send resource dump parameters as instance ID DB is not set");
@@ -245,7 +245,7 @@
void DbusToFileHandler::newFileAvailableSendToHost(
const uint32_t fileSize, const uint32_t fileHandle, const uint16_t type)
{
- if (instanceIdDb == NULL)
+ if (instanceIdDb == nullptr)
{
error("Failed to send csr to remote terminus.");
pldm::utils::reportError(