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/ADCSensorMain.cpp b/src/ADCSensorMain.cpp
index 4f35a7f..9311834 100644
--- a/src/ADCSensorMain.cpp
+++ b/src/ADCSensorMain.cpp
@@ -35,7 +35,6 @@
#include <variant>
#include <vector>
-static constexpr bool debug = false;
static constexpr float pollRateDefault = 0.5;
static constexpr float gpioBridgeSetupTimeDefault = 0.02;
@@ -75,9 +74,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;
if (!findFiles(fs::path("/sys/class/hwmon"), R"(in\d+_input)",
@@ -306,7 +304,7 @@
readState, *interfacePath, std::move(bridgeGpio));
sensor->setupRead();
}
- }));
+ });
getter->getConfiguration(
std::vector<std::string>{sensorTypes.begin(), sensorTypes.end()});