Code style fixes for clang-tidy
CI ended up complaining about these in unrelated patches that happened
to touch the same files; rather than clutter up those patches with
completely tangential changes, let's handle them separately.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: Ic5bed1d618380e2ebcf33804e11336b6a0a27b1b
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index 61a03fb..e256bb1 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -595,7 +595,7 @@
}
for (const auto& item : subtree)
{
- size_t lastSlash = item.first.rfind("/");
+ size_t lastSlash = item.first.rfind('/');
if (lastSlash == std::string::npos ||
lastSlash == item.first.size() || item.second.empty())
{
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index a0f74ba..d66537b 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -288,9 +288,17 @@
continue;
}
+ std::string name = "Pwm_";
+ name += psuName;
+ name += "_";
+ name += pwmName.second;
+
+ std::string objPath = interfacePath;
+ objPath += "_";
+ objPath += pwmName.second;
+
pwmSensors[psuName + labelHead] = std::make_unique<PwmSensor>(
- "Pwm_" + psuName + "_" + pwmName.second, pwmPathStr, dbusConnection,
- objectServer, interfacePath + "_" + pwmName.second, "PSU");
+ name, pwmPathStr, dbusConnection, objectServer, objPath, "PSU");
}
}