Fix some gcc warnings and style suggestions

Building against gcc-10 produced warnings and style suggestions.
Fixed all the warnings, but only select style suggestions due to
readability and others appeared to be compiler confusion.

Tested: Compiled
    No functional impacts appear to have been made with these changes

Change-Id: I1adcce355b831ae8b178bfba9b89cc18fe4f3cf7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/zone.cpp b/control/zone.cpp
index 3c87654..9efb0c7 100644
--- a/control/zone.cpp
+++ b/control/zone.cpp
@@ -63,9 +63,9 @@
 {
     auto& fanDefs = std::get<fanListPos>(def);
 
-    for (auto& def : fanDefs)
+    for (auto& fanDef : fanDefs)
     {
-        _fans.emplace_back(std::make_unique<Fan>(bus, def));
+        _fans.emplace_back(std::make_unique<Fan>(bus, fanDef));
     }
 
     // Do not enable set speed events when in init mode
@@ -89,9 +89,9 @@
             _targetSpeed = _fans.front()->getTargetSpeed();
         }
         // Setup signal trigger for set speed events
-        for (auto& event : std::get<setSpeedEventsPos>(def))
+        for (auto& ssEvent : std::get<setSpeedEventsPos>(def))
         {
-            initEvent(event);
+            initEvent(ssEvent);
         }
         // Start timer for fan speed decreases
         _decTimer.restart(_decInterval);
@@ -523,7 +523,7 @@
     if (it != _persisted.end())
     {
         return std::any_of(it->second.begin(), it->second.end(),
-                           [&prop](auto& p) { return prop == p; });
+                           [&prop](const auto& p) { return prop == p; });
     }
 
     return persisted;