bmcweb: fix compiler warnings
This patchset attempts to fix all compiler warnings in bmcweb owned
files. There are 2 warnings left, both in sdbusplus, which will be
resolved in a patchset there.
Tested By:
Recompiled, observed warning count went from 30, to zero.
Change-Id: Ife90207aa5773bc28faa8b04c732cafa5a56e4e4
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 3f181c7..e9120f3 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -166,7 +166,6 @@
configRoot["@odata.context"] =
"/redfish/v1/$metadata#OemManager.Fan";
- bool propertyError = false;
for (const auto& pathPair : managedObj)
{
for (const auto& intfPair : pathPair.second)
@@ -945,7 +944,6 @@
"xyz.openbmc_project.Software.Version")
{
// Cut out everyting until last "/", ...
- const std::string& iface_id = objpath.first;
for (auto& property : interface.second)
{
if (property.first == "Version")
@@ -1005,7 +1003,7 @@
return;
}
std::array<
- std::pair<const char*, std::optional<nlohmann::json>*>, 4>
+ std::pair<std::string, std::optional<nlohmann::json>*>, 4>
sections = {
std::make_pair("PidControllers", &pidControllers),
std::make_pair("FanControllers", &fanControllers),
@@ -1020,7 +1018,7 @@
{
continue;
}
- const char* type = containerPair.first;
+ std::string& type = containerPair.first;
for (auto& record : container->items())
{
@@ -1180,31 +1178,26 @@
if (oem)
{
- for (const auto& oemLevel : oem->items())
+ std::optional<nlohmann::json> openbmc;
+ if (!redfish::json_util::readJson(*oem, res, "OpenBmc", openbmc))
{
- std::optional<nlohmann::json> openbmc;
- if (!redfish::json_util::readJson(*oem, res, "OpenBmc",
- openbmc))
+ BMCWEB_LOG_ERROR << "Line:" << __LINE__ << ", Illegal Property "
+ << oem->dump();
+ return;
+ }
+ if (openbmc)
+ {
+ std::optional<nlohmann::json> fan;
+ if (!redfish::json_util::readJson(*openbmc, res, "Fan", fan))
{
BMCWEB_LOG_ERROR << "Line:" << __LINE__
- << ", Illegal Property " << oem->dump();
+ << ", Illegal Property "
+ << openbmc->dump();
return;
}
- if (openbmc)
+ if (fan)
{
- std::optional<nlohmann::json> fan;
- if (!redfish::json_util::readJson(*openbmc, res, "Fan",
- fan))
- {
- BMCWEB_LOG_ERROR << "Line:" << __LINE__
- << ", Illegal Property "
- << openbmc->dump();
- return;
- }
- if (fan)
- {
- setPidValues(response, *fan);
- }
+ setPidValues(response, *fan);
}
}
}