Enable clang warnings

This commit enables clang warnings, and fixes all warnings that were
found.  Most of these fall into a couple categories:

Variable shadow issues were fixed by renaming variables

unused parameter warnings were resolved by either checking error codes
that had been ignored, or removing the name of the variable from the
scope.

Other various warnings were fixed in the best way I was able to come up
with.

Note, the redfish Node class is especially insidious, as it causes all
imlementers to have variables for parameters, regardless of whether or
not they are used.  Deprecating the Node class is on my list of things
to do, as it adds extra overhead, and in general isn't a useful
abstraction.  For now, I have simply fixed all the handlers.

Tested:
Added the current meta-clang meta layer into bblayers.conf, and added
TOOLCHAIN_pn-bmcweb = "clang" to my local.conf

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 99a03c9..d1895c4 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -320,7 +320,7 @@
  * allSensors list.  Eliminate Thermal sensors when a Power request is
  * made, and eliminate Power sensors when a Thermal request is made.
  */
-void reduceSensorList(
+inline void reduceSensorList(
     std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp,
     const std::vector<std::string>* allSensors,
     std::shared_ptr<boost::container::flat_set<std::string>> activeSensors)
@@ -623,7 +623,7 @@
  * @param inventoryItem D-Bus inventory item associated with a sensor.
  * @return State value for inventory item.
  */
-static std::string getState(const InventoryItem* inventoryItem)
+inline std::string getState(const InventoryItem* inventoryItem)
 {
     if ((inventoryItem != nullptr) && !(inventoryItem->isPresent))
     {
@@ -641,7 +641,7 @@
  * be nullptr if no associated inventory item was found.
  * @return Health value for sensor.
  */
-static std::string getHealth(
+inline std::string getHealth(
     nlohmann::json& sensorJson,
     const boost::container::flat_map<
         std::string, boost::container::flat_map<std::string, SensorVariant>>&
@@ -759,7 +759,7 @@
     return "OK";
 }
 
-static void setLedState(nlohmann::json& sensorJson,
+inline void setLedState(nlohmann::json& sensorJson,
                         const InventoryItem* inventoryItem)
 {
     if (inventoryItem != nullptr && !inventoryItem->ledObjectPath.empty())
@@ -775,7 +775,7 @@
             case LedState::BLINK:
                 sensorJson["IndicatorLED"] = "Blinking";
                 break;
-            default:
+            case LedState::UNKNOWN:
                 break;
         }
     }
@@ -793,7 +793,7 @@
  * @param inventoryItem D-Bus inventory item associated with the sensor.  Will
  * be nullptr if no associated inventory item was found.
  */
-void objectInterfacesToJson(
+inline void objectInterfacesToJson(
     const std::string& sensorName, const std::string& sensorType,
     std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp,
     const boost::container::flat_map<
@@ -1043,7 +1043,7 @@
     BMCWEB_LOG_DEBUG << "Added sensor " << sensorName;
 }
 
-static void
+inline void
     populateFanRedundancy(std::shared_ptr<SensorsAsyncResp> sensorsAsyncResp)
 {
     crow::connections::systemBus->async_method_call(
@@ -1250,7 +1250,7 @@
             "xyz.openbmc_project.Control.FanRedundancy"});
 }
 
-void sortJSONResponse(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp)
+inline void sortJSONResponse(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp)
 {
     nlohmann::json& response = SensorsAsyncResp->res.jsonValue;
     std::array<std::string, 2> sensorHeaders{"Temperatures", "Fans"};
@@ -1295,7 +1295,7 @@
  * @param invItemObjPath D-Bus object path of inventory item.
  * @return Inventory item within vector, or nullptr if no match found.
  */
-static InventoryItem* findInventoryItem(
+inline InventoryItem* findInventoryItem(
     std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
     const std::string& invItemObjPath)
 {
@@ -1315,7 +1315,7 @@
  * @param sensorObjPath D-Bus object path of sensor.
  * @return Inventory item within vector, or nullptr if no match found.
  */
-static InventoryItem* findInventoryItemForSensor(
+inline InventoryItem* findInventoryItemForSensor(
     std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
     const std::string& sensorObjPath)
 {
@@ -1363,7 +1363,7 @@
  * @param invItemObjPath D-Bus object path of inventory item.
  * @param sensorObjPath D-Bus object path of sensor
  */
-static void
+inline void
     addInventoryItem(std::shared_ptr<std::vector<InventoryItem>> inventoryItems,
                      const std::string& invItemObjPath,
                      const std::string& sensorObjPath)
@@ -1396,7 +1396,7 @@
  * @param interfacesDict Map containing D-Bus interfaces and their properties
  * for the specified inventory item.
  */
-static void storeInventoryItemData(
+inline void storeInventoryItemData(
     InventoryItem& inventoryItem,
     const boost::container::flat_map<
         std::string, boost::container::flat_map<std::string, SensorVariant>>&
@@ -2348,7 +2348,7 @@
  * @param chassisId Chassis that contains the power supply.
  * @return JSON PowerSupply object for the specified inventory item.
  */
-static nlohmann::json& getPowerSupply(nlohmann::json& powerSupplyArray,
+inline nlohmann::json& getPowerSupply(nlohmann::json& powerSupplyArray,
                                       const InventoryItem& inventoryItem,
                                       const std::string& chassisId)
 {
@@ -2416,7 +2416,7 @@
  * implements ObjectManager.
  * @param inventoryItems Inventory items associated with the sensors.
  */
-void getSensorData(
+inline void getSensorData(
     std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp,
     const std::shared_ptr<boost::container::flat_set<std::string>> sensorNames,
     const boost::container::flat_set<std::string>& connections,
@@ -2596,11 +2596,11 @@
         crow::connections::systemBus->async_method_call(
             getManagedObjectsCb, connection, objectMgrPath,
             "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
-    };
+    }
     BMCWEB_LOG_DEBUG << "getSensorData exit";
 }
 
-void processSensorList(
+inline void processSensorList(
     std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp,
     std::shared_ptr<boost::container::flat_set<std::string>> sensorNames)
 {
@@ -2651,7 +2651,7 @@
  *        chassis.
  * @param SensorsAsyncResp   Pointer to object holding response data
  */
-void getChassisData(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp)
+inline void getChassisData(std::shared_ptr<SensorsAsyncResp> SensorsAsyncResp)
 {
     BMCWEB_LOG_DEBUG << "getChassisData enter";
     auto getChassisCb =
@@ -2678,7 +2678,7 @@
  * @param sensorsModified  The list of sensors that were found as a result of
  *                         repeated calls to this function
  */
-bool findSensorNameUsingSensorPath(
+inline bool findSensorNameUsingSensorPath(
     std::string_view sensorName,
     boost::container::flat_set<std::string>& sensorsList,
     boost::container::flat_set<std::string>& sensorsModified)
@@ -2707,7 +2707,7 @@
  * @param allCollections   Collections extract from sensors' request patch info
  * @param chassisSubNode   Chassis Node for which the query has to happen
  */
-void setSensorsOverride(
+inline void setSensorsOverride(
     std::shared_ptr<SensorsAsyncResp> sensorAsyncResp,
     std::unordered_map<std::string, std::vector<nlohmann::json>>&
         allCollections)
@@ -2832,7 +2832,7 @@
     getChassis(sensorAsyncResp, std::move(getChassisSensorListCb));
 }
 
-bool isOverridingAllowed(const std::string& manufacturingModeStatus)
+inline bool isOverridingAllowed(const std::string& manufacturingModeStatus)
 {
     if (manufacturingModeStatus ==
         "xyz.openbmc_project.Control.Security.SpecialMode.Modes.Manufacturing")
@@ -2860,7 +2860,7 @@
  * @param allCollections   Collections extract from sensors' request patch info
  * @param chassisSubNode   Chassis Node for which the query has to happen
  */
-void checkAndDoSensorsOverride(
+inline void checkAndDoSensorsOverride(
     std::shared_ptr<SensorsAsyncResp> sensorAsyncResp,
     std::unordered_map<std::string, std::vector<nlohmann::json>>&
         allCollections)
@@ -2872,13 +2872,13 @@
         "xyz.openbmc_project.Security.SpecialMode"};
 
     crow::connections::systemBus->async_method_call(
-        [sensorAsyncResp, allCollections](const boost::system::error_code ec,
+        [sensorAsyncResp, allCollections](const boost::system::error_code ec2,
                                           const GetSubTreeType& resp) mutable {
-            if (ec)
+            if (ec2)
             {
                 BMCWEB_LOG_DEBUG
                     << "Error in querying GetSubTree with Object Mapper. "
-                    << ec;
+                    << ec2;
                 messages::internalError(sensorAsyncResp->res);
                 return;
             }
@@ -2972,8 +2972,9 @@
  * @param node  Node (group) of sensors. See sensors::node for supported values
  * @param mapComplete   Callback to be called with retrieval result
  */
-void retrieveUriToDbusMap(const std::string& chassis, const std::string& node,
-                          SensorsAsyncResp::DataCompleteCb&& mapComplete)
+inline void retrieveUriToDbusMap(const std::string& chassis,
+                                 const std::string& node,
+                                 SensorsAsyncResp::DataCompleteCb&& mapComplete)
 {
     auto typesIt = sensors::dbus::types.find(node);
     if (typesIt == sensors::dbus::types.end())