Clang-tidy-14 fixes
Do as the robot commands. All changes made automatically by tidy.
Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I752f37c9e7a95aa3be8e6980ba6e4b2b48b3395a
diff --git a/src/Utils.cpp b/src/Utils.cpp
index ad43caa..954a5d3 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -337,7 +337,7 @@
const std::variant<std::string>& state) {
if (ec)
{
- if (retries)
+ if (retries != 0U)
{
auto timer = std::make_shared<boost::asio::steady_timer>(
conn->get_io_context());
@@ -370,7 +370,7 @@
const std::variant<std::string>& state) {
if (ec)
{
- if (retries)
+ if (retries != 0U)
{
auto timer = std::make_shared<boost::asio::steady_timer>(
conn->get_io_context());
@@ -386,7 +386,7 @@
std::cerr << "error getting post status " << ec.message() << "\n";
return;
}
- auto& value = std::get<std::string>(state);
+ const auto& value = std::get<std::string>(state);
biosHasPost = (value != "Inactive") &&
(value != "xyz.openbmc_project.State.OperatingSystem."
"Status.OSStatus.Inactive");
@@ -471,7 +471,7 @@
void findLimits(std::pair<double, double>& limits,
const SensorBaseConfiguration* data)
{
- if (!data)
+ if (data == nullptr)
{
return;
}
@@ -648,7 +648,7 @@
<< "\n";
return;
}
- auto manufacturingModeStatus = std::get_if<std::string>(&itr->second);
+ auto* manufacturingModeStatus = std::get_if<std::string>(&itr->second);
handleSpecialModeChange(*manufacturingModeStatus);
});
@@ -670,7 +670,7 @@
{
return;
}
- auto manufacturingModeStatus = std::get_if<std::string>(&itr->second);
+ auto* manufacturingModeStatus = std::get_if<std::string>(&itr->second);
handleSpecialModeChange(*manufacturingModeStatus);
});
@@ -683,7 +683,7 @@
<< "\n";
return;
}
- auto manufacturingModeStatus =
+ const auto* manufacturingModeStatus =
std::get_if<std::string>(&getManufactMode);
handleSpecialModeChange(*manufacturingModeStatus);
},