Replace all uses of NULL with nullptr
This was an automatic change made by clang-tidy. It moves all uses of
NULL to nullptr, which are equivalent, but nullptr is prefered.
Tested: Code compiles.
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I9526599b222693c9723a69934b599c7a5b5d1fbf
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index c8673d1..73986b9 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -1071,7 +1071,7 @@
int readVariantFromMessage(sdbusplus::message::message &m, nlohmann::json &data)
{
const char *containerType;
- int r = sd_bus_message_peek_type(m.get(), NULL, &containerType);
+ int r = sd_bus_message_peek_type(m.get(), nullptr, &containerType);
if (r < 0)
{
BMCWEB_LOG_ERROR << "sd_bus_message_peek_type failed";
diff --git a/include/pam_authenticate.hpp b/include/pam_authenticate.hpp
index 464f171..5d78efc 100644
--- a/include/pam_authenticate.hpp
+++ b/include/pam_authenticate.hpp
@@ -54,7 +54,7 @@
std::string passStr(password);
const struct pam_conv localConversation = {
pamFunctionConversation, const_cast<char*>(passStr.c_str())};
- pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
+ pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start
if (pam_start("webserver", userStr.c_str(), &localConversation,
&localAuthHandle) != PAM_SUCCESS)
@@ -91,7 +91,7 @@
{
const struct pam_conv localConversation = {
pamFunctionConversation, const_cast<char*>(password.c_str())};
- pam_handle_t* localAuthHandle = NULL; // this gets set by pam_start
+ pam_handle_t* localAuthHandle = nullptr; // this gets set by pam_start
int retval = pam_start("passwd", username.c_str(), &localConversation,
&localAuthHandle);
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index 2bd1f59..84aa097 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -56,7 +56,7 @@
return false;
}
- int errCode = X509_STORE_CTX_init(storeCtx, x509Store, cert, NULL);
+ int errCode = X509_STORE_CTX_init(storeCtx, x509Store, cert, nullptr);
if (errCode != 1)
{
BMCWEB_LOG_ERROR << "Error occured during X509_STORE_CTX_init call";
@@ -107,9 +107,9 @@
std::cout << "Checking certs in file " << filepath << "\n";
FILE *file = fopen(filepath.c_str(), "r");
- if (file != NULL)
+ if (file != nullptr)
{
- EVP_PKEY *pkey = PEM_read_PrivateKey(file, NULL, NULL, NULL);
+ EVP_PKEY *pkey = PEM_read_PrivateKey(file, nullptr, nullptr, nullptr);
if (pkey != nullptr)
{
RSA *rsa = EVP_PKEY_get1_RSA(pkey);
@@ -154,7 +154,7 @@
// key order issue.
fseek(file, 0, SEEK_SET);
- X509 *x509 = PEM_read_X509(file, NULL, NULL, NULL);
+ X509 *x509 = PEM_read_X509(file, nullptr, nullptr, nullptr);
if (x509 == nullptr)
{
std::cout << "error getting x509 cert " << ERR_get_error()
@@ -176,7 +176,7 @@
inline void generateSslCertificate(const std::string &filepath)
{
- FILE *pFile = NULL;
+ FILE *pFile = nullptr;
std::cout << "Generating new keys\n";
initOpenssl();
@@ -233,19 +233,19 @@
if (pFile != nullptr)
{
- PEM_write_PrivateKey(pFile, pRsaPrivKey, NULL, NULL, 0, 0,
- NULL);
+ PEM_write_PrivateKey(pFile, pRsaPrivKey, nullptr, nullptr, 0,
+ nullptr, nullptr);
PEM_write_X509(pFile, x509);
fclose(pFile);
- pFile = NULL;
+ pFile = nullptr;
}
X509_free(x509);
}
EVP_PKEY_free(pRsaPrivKey);
- pRsaPrivKey = NULL;
+ pRsaPrivKey = nullptr;
}
// cleanup_openssl();
@@ -253,7 +253,7 @@
EVP_PKEY *createEcKey()
{
- EVP_PKEY *pKey = NULL;
+ EVP_PKEY *pKey = nullptr;
int eccgrp = 0;
eccgrp = OBJ_txt2nid("prime256v1");