Make dbus-sensors compile with clang-13
clang-13 finds a lot more warnings for unused variables than it used to,
and also picks up some warnings about errant std::moves that are in
place.
This commit fixes them.
Tested:
code compiles against clang-13
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I80864287b7131acfe936c4b28afaf34ababb3029
diff --git a/src/HwmonTempMain.cpp b/src/HwmonTempMain.cpp
index 4f259dc..d9fe52d 100644
--- a/src/HwmonTempMain.cpp
+++ b/src/HwmonTempMain.cpp
@@ -36,7 +36,6 @@
#include <variant>
#include <vector>
-static constexpr bool debug = false;
static constexpr float pollRateDefault = 0.5;
namespace fs = std::filesystem;
@@ -69,9 +68,8 @@
{
auto getter = std::make_shared<GetSensorConfiguration>(
dbusConnection,
- std::move([&io, &objectServer, &sensors, &dbusConnection,
- sensorsChanged](
- const ManagedObjectType& sensorConfigurations) {
+ [&io, &objectServer, &sensors, &dbusConnection,
+ sensorsChanged](const ManagedObjectType& sensorConfigurations) {
bool firstScan = sensorsChanged == nullptr;
std::vector<fs::path> paths;
@@ -89,7 +87,6 @@
for (auto& path : paths)
{
std::smatch match;
- const std::string& pathStr = path.string();
auto directory = path.parent_path();
auto ret = directories.insert(directory.string());
@@ -296,7 +293,7 @@
}
}
}
- }));
+ });
getter->getConfiguration(
std::vector<std::string>(sensorTypes.begin(), sensorTypes.end()));
}