summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy2
-rw-r--r--include/multipart_parser.hpp6
-rw-r--r--include/sessions.hpp2
-rw-r--r--redfish-core/include/event_service_manager.hpp9
-rw-r--r--redfish-core/include/utils/systemd_utils.hpp2
-rw-r--r--redfish-core/lib/network_protocol.hpp2
6 files changed, 13 insertions, 10 deletions
diff --git a/.clang-tidy b/.clang-tidy
index eae3c722cb..311617baa6 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -202,7 +202,9 @@ clang-analyzer-valist.ValistBase,
clang-analyzer-webkit.NoUncountedMemberChecker,
clang-analyzer-webkit.RefCntblBaseVirtualDtor,
cppcoreguidelines-init-variables,
+cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-pro-bounds-pointer-arithmetic,
+cppcoreguidelines-pro-type-member-init,
cppcoreguidelines-pro-type-reinterpret-cast,
cppcoreguidelines-special-member-functions,
misc-misplaced-const,
diff --git a/include/multipart_parser.hpp b/include/multipart_parser.hpp
index e385558037..ee028f1d3e 100644
--- a/include/multipart_parser.hpp
+++ b/include/multipart_parser.hpp
@@ -337,10 +337,10 @@ class MultipartParser
static constexpr char hyphen = '-';
static constexpr char colon = ':';
- std::array<bool, 256> boundaryIndex;
+ std::array<bool, 256> boundaryIndex{};
std::string lookbehind;
- State state;
- Boundary flags;
+ State state{State::START};
+ Boundary flags{Boundary::NON_BOUNDARY};
size_t index = 0;
size_t partDataMark = 0;
size_t headerFieldMark = 0;
diff --git a/include/sessions.hpp b/include/sessions.hpp
index 79e71ced9a..b445915e34 100644
--- a/include/sessions.hpp
+++ b/include/sessions.hpp
@@ -46,7 +46,7 @@ struct UserSession
std::string clientId;
std::string clientIp;
std::chrono::time_point<std::chrono::steady_clock> lastUpdated;
- PersistenceType persistence;
+ PersistenceType persistence{PersistenceType::TIMEOUT};
bool cookieAuth = false;
bool isConfigureSelfOnly = false;
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 7cb5cc7cb7..ee402b61ee 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -564,9 +564,9 @@ class Subscription : public persistent_data::UserSubscription
class EventServiceManager
{
private:
- bool serviceEnabled;
- uint32_t retryAttempts;
- uint32_t retryTimeoutInterval;
+ bool serviceEnabled = false;
+ uint32_t retryAttempts = 0;
+ uint32_t retryTimeoutInterval = 0;
EventServiceManager()
{
@@ -1189,7 +1189,8 @@ class EventServiceManager
std::size_t index = 0;
while ((index + iEventSize) <= bytesTransferred)
{
- struct inotify_event event;
+ struct inotify_event event
+ {};
std::memcpy(&event, &readBuffer[index], iEventSize);
if (event.wd == dirWatchDesc)
{
diff --git a/redfish-core/include/utils/systemd_utils.hpp b/redfish-core/include/utils/systemd_utils.hpp
index 75bbe35806..ad157dc793 100644
--- a/redfish-core/include/utils/systemd_utils.hpp
+++ b/redfish-core/include/utils/systemd_utils.hpp
@@ -39,7 +39,7 @@ inline std::string getUuid()
if (sd_id128_get_machine_app_specific(appId, &machineId) == 0)
{
- std::array<char, SD_ID128_STRING_MAX> str;
+ std::array<char, SD_ID128_STRING_MAX> str{};
ret = sd_id128_to_string(machineId, str.data());
ret.insert(8, 1, '-');
ret.insert(13, 1, '-');
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 41b14f83c3..61c3c68a07 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -358,7 +358,7 @@ inline std::string getHostName()
{
std::string hostName;
- std::array<char, HOST_NAME_MAX> hostNameCStr;
+ std::array<char, HOST_NAME_MAX> hostNameCStr{};
if (gethostname(hostNameCStr.data(), hostNameCStr.size()) == 0)
{
hostName = hostNameCStr.data();