meson support: remove code warnings 2

This commit contains code changes necessary to support the increased
warning level from Meson builds. Most changes are for unused variables.
to keep the review size manageable, this commit contains only control
changes (plus one in sensor-monitor).

Change-Id: Ie20f1d9028add4b605e4cc9fb230940710365706
Signed-off-by: Mike Capps <mikepcapps@gmail.com>
diff --git a/control/fanctl.cpp b/control/fanctl.cpp
index 3e6591f..4479db1 100644
--- a/control/fanctl.cpp
+++ b/control/fanctl.cpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2021 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -661,7 +661,7 @@
  * @function setup the CLI object to accept all options
  */
 void initCLI(CLI::App& app, uint64_t& target, std::vector<std::string>& fanList,
-             DumpQuery& dq)
+             [[maybe_unused]] DumpQuery& dq)
 {
     app.set_help_flag("-h,--help", "Print this help page and exit.");
 
diff --git a/control/json/actions/mapped_floor.cpp b/control/json/actions/mapped_floor.cpp
index 34cbfac..55414ac 100644
--- a/control/json/actions/mapped_floor.cpp
+++ b/control/json/actions/mapped_floor.cpp
@@ -197,7 +197,7 @@
 }
 
 std::optional<PropertyVariantType>
-    MappedFloor::getMaxGroupValue(const Group& group, const Manager& manager)
+    MappedFloor::getMaxGroupValue(const Group& group)
 {
     std::optional<PropertyVariantType> max;
     bool checked = false;
@@ -257,9 +257,8 @@
 void MappedFloor::run(Zone& zone)
 {
     std::optional<uint64_t> newFloor;
-    auto& manager = *zone.getManager();
 
-    auto keyValue = getMaxGroupValue(*_keyGroup, manager);
+    auto keyValue = getMaxGroupValue(*_keyGroup);
     if (!keyValue)
     {
         auto floor = _defaultFloor ? *_defaultFloor : zone.getDefaultFloor();
@@ -312,8 +311,8 @@
             }
             else
             {
-                propertyValue = getMaxGroupValue(
-                    *std::get<const Group*>(groupOrParameter), manager);
+                propertyValue =
+                    getMaxGroupValue(*std::get<const Group*>(groupOrParameter));
             }
 
             std::optional<uint64_t> floor;
diff --git a/control/json/actions/mapped_floor.hpp b/control/json/actions/mapped_floor.hpp
index 6866250..9c8a937 100644
--- a/control/json/actions/mapped_floor.hpp
+++ b/control/json/actions/mapped_floor.hpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2021 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -192,12 +192,9 @@
      *
      * @param[in] group - The group to get the max value of
      *
-     * @param[in] manager - The Manager object
-     *
      * @return optional<PropertyVariantType> - The value, or std::nullopt
      */
-    std::optional<PropertyVariantType> getMaxGroupValue(const Group& group,
-                                                        const Manager& manager);
+    std::optional<PropertyVariantType> getMaxGroupValue(const Group& group);
 
     /**
      * @brief Returns a pointer to the group object specified
diff --git a/control/json/actions/net_target_increase.cpp b/control/json/actions/net_target_increase.cpp
index 6b30e06..cc08cfa 100644
--- a/control/json/actions/net_target_increase.cpp
+++ b/control/json/actions/net_target_increase.cpp
@@ -90,7 +90,7 @@
                                 auto deltaFactor =
                                     std::max((std::get<int64_t>(value) -
                                               std::get<int64_t>(_state)),
-                                             1ll);
+                                             int64_t(1));
                                 incDelta =
                                     static_cast<uint64_t>(deltaFactor * _delta);
                             }
diff --git a/control/json/actions/pcie_card_floors.cpp b/control/json/actions/pcie_card_floors.cpp
index 512c678..7ec1a87 100644
--- a/control/json/actions/pcie_card_floors.cpp
+++ b/control/json/actions/pcie_card_floors.cpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2021 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,12 +50,12 @@
     {
         _settleTimer =
             std::make_unique<Timer>(util::SDEventPlus::getEvent(),
-                                    [&zone, this](Timer&) { execute(zone); });
+                                    [&zone, this](Timer&) { execute(); });
     }
     _settleTimer->restartOnce(_settleTime);
 }
 
-void PCIeCardFloors::execute(Zone& zone)
+void PCIeCardFloors::execute()
 {
     size_t hotCards = 0;
     size_t numTempSensorCards = 0;
diff --git a/control/json/actions/pcie_card_floors.hpp b/control/json/actions/pcie_card_floors.hpp
index 7b73d39..a662a6d 100644
--- a/control/json/actions/pcie_card_floors.hpp
+++ b/control/json/actions/pcie_card_floors.hpp
@@ -106,16 +106,14 @@
      * to distinguish it from ones under different events and also it just
      * makes it uglier in the flight recorder.
      */
-    void setEventName(const std::string& name) override
+    void setEventName(const std::string& /*name*/) override
     {}
 
   private:
     /**
      * @brief Runs the contents of the action when the settle timer expires.
-     *
-     * @param[in] zone - Zone to run the action on
      */
-    void execute(Zone& zone);
+    void execute();
 
     /**
      * @brief Constructs the PCIeCardMetadata object to load the PCIe card
diff --git a/control/json/actions/set_parameter_from_group_max.cpp b/control/json/actions/set_parameter_from_group_max.cpp
index ae5b31d..c7d18a1 100644
--- a/control/json/actions/set_parameter_from_group_max.cpp
+++ b/control/json/actions/set_parameter_from_group_max.cpp
@@ -33,7 +33,7 @@
     setModifier(jsonObj);
 }
 
-void SetParameterFromGroupMax::run(Zone& zone)
+void SetParameterFromGroupMax::run(Zone& /*zone*/)
 {
     std::optional<PropertyVariantType> max;
 
diff --git a/control/json/actions/set_parameter_from_group_max.hpp b/control/json/actions/set_parameter_from_group_max.hpp
index ae18eef4..ad0114c 100644
--- a/control/json/actions/set_parameter_from_group_max.hpp
+++ b/control/json/actions/set_parameter_from_group_max.hpp
@@ -66,7 +66,7 @@
     SetParameterFromGroupMax&
         operator=(const SetParameterFromGroupMax&) = delete;
     SetParameterFromGroupMax& operator=(SetParameterFromGroupMax&&) = delete;
-    ~SetParameterFromGroupMax() = default;
+    virtual ~SetParameterFromGroupMax() = default;
 
     /**
      * @brief Constructor
diff --git a/control/json/config_base.hpp b/control/json/config_base.hpp
index 5bfb9f2..a7b47b8 100644
--- a/control/json/config_base.hpp
+++ b/control/json/config_base.hpp
@@ -50,6 +50,7 @@
     ConfigBase(ConfigBase&&) = delete;
     ConfigBase& operator=(const ConfigBase&) = delete;
     ConfigBase& operator=(ConfigBase&&) = delete;
+
     virtual ~ConfigBase() = default;
 
     explicit ConfigBase(const json& jsonObj)
diff --git a/control/json/manager.cpp b/control/json/manager.cpp
index 457324c..19d9d9b 100644
--- a/control/json/manager.cpp
+++ b/control/json/manager.cpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2020 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/control/json/manager.hpp b/control/json/manager.hpp
index 3fbcc9c..78963a4 100644
--- a/control/json/manager.hpp
+++ b/control/json/manager.hpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2020 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
 #pragma once
 
 #include "action.hpp"
-#include "config_base.hpp"
 #include "event.hpp"
 #include "group.hpp"
 #include "json_config.hpp"
@@ -59,6 +58,7 @@
     oneshot,
     repeating,
 };
+
 /**
  * Package of data required when a timer expires
  * Tuple constructed of:
diff --git a/control/json/triggers/init.cpp b/control/json/triggers/init.cpp
index 6556fdc..7452584 100644
--- a/control/json/triggers/init.cpp
+++ b/control/json/triggers/init.cpp
@@ -138,8 +138,8 @@
     }
 }
 
-enableTrigger triggerInit(const json& jsonObj, const std::string& eventName,
-                          std::vector<std::unique_ptr<ActionBase>>& actions)
+enableTrigger triggerInit(const json& jsonObj, const std::string& /*eventName*/,
+                          std::vector<std::unique_ptr<ActionBase>>& /*actions*/)
 {
     // Get the method handler if configured
     auto handler = methods.end();
diff --git a/control/json/triggers/parameter.cpp b/control/json/triggers/parameter.cpp
index 3abe57c..6f4eac3 100644
--- a/control/json/triggers/parameter.cpp
+++ b/control/json/triggers/parameter.cpp
@@ -26,7 +26,7 @@
 
 enableTrigger
     triggerParameter(const json& jsonObj, const std::string& eventName,
-                     std::vector<std::unique_ptr<ActionBase>>& actions)
+                     std::vector<std::unique_ptr<ActionBase>>& /*actions*/)
 {
     if (!jsonObj.contains("parameter"))
     {
@@ -38,8 +38,8 @@
 
     auto name = jsonObj["parameter"].get<std::string>();
 
-    return [name](const std::string& eventName, Manager* mgr,
-                  const std::vector<Group>& groups,
+    return [name](const std::string& /*eventName*/, Manager* /*mgr*/,
+                  const std::vector<Group>& /*groups*/,
                   std::vector<std::unique_ptr<ActionBase>>& actions) {
         Manager::addParameterTrigger(name, actions);
     };
diff --git a/control/json/triggers/signal.cpp b/control/json/triggers/signal.cpp
index 9f7caa3..10a42d6 100644
--- a/control/json/triggers/signal.cpp
+++ b/control/json/triggers/signal.cpp
@@ -192,7 +192,7 @@
                                        SignalObject(), actions};
                 // If signal match already exists, then the service will be the
                 // same so add action to be run
-                auto isSameSig = [](SignalPkg& pkg) { return true; };
+                auto isSameSig = [](SignalPkg&) { return true; };
 
                 subscribe(match, std::move(signalPkg), isSameSig, mgr);
                 grpServices.emplace_back(serv);
@@ -220,7 +220,7 @@
     SignalPkg signalPkg = {Handlers::member, SignalObject(), actions};
     // If signal match already exists, then the member signal will be the
     // same so add action to be run
-    auto isSameSig = [](SignalPkg& pkg) { return true; };
+    auto isSameSig = [](SignalPkg&) { return true; };
 
     // Groups are optional, but a signal triggered event with no groups
     // will do nothing since signals require a group
@@ -235,8 +235,9 @@
     }
 }
 
-enableTrigger triggerSignal(const json& jsonObj, const std::string& eventName,
-                            std::vector<std::unique_ptr<ActionBase>>& actions)
+enableTrigger
+    triggerSignal(const json& jsonObj, const std::string& eventName,
+                  std::vector<std::unique_ptr<ActionBase>>& /*actions*/)
 {
     auto subscriber = signals.end();
     if (jsonObj.contains("signal"))
@@ -262,7 +263,7 @@
     }
 
     return [subscriber = std::move(subscriber),
-            jsonObj](const std::string& eventName, Manager* mgr,
+            jsonObj](const std::string& /*eventName*/, Manager* mgr,
                      const std::vector<Group>& groups,
                      std::vector<std::unique_ptr<ActionBase>>& actions) {
         TriggerActions signalActions;
diff --git a/control/json/triggers/timer.cpp b/control/json/triggers/timer.cpp
index e04bdd0..ce8bba7 100644
--- a/control/json/triggers/timer.cpp
+++ b/control/json/triggers/timer.cpp
@@ -81,8 +81,9 @@
     return false;
 }
 
-enableTrigger triggerTimer(const json& jsonObj, const std::string& eventName,
-                           std::vector<std::unique_ptr<ActionBase>>& actions)
+enableTrigger
+    triggerTimer(const json& jsonObj, const std::string& /*eventName*/,
+                 std::vector<std::unique_ptr<ActionBase>>& /*actions*/)
 {
     // Get the type and interval of this timer from the JSON
     auto type = getType(jsonObj);
diff --git a/control/json/utils/modifier.cpp b/control/json/utils/modifier.cpp
index 2374960..501a035 100644
--- a/control/json/utils/modifier.cpp
+++ b/control/json/utils/modifier.cpp
@@ -126,7 +126,7 @@
         return value;
     }
 
-    PropertyVariantType operator()(bool val) override
+    PropertyVariantType operator()(bool) override
     {
         throw std::runtime_error{
             "Bool not allowed as a 'minus' modifier value"};
@@ -271,7 +271,7 @@
         return getDefaultValue(rangeValues.back().second, defaultValue);
     }
 
-    PropertyVariantType operator()(bool val) override
+    PropertyVariantType operator()(bool) override
     {
         throw std::runtime_error{
             "Bool not allowed as a 'less_than' modifier value"};
diff --git a/control/json/utils/modifier.hpp b/control/json/utils/modifier.hpp
index 6153279..8959203 100644
--- a/control/json/utils/modifier.hpp
+++ b/control/json/utils/modifier.hpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2021 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +55,8 @@
      */
     struct BaseOperator
     {
+        virtual ~BaseOperator() = default;
+
         virtual PropertyVariantType operator()(double val) = 0;
 
         virtual PropertyVariantType operator()(int32_t val) = 0;
diff --git a/control/main.cpp b/control/main.cpp
index 5e81e99..90f8e5c 100644
--- a/control/main.cpp
+++ b/control/main.cpp
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2017 IBM Corporation
+ * Copyright © 2022 IBM Corporation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
 #else
 #include "json/manager.hpp"
 #endif
+
+#include "event.hpp"
 #include "sdbusplus.hpp"
 #include "sdeventplus.hpp"
 
@@ -46,7 +48,7 @@
 }
 #endif
 
-int main(int argc, char* argv[])
+int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
 {
     auto event = phosphor::fan::util::SDEventPlus::getEvent();
 
diff --git a/control/manager.cpp b/control/manager.cpp
index adf9b53..023df39 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -121,7 +121,7 @@
     }
 }
 
-void Manager::doInit(const sdeventplus::Event& event)
+void Manager::doInit(const sdeventplus::Event& /*event*/)
 {
     for (auto& z : _zones)
     {
diff --git a/control/triggers.cpp b/control/triggers.cpp
index 5847576..362f4b6 100644
--- a/control/triggers.cpp
+++ b/control/triggers.cpp
@@ -65,8 +65,8 @@
 Trigger init(MethodHandler&& handler)
 {
     return [handler = std::move(handler)](
-               control::Zone& zone, const std::string& name, const Group& group,
-               const std::vector<Action>& actions) {
+               control::Zone& zone, const std::string& /*name*/,
+               const Group& group, const std::vector<Action>& actions) {
         // A handler function is optional
         if (handler)
         {
diff --git a/control/zone.hpp b/control/zone.hpp
index c82f0a8..a66275a 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -164,7 +164,7 @@
                           const char* property, T value)
     {
         _properties[object][interface][property] = value;
-    };
+    }
 
     /**
      * @brief Sets a given object's property value
@@ -180,7 +180,7 @@
                           const std::string& property, T value)
     {
         _properties[object][interface][property] = value;
-    };
+    }
 
     /**
      * @brief Get the value of an object's property
@@ -197,7 +197,7 @@
                                  const std::string& property)
     {
         return std::get<T>(_properties.at(object).at(interface).at(property));
-    };
+    }
 
     /**
      * @brief Get the object's property variant
@@ -213,7 +213,7 @@
                                     const std::string& property)
     {
         return _properties.at(object).at(interface).at(property);
-    };
+    }
 
     /**
      * @brief Get a property's value after applying a set of visitors
@@ -271,7 +271,7 @@
         // Default to return the property's value by the data type
         // configured, applying no visitors to the variant.
         return std::get<T>(variant);
-    };
+    }
 
     /**
      * @brief Remove an object's interface
@@ -347,7 +347,7 @@
     inline auto getDefFloor()
     {
         return _defFloorSpeed;
-    };
+    }
 
     /**
      * @brief Set the default floor
@@ -357,7 +357,7 @@
     inline void setDefFloor(uint64_t speed)
     {
         _defFloorSpeed = speed;
-    };
+    }
 
     /**
      * @brief Get the ceiling speed
@@ -367,7 +367,7 @@
     inline auto& getCeiling() const
     {
         return _ceilingSpeed;
-    };
+    }
 
     /**
      * @brief Set the ceiling speed to the given speed
@@ -377,7 +377,7 @@
     inline void setCeiling(uint64_t speed)
     {
         _ceilingSpeed = speed;
-    };
+    }
 
     /**
      * @brief Swaps the ceiling key value with what's given and
@@ -391,7 +391,7 @@
     {
         std::swap(_ceilingKeyValue, keyValue);
         return keyValue;
-    };
+    }
 
     /**
      * @brief Get the increase speed delta
@@ -401,7 +401,7 @@
     inline auto& getIncSpeedDelta() const
     {
         return _incSpeedDelta;
-    };
+    }
 
     /**
      * @brief Get the decrease speed delta
@@ -411,7 +411,7 @@
     inline auto& getDecSpeedDelta() const
     {
         return _decSpeedDelta;
-    };
+    }
 
     /**
      * @brief Set the floor speed to the given speed and increase target
@@ -431,7 +431,7 @@
     inline void setRequestSpeedBase(uint64_t speedBase)
     {
         _requestSpeedBase = speedBase;
-    };
+    }
 
     /**
      * @brief Calculate the requested target speed from the given delta
@@ -649,7 +649,7 @@
         value = getPropertyValueVisitor<T>(intf.c_str(), prop.c_str(), variant);
 
         return value;
-    };
+    }
 
     /**
      * @brief Overridden thermal object's set 'Current' property function
@@ -843,7 +843,7 @@
     inline auto getRequestSpeedBase() const
     {
         return (_requestSpeedBase != 0) ? _requestSpeedBase : _targetSpeed;
-    };
+    }
 };
 
 } // namespace control
diff --git a/sensor-monitor/main.cpp b/sensor-monitor/main.cpp
index fc9967f..1974065 100644
--- a/sensor-monitor/main.cpp
+++ b/sensor-monitor/main.cpp
@@ -22,7 +22,7 @@
 
 using namespace sensor::monitor;
 
-int main(int argc, char* argv[])
+int main(int, char*[])
 {
     auto event = sdeventplus::Event::get_default();
     auto bus = sdbusplus::bus::new_default();