summaryrefslogtreecommitdiff
path: root/redfish-core/include
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2023-05-10 15:51:34 +0300
committerPatrick Williams <patrick@stwcx.xyz>2023-05-11 00:18:24 +0300
commit89492a157c9cf972b342421e24d41fd382510251 (patch)
tree64ed25f427f1ab1981f8c2bdcbfbc7fde5db80e9 /redfish-core/include
parentcddbf3df0ea0b78521b62f30f2ce764c6619018a (diff)
downloadbmcweb-89492a157c9cf972b342421e24d41fd382510251.tar.xz
clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository. Change-Id: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'redfish-core/include')
-rw-r--r--redfish-core/include/event_service_manager.hpp21
-rw-r--r--redfish-core/include/gzfile.hpp4
-rw-r--r--redfish-core/include/redfish_aggregator.hpp12
-rw-r--r--redfish-core/include/utils/json_utils.hpp3
-rw-r--r--redfish-core/include/utils/query_param.hpp6
-rw-r--r--redfish-core/include/utils/sw_utils.hpp1
-rw-r--r--redfish-core/include/utils/time_utils.hpp4
7 files changed, 24 insertions, 27 deletions
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 0b87555ec0..3fc4133e6b 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -245,8 +245,8 @@ inline int formatEventLogEntry(const std::string& logEntryID,
return -1;
}
- std::string msg =
- redfish::registries::fillMessageArgs(messageArgs, message->message);
+ std::string msg = redfish::registries::fillMessageArgs(messageArgs,
+ message->message);
if (msg.empty())
{
return -1;
@@ -440,8 +440,8 @@ class Subscription : public persistent_data::UserSubscription
msg["Name"] = "Event Log";
msg["Events"] = logEntryArray;
- std::string strMsg =
- msg.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
+ std::string strMsg = msg.dump(2, ' ', true,
+ nlohmann::json::error_handler_t::replace);
return this->sendEvent(strMsg);
}
@@ -509,8 +509,8 @@ class Subscription : public persistent_data::UserSubscription
msg["Name"] = "Event Log";
msg["Events"] = logEntryArray;
- std::string strMsg =
- msg.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
+ std::string strMsg = msg.dump(2, ' ', true,
+ nlohmann::json::error_handler_t::replace);
this->sendEvent(strMsg);
}
#endif
@@ -549,8 +549,8 @@ class Subscription : public persistent_data::UserSubscription
msg["Context"] = customText;
}
- std::string strMsg =
- msg.dump(2, ' ', true, nlohmann::json::error_handler_t::replace);
+ std::string strMsg = msg.dump(2, ' ', true,
+ nlohmann::json::error_handler_t::replace);
this->sendEvent(strMsg);
}
@@ -883,7 +883,6 @@ class EventServiceManager
std::string addSubscription(const std::shared_ptr<Subscription>& subValue,
const bool updateFile = true)
{
-
std::uniform_int_distribution<uint32_t> dist(0);
bmcweb::OpenSSLGenerator gen;
@@ -1317,8 +1316,8 @@ class EventServiceManager
}
// Watch redfish event log file for modifications.
- fileWatchDesc =
- inotify_add_watch(inotifyFd, redfishEventLogFile, IN_MODIFY);
+ fileWatchDesc = inotify_add_watch(inotifyFd, redfishEventLogFile,
+ IN_MODIFY);
if (fileWatchDesc == -1)
{
BMCWEB_LOG_ERROR
diff --git a/redfish-core/include/gzfile.hpp b/redfish-core/include/gzfile.hpp
index 844932aa81..34bc151ef5 100644
--- a/redfish-core/include/gzfile.hpp
+++ b/redfish-core/include/gzfile.hpp
@@ -97,8 +97,8 @@ class GzFileReader
while (pos != std::string::npos)
{
- std::string logEntry =
- bufferStr.substr(initialPos, pos - initialPos);
+ std::string logEntry = bufferStr.substr(initialPos,
+ pos - initialPos);
// Since there might be consecutive delimiters like "\r\n", we need
// to filter empty strings.
if (!logEntry.empty())
diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp
index 9168cc5ec5..896eb4aac5 100644
--- a/redfish-core/include/redfish_aggregator.hpp
+++ b/redfish-core/include/redfish_aggregator.hpp
@@ -815,8 +815,8 @@ class RedfishAggregator
if (boost::iequals(contentType, "application/json") ||
boost::iequals(contentType, "application/json; charset=utf-8"))
{
- nlohmann::json jsonVal =
- nlohmann::json::parse(resp.body(), nullptr, false);
+ nlohmann::json jsonVal = nlohmann::json::parse(resp.body(), nullptr,
+ false);
if (jsonVal.is_discarded())
{
BMCWEB_LOG_ERROR << "Error parsing satellite response as JSON";
@@ -879,8 +879,8 @@ class RedfishAggregator
if (boost::iequals(contentType, "application/json") ||
boost::iequals(contentType, "application/json; charset=utf-8"))
{
- nlohmann::json jsonVal =
- nlohmann::json::parse(resp.body(), nullptr, false);
+ nlohmann::json jsonVal = nlohmann::json::parse(resp.body(), nullptr,
+ false);
if (jsonVal.is_discarded())
{
BMCWEB_LOG_ERROR << "Error parsing satellite response as JSON";
@@ -1013,8 +1013,8 @@ class RedfishAggregator
boost::iequals(contentType, "application/json; charset=utf-8"))
{
bool addedLinks = false;
- nlohmann::json jsonVal =
- nlohmann::json::parse(resp.body(), nullptr, false);
+ nlohmann::json jsonVal = nlohmann::json::parse(resp.body(), nullptr,
+ false);
if (jsonVal.is_discarded())
{
BMCWEB_LOG_ERROR << "Error parsing satellite response as JSON";
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index 26b9a8a2e1..774ab7c5eb 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -505,8 +505,7 @@ inline bool readJsonHelper(nlohmann::json& jsonRequest, crow::Response& res,
return result;
}
-inline void packVariant(std::span<PerUnpack> /*toPack*/)
-{}
+inline void packVariant(std::span<PerUnpack> /*toPack*/) {}
template <typename FirstType, typename... UnpackTypes>
void packVariant(std::span<PerUnpack> toPack, std::string_view key,
diff --git a/redfish-core/include/utils/query_param.hpp b/redfish-core/include/utils/query_param.hpp
index 96885ebb20..e6ca9d313a 100644
--- a/redfish-core/include/utils/query_param.hpp
+++ b/redfish-core/include/utils/query_param.hpp
@@ -916,9 +916,9 @@ inline void recursiveSelect(nlohmann::json& currRoot,
constexpr std::array<std::string_view, 5> reservedProperties = {
"@odata.id", "@odata.type", "@odata.context", "@odata.etag",
"error"};
- bool reserved =
- std::find(reservedProperties.begin(), reservedProperties.end(),
- it.key()) != reservedProperties.end();
+ bool reserved = std::find(reservedProperties.begin(),
+ reservedProperties.end(),
+ it.key()) != reservedProperties.end();
if (reserved || (nextNode != nullptr && nextNode->isSelected()))
{
it = nextIt;
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index 90048dd1b5..7c746a0b1d 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -110,7 +110,6 @@ inline void
std::string, std::vector<std::string>>>>&
obj : subtree)
{
-
sdbusplus::message::object_path path(obj.first);
std::string swId = path.filename();
if (swId.empty())
diff --git a/redfish-core/include/utils/time_utils.hpp b/redfish-core/include/utils/time_utils.hpp
index f4fb0c07d5..cb018eff20 100644
--- a/redfish-core/include/utils/time_utils.hpp
+++ b/redfish-core/include/utils/time_utils.hpp
@@ -261,8 +261,8 @@ constexpr std::tuple<IntType, unsigned, unsigned>
z += 719468;
IntType era = (z >= 0 ? z : z - 146096) / 146097;
unsigned doe = static_cast<unsigned>(z - era * 146097); // [0, 146096]
- unsigned yoe =
- (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; // [0, 399]
+ unsigned yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) /
+ 365; // [0, 399]
IntType y = static_cast<IntType>(yoe) + era * 400;
unsigned doy = doe - (365 * yoe + yoe / 4 - yoe / 100); // [0, 365]
unsigned mp = (5 * doy + 2) / 153; // [0, 11]